wger-project / docker

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

Exercise images are not loaded and exercise not visible from mobile #108

Open quietwalker-libre opened 1 week ago

quietwalker-libre commented 1 week ago

Hello people.

Today I tried to set up wger but there is something strange: when i manually trigger the exercise sync and the image download for them I don't see any image in the media volume, even if the download doesn't report any error:

root@HomeServer:/mnt/user/appdata/wger# docker exec -it wger-web-1 python3 manage.py download-exercise-images
INFO 2024-11-05 14:32:43,835 apps AXES: BEGIN version 7.0.0, blocking by ip_address
System check identified some issues:

WARNINGS:
?: (wger.W002) exercises without translations
    HINT: There are 2 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...
    successfully saved
[...]
Processing image 0705bc22-fadd-4c19-9c94-649a0b1f927f
    Image not found in local DB, creating now...
    successfully saved
Processing image ac8cb974-282b-467e-83e0-1019defc58f2
    Image not found in local DB, creating now...
    successfully saved
Processing image 7fab9de5-57cb-4ffa-adbc-ffeac468b26a
    Image not found in local DB, creating now...
    successfully saved
Processing image 300a44ac-4368-48e2-8b18-beea32ab915d
    Image not found in local DB, creating now...
    successfully saved

this also cause the impossibility to see the exercise images from "Exercises" page. If this could be useful, this is my docker compose file: https://pastebin.com/Wpdw2vVP and this is the prod.env content: https://pastebin.com/R5dZ0tuN

another problem, maybe related to the one described above, is that the static volume is empty and the server log reports:

0 static files copied to '/home/wger/static', 11786 unmodified.

the full log could be found at: https://pastebin.com/3NeeAwzR

anyway continuing my tests I created a new workout and a workout schedule but when I connect from the app I cannot see it. In addition I saw that if I try to create a new workout from mobile app directly, the exercises are not found and the autocomplete doesn't work as it does in the web UI. This is the same as reported here: https://github.com/wger-project/docker/issues/105

What's wrong here? I don't see anything obvious here so please could you point me in the right direction?

quietwalker-libre commented 1 week ago

I guess the following log message it's not a problem if it appear after a container restart, because I guess it copy files only the first time it start:

0 static files copied to '/home/wger/static', 11786 unmodified.

Indeed in my static volume I have files. The strange thing it that in the docker-compose the web service doesn't mount the media folder and I'm not sure it's correct. If it doesn't mount the media volume, where the downloaded images are stored instead?

quietwalker-libre commented 1 week ago

I also did another test mapping the volumes to a local path but nothing changed, I still have the same issue with images. For reference this is the docker-compose I used, where I also added to the "web" service container the media volume (even if it has not caused any positive impact): https://pastebin.com/gnUPftnp

It doesn't looks like a permission problem anyway. This is a screenshot of what I see when I analyze the images transferred Image

Coyote21 commented 6 days ago

I had the same issue when I tired to use the supplied docker-compse.yml file. To get things working I tried a similar fix to you, namely adding the media mount to the web: service but instead of making them Bind mounts I kept the Volume mounts. I think your issue might be that you are mounting "media" for the web: service at "/wger/media", but web: needs it to be mounted at "/home/wger/media". Note however, that nginx: expects it to be mounted at "/wger/media" and it should be Read Only (But it will probably still work if it's RW).

web: volumes:

nginx: volumes:

I hope this helps.

quietwalker-libre commented 2 days ago

thanks so much for your suggestion @Coyote21 Unfortunately it looks likes there is something else which still doesn't make it works as expected. This is how my compose file looks now with your suggested changes: https://pastebin.com/fzHEcH4m

and this is what it looks like from a browser perspective: Image