Frequent 500s because of permission denied /app/code/tmp/cache
-
@benoit ah only saw this now after answering your support mail. This is expected since bundler should not run as root and thus should not have access to
/var/www
. In fact that folder is not really being utilized. Bundler anyways falls back to/tmp
.I didn't get the restart issue though, can you explain that one?
-
Oh I see. Since I had access to your instance for fixing the issue anyways, I saw that the app was healthy and running, but the nginx reverse proxy config wasn't correctly updated.
This may actually be a bug in Cloudron. The reason likely is that I've changed the app's internal port from 80 to 8000 to not require apache to run as root.To fix this quickly, I've just submitted the location form of the app configure, which triggers a recreation of the reverse proxy files.
At least for me the app is now reachable.
-
Based on my diagnosis, this is caused by the "worker" scheduler/cron task. Every time that runs (based on the log), I see a new file in /app/code/tmp/cache owned by root. Sometimes this new file is in a new directory (as the cache splits the storage across multiple directories on demand based on the random file name). When this newly created root owned folder is used by the normal process (running as www-data), it fails the permission check and users see the error message.
I've been "fixing" this by manually running
/app/code/tmp/cache# find -user root -exec chown www-data:www-data {} \;
at the terminal.
-
@peter-newman ah great observation, I will release a new package with a fix then. I guess I can revert the apache and thus port change patch then.
-
@nebulon said in Frequent 500s because of permission denied /app/code/tmp/cache:
Oh I see. Since I had access to your instance for fixing the issue anyways, I saw that the app was healthy and running, but the nginx reverse proxy config wasn't correctly updated.
This may actually be a bug in Cloudron. The reason likely is that I've changed the app's internal port from 80 to 8000 to not require apache to run as root.To fix this quickly, I've just submitted the location form of the app configure, which triggers a recreation of the reverse proxy files.
At least for me the app is now reachable.
This explains a lot.