monicahq / docker

docker image of Monica
https://hub.docker.com/_/monica/
GNU General Public License v2.0
203 stars 61 forks source link

Sudden problem with filesystem permissions - chmod -R fails #149

Open NateRobinsonS opened 5 months ago

NateRobinsonS commented 5 months ago

I've been using Monica (4) in Docker for about a year without much difficulty. However, the latest release, or potentially another recent change in docker, seems to have caused a problem.

Upon startup, the entrypoing.sh tries runs chown -R www-data:www-data ${STORAGE} which works find. Then chmod -R g+rw ${STORAGE} fails with a Operation not permitted error for each file. As such, the container never comes up and restarts continually.

To debug, I can enter the (cron) container (that doesn't call entrypoint.sh). As the root user in this shell, I can perform chmod g+rw on individual files. However, using the recursive version chmod -R g+rw on a directory fails (once for each file in the directory). (I find this very strange.)

Adding priveleged: true to the service definition in my docker_compose file "solves" the problem, but I don't like running the container

If it matters, I migrated to the fpm-alpine image about a month ago, but this seems unlikely to be relevant to me. I definitely had fpm-alpine running properly before.