docker icon indicating copy to clipboard operation
docker copied to clipboard

Only text on website, no backgrounds, no CSS, nothing

Open hyserski opened this issue 4 months ago • 6 comments

Hello, I freshly installed your docker image on my Almalinux server, and I'm having issues...

As far as I'm aware this shouldn't look like that:

Image

Only changes I did are the the container files to be stored on a different drive, but your compose file was set & done, so maybe I changed something that broken the look of the website. How to I fix this? Does your docker container really can be set only 1 way? (apart of few environments like dev, prod etc.) I need to have all the files on a different drive, because almalinux is on a system ssd where only system is meant to exist.

What I changed:

,,services: web: image: wger/server:latest depends_on: db: condition: service_healthy cache: condition: service_healthy env_file: - ./config/prod.env volumes: - static:/mnt/md0/containers_data/wger/static - media:/mnt/md0/containers_data/media"

hyserski avatar Aug 06 '25 03:08 hyserski

Same issue here. I got this log with permission error I guess. PermissionError: [Errno 13] Permission denied: '/home/wger/media/exercise-images'. Any help?

return manager._insert( ^^^^^^^^^^^^^^^^ File "/home/wger/.local/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/wger/.local/lib/python3.12/site-packages/django/db/models/query.py", line 1868, in _insert return query.get_compiler(using=using).execute_sql(returning_fields) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/wger/.local/lib/python3.12/site-packages/django/db/models/sql/compiler.py", line 1882, in execute_sql cursor.execute(sql, params) File "/home/wger/.local/lib/python3.12/site-packages/django/db/backends/utils.py", line 122, in execute return super().execute(sql, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/wger/.local/lib/python3.12/site-packages/django/db/backends/utils.py", line 79, in execute return self._execute_with_wrappers( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/wger/.local/lib/python3.12/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers return executor(sql, params, many, context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/wger/.local/lib/python3.12/site-packages/django/db/backends/utils.py", line 100, in _execute with self.db.wrap_database_errors: File "/home/wger/.local/lib/python3.12/site-packages/django/db/utils.py", line 91, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/home/wger/.local/lib/python3.12/site-packages/django/db/backends/utils.py", line 105, in _execute return self.cursor.execute(sql, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/wger/.local/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute raise ex.with_traceback(None) django.db.utils.IntegrityError: duplicate key value violates unique constraint "exercises_deletionlog_uuid_2b4f5ae1_uniq" DETAIL: Key (uuid)=(fb0c8c53-27ec-4aac-ab6e-403b7d7f250b) already exists. Downloading exercise images level=INFO ts=2025-08-13 09:55:57,764 module=apps path=/home/wger/.local/lib/python3.12/site-packages/axes/apps.py line=53 message=AXES: BEGIN version 8.0.0, blocking by ip_address System check identified some issues: : ?: (wger.W002) exercises without translations HINT: There are 10 exercises without translations, this will cause problems! You can output or delete them with "python manage.py exercises-health-check --help" *** Processing images *** Processing image ef0b00e2-3323-4e7f-88fe-d71ef34b3384 Image not found in local DB, creating now... Traceback (most recent call last): File "/home/wger/src/wger/exercises/sync.py", line 402, in download_exercise_images ExerciseImage.objects.get(uuid=image_uuid) File "/home/wger/.local/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/wger/.local/lib/python3.12/site-packages/django/db/models/query.py", line 633, in get raise self.model.DoesNotExist( wger.exercises.models.image.ExerciseImage.DoesNotExist: ExerciseImage matching query does not exist. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/wger/src/manage.py", line 24, in <module> execute_from_command_line(sys.argv) File "/home/wger/.local/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/home/wger/.local/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/wger/.local/lib/python3.12/site-packages/django/core/management/base.py", line 416, in run_from_argv self.execute(*args, **cmd_options) File "/home/wger/.local/lib/python3.12/site-packages/django/core/management/base.py", line 460, in execute output = self.handle(*args, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/wger/src/wger/exercises/management/commands/download-exercise-images.py", line 47, in handle download_exercise_images(self.stdout.write, options['remote_url'], self.style.SUCCESS) File "/home/wger/src/wger/exercises/sync.py", line 408, in download_exercise_images image = ExerciseImage.from_json(exercise, retrieved_image, image_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/wger/src/wger/exercises/models/image.py", line 207, in from_json image.save_image(retrieved_image, json_data) File "/home/wger/src/wger/utils/helpers.py", line 185, in save_image self.image.save( File "/home/wger/.local/lib/python3.12/site-packages/django/db/models/fields/files.py", line 99, in save self.name = self.storage.save(name, content, max_length=self.field.max_length) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 100, 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/media/exercise-images' level=INFO ts=2025-08-13 09:56:01,325 module=apps path=/home/wger/.local/lib/python3.12/site-packages/axes/apps.py line=53 message=AXES: BEGIN version 8.0.0, blocking by ip_address System check identified some issues: : ?: (wger.W002) exercises without translations HINT: There are 10 exercises without translations, this will cause problems! You can output or delete them with "python manage.py exercises-health-check --help" Set site URL to 192.168.50.47:8456 Using gunicorn... level=INFO ts=2025-08-13 09:56:03,175 module=apps path=/home/wger/.local/lib/python3.12/site-packages/axes/apps.py line=53 message=AXES: BEGIN version 8.0.0, blocking by ip_address [2025-08-13 09:56:03 +0200] [79] [INFO] Starting gunicorn 23.0.0 [2025-08-13 09:56:03 +0200] [79] [INFO] Listening at: http://0.0.0.0:8000 (79) [2025-08-13 09:56:03 +0200] [79] [INFO] Using worker: gthread [2025-08-13 09:56:03 +0200] [89] [INFO] Booting worker with pid: 89 [2025-08-13 09:56:03 +0200] [90] [INFO] Booting worker with pid: 90 [2025-08-13 09:56:03 +0200] [91] [INFO] Booting worker with pid: 91 level=INFO ts=2025-08-13 10:01:02,380 module=cache path=/home/wger/.local/lib/python3.12/site-packages/axes/handlers/cache.py line=174 message=AXES: Successful login by {username: "********************", ip_address: "********************", user_agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36", path_info: "/zh-hans/dashboard"}.

asteedma avatar Aug 13 '25 08:08 asteedma

What permissions owners do the static and media files have? They should belong to the uid 1000 and be readable by everyone

PS: are the paths supposed to be different? /mnt/md0/containers_data/wger/static vs /mnt/md0/containers_data/media ?

rolandgeider avatar Aug 14 '25 16:08 rolandgeider

I made a mistake in here - correct path for both should be the same with only folder in the end being different. It doesn't matter now. I was trying many things, but I forgot to give more context.

I was using Podman. Recently I switched to almalinux (to learn enterprise RHEL) & it comes with Podman. I was trying to run wger (alongside other containers) & I was having some issues. I was so mad, that I just went Portainer (which I avoided, because OpenMediaVault I used previously had Docker GUI & there is cockpit-podman that gives ui for podman) way & I still had the same issue as above with wger. I even used the option to make container from Github source - still the same issue - text on white website. I noticed Podman has some kind of issues to use .env files in my case. Immich container shows ,,no database password error" when password is correctly provided in .env file. It's supposed to work the same way, but it seems like it's not.

Anyway - I will install debian on my home server with docker again & I will come back here with the results.

hyserski avatar Aug 16 '25 23:08 hyserski

What permissions owners do the static and media files have? They should belong to the uid 1000 and be readable by everyone

PS: are the paths supposed to be different? /mnt/md0/containers_data/wger/static vs /mnt/md0/containers_data/media ?

To me, owner has full permission rw. However, it still doesn't show any image.

asteedma avatar Aug 18 '25 07:08 asteedma

this still sounds like a permission problem (this is probably the most common setup error, but is the way django works and there's not much we can do) and one of the reasons why the default config uses volumes as they usually don't make that much trouble. Can you perhaps manually exec into a) the web container and try to write to the static and media folders and b) the nginx one and try to read/access them?

@hyserski I haven't used podman, so it might behave differently in some corner cases like the .env handling?

rolandgeider avatar Aug 18 '25 11:08 rolandgeider

I'm back with ,,results". I removed Podman from my system, installed Docker & Portainer & after some initial hiccups I managed to run Wger with only changes: ,,volumes:

  • static:/mnt/md1/containers_data/wger/static
  • media:/mnt/md1/containers_data/wger/media" Changes made in override compose file. Website works now & all I lack now is time to test all of the other functionality. I have 1 suggestion for wger mobile app project tho - I would love for wger app to work offline when server is not available & when server appears to just sync all the data. Now the mobile app works kinda like a mobile website which is not what I need (unless I'm doing something wrong). It's off topic here, so I will submit the issue in correct place later.

hyserski avatar Aug 30 '25 00:08 hyserski