Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when adding new exercise to routine #1780

Closed
franznemeth opened this issue Sep 30, 2024 · 3 comments
Closed

Problem when adding new exercise to routine #1780

franznemeth opened this issue Sep 30, 2024 · 3 comments

Comments

@franznemeth
Copy link

Steps to Reproduce

  1. Create new routine
  2. Add new training day to routine
  3. Add exercise
  4. Start typing "Row" and wait for autocompletion

Expected results:
Exercise can be added

Actual results:
An exception is thrown which after some exercises will bring the app to crash.

Important note: I'm running wger in Kubernetes. I'm using a slightly modified form of the wger helm chart with an external PostgreSQL instance. If it helps in debugging I will share my manifests.

Logs
wger-app-86f8f964b5-x5x42 wger 127.0.0.1 - - - 10.42.0.23 - 10.42.0.23, 10.42.2.92 - [30/Sep/2024:20:35:42 +0200] "GET /api/v2/exercise/search/?language=de,en&term=Row HTTP/1.1" 500 2864 "https://my.instance.net/de/routine/set/1/add" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
wger-app-86f8f964b5-x5x42 wger ERROR 2024-09-30 20:35:44,674 log Internal Server Error: /api/v2/exercise/search/
wger-app-86f8f964b5-x5x42 wger Traceback (most recent call last):
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/PIL/JpegImagePlugin.py", line 639, in _save
wger-app-86f8f964b5-x5x42 wger     rawmode = RAWMODE[im.mode]
wger-app-86f8f964b5-x5x42 wger KeyError: 'P'
wger-app-86f8f964b5-x5x42 wger
wger-app-86f8f964b5-x5x42 wger The above exception was the direct cause of the following exception:
wger-app-86f8f964b5-x5x42 wger
wger-app-86f8f964b5-x5x42 wger Traceback (most recent call last):
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/django/core/handlers/exception.py", line 55, in inner
wger-app-86f8f964b5-x5x42 wger     response = get_response(request)
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/django/core/handlers/base.py", line 197, in _get_response
wger-app-86f8f964b5-x5x42 wger     response = wrapped_callback(request, *callback_args, **callback_kwargs)
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
wger-app-86f8f964b5-x5x42 wger     return view_func(*args, **kwargs)
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/django/views/generic/base.py", line 104, in view
wger-app-86f8f964b5-x5x42 wger     return self.dispatch(request, *args, **kwargs)
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/rest_framework/views.py", line 509, in dispatch
wger-app-86f8f964b5-x5x42 wger     response = self.handle_exception(exc)
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/rest_framework/views.py", line 469, in handle_exception
wger-app-86f8f964b5-x5x42 wger     self.raise_uncaught_exception(exc)
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
wger-app-86f8f964b5-x5x42 wger     raise exc
wger-app-86f8f964b5-x5x42 nginx 10.42.2.92 - - [30/Sep/2024:18:35:44 +0000] "GET /api/v2/exercise/search/?language=de,en&term=Row HTTP/1.1" 500 3249 "https://my.instance.net/de/routine/set/1/add" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" "10.42.0.23"
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/rest_framework/views.py", line 506, in dispatch
wger-app-86f8f964b5-x5x42 wger     response = handler(request, *args, **kwargs)
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/rest_framework/decorators.py", line 50, in handler
wger-app-86f8f964b5-x5x42 wger     return func(*args, **kwargs)
wger-app-86f8f964b5-x5x42 wger   File "/home/wger/src/wger/exercises/api/views.py", line 378, in search
wger-app-86f8f964b5-x5x42 wger     thumbnail = t.get_thumbnail(aliases.get('micro_cropped')).url
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/easy_thumbnails/files.py", line 513, in get_thumbnail
wger-app-86f8f964b5-x5x42 wger     thumbnail = self.generate_thumbnail(
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/easy_thumbnails/files.py", line 401, in generate_thumbnail
wger-app-86f8f964b5-x5x42 wger     img = engine.save_pil_image(
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/easy_thumbnails/engine.py", line 77, in save_pil_image
wger-app-86f8f964b5-x5x42 wger     image.save(destination, format=format, **options)
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/PIL/Image.py", line 2568, in save
wger-app-86f8f964b5-x5x42 wger     save_handler(self, fp, filename)
wger-app-86f8f964b5-x5x42 wger   File "/usr/local/lib/python3.10/dist-packages/PIL/JpegImagePlugin.py", line 642, in _save
wger-app-86f8f964b5-x5x42 wger     raise OSError(msg) from e
wger-app-86f8f964b5-x5x42 wger OSError: cannot write mode P as JPEG
wger-app-86f8f964b5-x5x42 wger 127.0.0.1 - - - 10.42.0.23 - 10.42.0.23, 10.42.2.92 - [30/Sep/2024:20:35:44 +0200] "GET /api/v2/exercise/search/?language=de,en&term=Row HTTP/1.1" 500 2864 "https://my.instance.net/de/routine/set/1/add" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
@Pr0mises
Copy link

I have the exact same issue.
Server: RaspberryPi 5
Docker Image: wger/server:latest
Android client: App: 1.7.6

Additional information:
My Exercises as well as my nutritions chart aren't updating as well on the Android client.
E.g. I've a full workout routing added using the webpage via browser but those exercises aren't synced to my android client. While trying to add a routine on android the error appears as descriped in this issue.
Adding nutritions via the android app works somehow. The product is added but the main chart isn't updating on the android client. The chart is only updated on via browser (so this sync works).

Logs
wger-web-1            | ERROR 2024-10-15 00:23:08,578 log Internal Server Error: /api/v2/exercise/search/
wger-web-1            | Traceback (most recent call last):
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/PIL/JpegImagePlugin.py", line 639, in _save
wger-web-1            |     rawmode = RAWMODE[im.mode]
wger-web-1            |               ~~~~~~~^^^^^^^^^
wger-web-1            | KeyError: 'P'
wger-web-1            | 
wger-web-1            | The above exception was the direct cause of the following exception:
wger-web-1            | 
wger-web-1            | Traceback (most recent call last):
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
wger-web-1            |     response = get_response(request)
wger-web-1            |                ^^^^^^^^^^^^^^^^^^^^^
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
wger-web-1            |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
wger-web-1            |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
wger-web-1            |     return view_func(*args, **kwargs)
wger-web-1            |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/django/views/generic/base.py", line 104, in view
wger-web-1            |     return self.dispatch(request, *args, **kwargs)
wger-web-1            |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/rest_framework/views.py", line 509, in dispatch
wger-web-1            |     response = self.handle_exception(exc)
wger-web-1            |                ^^^^^^^^^^^^^^^^^^^^^^^^^^
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/rest_framework/views.py", line 469, in handle_exception
wger-web-1            |     self.raise_uncaught_exception(exc)
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
wger-web-1            |     raise exc
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/rest_framework/views.py", line 506, in dispatch
wger-web-1            |     response = handler(request, *args, **kwargs)
wger-web-1            |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/rest_framework/decorators.py", line 50, in handler
wger-web-1            |     return func(*args, **kwargs)
wger-web-1            |            ^^^^^^^^^^^^^^^^^^^^^
wger-web-1            |   File "/home/wger/src/wger/exercises/api/views.py", line 378, in search
wger-web-1            |     thumbnail = t.get_thumbnail(aliases.get('micro_cropped')).url
wger-web-1            |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/easy_thumbnails/files.py", line 513, in get_thumbnail
wger-web-1            |     thumbnail = self.generate_thumbnail(
wger-web-1            |                 ^^^^^^^^^^^^^^^^^^^^^^^^
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/easy_thumbnails/files.py", line 401, in generate_thumbnail
wger-web-1            |     img = engine.save_pil_image(
wger-web-1            |           ^^^^^^^^^^^^^^^^^^^^^^
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/easy_thumbnails/engine.py", line 77, in save_pil_image
wger-web-1            |     image.save(destination, format=format, **options)
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/PIL/Image.py", line 2568, in save
wger-web-1            |     save_handler(self, fp, filename)
wger-web-1            |   File "/home/wger/.local/lib/python3.12/site-packages/PIL/JpegImagePlugin.py", line 642, in _save
wger-web-1            |     raise OSError(msg) from e
wger-web-1            | OSError: cannot write mode P as JPEG

@dark-mango-bot
Copy link

dark-mango-bot commented Oct 16, 2024

+1 Please help. It's preventing user's from creating new workouts with excercises. "Leg", "Curls" search is broken aswell.

@rolandgeider
Copy link
Member

This is a duplicate for wger-project/docker#102

The latest images should contain a workaround so that things should at least not break. I'm closing here, if there's still something else broken, please comment in the other issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants