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

Exercises don't load in mobile app - Using Unraid #105

Open
Fuegofandango opened this issue Oct 15, 2024 · 5 comments
Open

Exercises don't load in mobile app - Using Unraid #105

Fuegofandango opened this issue Oct 15, 2024 · 5 comments

Comments

@Fuegofandango
Copy link

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
Copy link
Author

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.

@rolandgeider
Copy link
Member

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." 😉

@Fuegofandango
Copy link
Author

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
Copy link
Author

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 Fuegofandango reopened this Oct 15, 2024
rolandgeider added a commit to wger-project/wger that referenced this issue Oct 16, 2024
@dark-mango-bot
Copy link

Seems related to wger-project/wger#1780 ?

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

3 participants