Container startup takes hours before being ready to handle requests
Everytime I restart my wallabag container, it takes hours before the container is ready to begin servicing requests. This started after upgrading from 2.4.2 to 2.4.3. Below is the output of ps -elf run as root inside the container. Please note that process 7 is 1h42 and the server is still not ready to handle requests.
bash-5.0# ps -elf
PID USER TIME COMMAND
1 root 0:00 {entrypoint.sh} /bin/sh /entrypoint.sh wallabag
7 root 1h42 {ansible-playboo} /usr/bin/python3 /usr/bin/ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local
230 root 0:00 {ansible-playboo} /usr/bin/python3 /usr/bin/ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local
241 root 0:00 /bin/sh -c /usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1649526269.6815948-230-49720380011236/AnsiballZ_file.py && sleep 0
242 root 3:58 /usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1649526269.6815948-230-49720380011236/AnsiballZ_file.py
243 root 0:00 bash
250 root 0:00 bash
265 root 0:00 ps -elf
so I did some digging and it appears that it is hanging trying to chown nobody:nogroup the entire /var/www/wallabag directory at start. Is there a reason why it does this?
It's to ensure permission are ok for the server to write log and other stuff.
It's to ensure permission are ok for the server to write log and other stuff.
Why would the permissions have changed? This check is extremely unnecessary to run every single time the container starts. I am running a single-user instance and it takes hours to check and set permissions on every single cached image. I have had to get in the habit of moving the image directory OUT of the mapped volume just so it will boot quickly, then move the images back in.
I can understand. But what did you suggest instead? We should ensure permission ok when running the container. What are other option to avoid running it every time someone restart its container?
do the check once on the first time the container is started then never again? it would be unusual for the permissions on these directories to be changed after the container sets them the first time it starts unless someone intentionally went in and changed them, breaking their system. Assuming that the average user isn't going to intentionally change permissions to break their installs, lengthy re-checking of permissions isn't necessary every time
I'm ok for that, you can open a PR to fix the problem :)
something changed upstream the docker image no longer exhibits this behavior as of the 2.5.3 image. Closing this Issue. Thanks for fixing this! Startup of my wallabag server now takes < 1 minute!