docker icon indicating copy to clipboard operation
docker copied to clipboard

Exercises don't load in mobile app - Using Unraid

Open Fuegofandango opened this issue 1 year ago • 5 comments

Hello, I'm using this app in conjunction with Postgres 17 in Unraid, which I know has minimal support. The current version of the Unraid app is using the developer version and when using it, wasn't loading the CSS. I got around this by switching to wger/server:latest from wger/devel:latest. However, I am still having an issue where the workouts will not load on the mobile app on Android. This is true for both the Play Store and F-Droid versions. They do load on the desktop site. I was looking through some of the issues on this repo and found that it may be due to an issue with my reverse proxy/web server set up and Django DB. Specifically #942 and #32. Roland says "You need to setup a webserver to serve the static files, Django does not serve them on its own". I am not using Nginx since I am using HAProxy built into my PFsense router. I am including the screenshots of my front end and back end. If you know how I should configure HAProxy in this case to serve the static files from Django, that would be greatly appreciated. This is all assuming that the static files work differently on mobile vs. desktop. If not, then there's a different issue going on.

Thanks.

The app not loading workouts (it just loads forever): Image The desktop site working fine (instantly loads): Image My Unraid settings for wger: Image My Unraid settings for Postgres 17 (I created a new database with the CLI for wger): Image HAProxy frontend settings in PFSense: Image HAProxy backend settings in PFSense: Image

Fuegofandango avatar Oct 15 '24 18:10 Fuegofandango

I asked a friend to make an account from their phone and they were able to search for exercises no issue so it's something to do with my phone. Closing the issue.

Fuegofandango avatar Oct 15 '24 19:10 Fuegofandango

if you changed docker images, this might be an issue with inproper caching? You can go to settings and reset and see if that helps.

Also, I see that you are setting debug to true to serve the static files, just so you know "This method is grossly inefficient and probably insecure, so it is unsuitable for production." 😉

rolandgeider avatar Oct 15 '24 20:10 rolandgeider

Gotcha. I'm tentatively reopening this issue as more friends reported the same issue. I'll close it after trying this all out. Thanks!

Fuegofandango avatar Oct 15 '24 20:10 Fuegofandango

Okay, so after reinstalling wger and replicating my settings and resetting the database, the site is no longer reachable without setting DJANGO_DEBUG to true. Image I'm getting the following stacktrace:

ERROR 2024-10-15 13:52:18,098 log Internal Server Error: /en/software/features
Traceback (most recent call last):
  File "/home/wger/.local/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/src/wger/software/views.py", line 67, in features
    return render(request, 'features.html', context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/shortcuts.py", line 24, in render
    content = loader.render_to_string(template_name, context, request, using=using)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/template/loader.py", line 62, in render_to_string
    return template.render(context, request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/template/base.py", line 175, in render
    return self._render(context)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/template/base.py", line 167, in _render
    return self.nodelist.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/template/base.py", line 1005, in render
    return SafeString("".join([node.render_annotated(context) for node in self]))
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/template/base.py", line 966, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/template/loader_tags.py", line 157, in render
    return compiled_parent._render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/template/base.py", line 167, in _render
    return self.nodelist.render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/template/base.py", line 1005, in render
    return SafeString("".join([node.render_annotated(context) for node in self]))
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/template/base.py", line 966, in render_annotated
    return self.render(context)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/compressor/templatetags/compress.py", line 160, in render
    return self.render_compressed(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/compressor/templatetags/compress.py", line 131, in render_compressed
    rendered_output = compressor.output(mode, forced=forced, basename=file_basename)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/compressor/css.py", line 55, in output
    ret.append(subnode.output(*args, **kwargs))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/compressor/css.py", line 57, in output
    return super().output(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/compressor/base.py", line 374, in output
    return self.handle_output(mode, filtered_output, forced, basename)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/compressor/base.py", line 382, in handle_output
    return output_func(mode, content, forced, basename)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/compressor/base.py", line 393, in output_file
    self.storage.save(new_filepath, ContentFile(content.encode(self.charset)))
  File "/home/wger/.local/lib/python3.12/site-packages/compressor/storage.py", line 52, in save
    temp_filename = super().save(filename, content)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/core/files/storage/base.py", line 49, in save
    name = self._save(name, content)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wger/.local/lib/python3.12/site-packages/django/core/files/storage/filesystem.py", line 87, in _save
    os.makedirs(directory, exist_ok=True)
  File "<frozen os>", line 215, in makedirs
  File "<frozen os>", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/home/wger/static/CACHE'

It seems it can't make the static cache.

Fuegofandango avatar Oct 15 '24 20:10 Fuegofandango

Seems related to https://github.com/wger-project/wger/issues/1780 ?

dark-mango-bot avatar Oct 16 '24 10:10 dark-mango-bot