wger-project / docker

Production...ish docker-compose image for wger
GNU Affero General Public License v3.0
144 stars 48 forks source link

Using wger on UNRAID Server -> Permission denied #81

Closed UNRA1DUser closed 7 months ago

UNRA1DUser commented 9 months ago

Hi,

I installed the "wger-unraid" App on my Unraid Server. Selected a postgresql15 DB and only changed the Network Type from br0 to Bridge.

Here is the Unraid Docker Template.

`<?xml version="1.0"?>

wger-unraid wger/devel:latest https://registry.hub.docker.com/r/wger/devel bridge sh false https://wger.de/software/features wger (ˈvɛɡɐ) Workout Manager is a free, open source web application that help you manage your personal workouts, weight and diet plans and can also be used as a simple gym management utility. It offers a REST API as well, for easy integration with other projects and tools. Productivity: Other: http://[IP]:[PORT:8000] https://raw.githubusercontent.com/wger-project/unraid-templates/master/wger.xml https://raw.githubusercontent.com/wger-project/wger/master/wger/core/static/images/logos/logo.png 1709712937 8555 django.db.backends.postgresql wger wger wger 192.168.178.10 5432 Europe/Berlin http://wger.vaerstaerk.de /mnt/cache/appdata/wger/media /mnt/cache/appdata/wger/static True True 5^613=kj0wpq_2wl*yw$vs&v*3omg4w^j8xl4*j9-n7*95i#fc False True False False django_redis.client.DefaultClient

`

As I can see the "/mnt/cache/appdata/wger/static" and the "/mnt/cache/appdata/wger/media" folder are empty and I just get a Permission denied log entry if I am trying to open the Webpage ""

ERROR 2024-03-06 09:34:09,091 log Internal Server Error: /de/software/features Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/usr/local/lib/python3.10/dist-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 "/usr/local/lib/python3.10/dist-packages/django/shortcuts.py", line 24, in render content = loader.render_to_string(template_name, context, request, using=using) File "/usr/local/lib/python3.10/dist-packages/django/template/loader.py", line 62, in render_to_string return template.render(context, request) File "/usr/local/lib/python3.10/dist-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 175, in render return self._render(context) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 167, in _render return self.nodelist.render(context) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 1005, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 1005, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 966, in render_annotated return self.render(context) File "/usr/local/lib/python3.10/dist-packages/django/template/loader_tags.py", line 157, in render return compiled_parent._render(context) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 167, in _render return self.nodelist.render(context) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 1005, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 1005, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 966, in render_annotated return self.render(context) File "/usr/local/lib/python3.10/dist-packages/compressor/templatetags/compress.py", line 160, in render return self.render_compressed( File "/usr/local/lib/python3.10/dist-packages/compressor/templatetags/compress.py", line 131, in render_compressed rendered_output = compressor.output(mode, forced=forced, basename=file_basename) File "/usr/local/lib/python3.10/dist-packages/compressor/css.py", line 55, in output ret.append(subnode.output(*args, **kwargs)) File "/usr/local/lib/python3.10/dist-packages/compressor/css.py", line 57, in output return super().output(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/compressor/base.py", line 374, in output return self.handle_output(mode, filtered_output, forced, basename) File "/usr/local/lib/python3.10/dist-packages/compressor/base.py", line 382, in handle_output return output_func(mode, content, forced, basename) File "/usr/local/lib/python3.10/dist-packages/compressor/base.py", line 393, in output_file self.storage.save(new_filepath, ContentFile(content.encode(self.charset))) File "/usr/local/lib/python3.10/dist-packages/compressor/storage.py", line 39, in save temp_filename = super().save(filename, content) File "/usr/local/lib/python3.10/dist-packages/django/core/files/storage/base.py", line 38, in save name = self._save(name, content) File "/usr/local/lib/python3.10/dist-packages/django/core/files/storage/filesystem.py", line 87, in _save os.makedirs(directory, exist_ok=True) File "/usr/lib/python3.10/os.py", line 215, in makedirs makedirs(head, exist_ok=exist_ok) File "/usr/lib/python3.10/os.py", line 225, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: '/home/wger/static/CACHE' [06/Mar/2024 09:34:09] "GET /de/software/features HTTP/1.1" 500 2864 WARNING 2024-03-06 09:34:09,174 log Not Found: /static/yarn/components-font-awesome/css/all.css [06/Mar/2024 09:34:09] "GET /static/yarn/components-font-awesome/css/all.css HTTP/1.1" 404 2885 WARNING 2024-03-06 09:34:09,178 log Not Found: /static/css/workout-manager.css [06/Mar/2024 09:34:09] "GET /static/css/workout-manager.css HTTP/1.1" 404 2885 WARNING 2024-03-06 09:34:09,180 log Not Found: /static/yarn/bootstrap-compiled.css [06/Mar/2024 09:34:09] "GET /static/yarn/bootstrap-compiled.css HTTP/1.1" 404 2885 WARNING 2024-03-06 09:34:09,182 log Not Found: /static/css/bootstrap-custom.css [06/Mar/2024 09:34:09] "GET /static/css/bootstrap-custom.css HTTP/1.1" 404 2885

If I set the Permission on those folder to image

Than I am able to open the Website but I can´t see any pictures.

image

Has anyone been able to get wger to run on Unraid? I really want to use it. Can anybody maybe help me, please? I can also create a new Template if needed or add any value / port / etc.

Thanks!

losthymns commented 8 months ago

Also having the same issue. Would love to get it up and working. Let me know if you've gotten any further with this.

Bovive commented 8 months ago

Credit to this thread for the answer. Setting DJANGO_DEBUG=True as one of the env variables fixes the issue for me. Not sure if it matters but I changed my repo to wger/server:latest.

rolandgeider commented 8 months ago

While that is a workaround, the development server is not meant to be used in production and has some memory leaks.

We should definitely fix the config file itself

chandz05 commented 7 months ago

+1 on this. Got the container up and running on Unraid, but images aren't loading. The DJANGO_DEBUG=True env variable does indeed fix the issue.

UNRA1DUser commented 7 months ago

Yes It´s working! I used the Repository "wger/server:latest" and added the Key "DJANGO_DEBUG" with Value "True"

Thanks @All