Replies: 1 comment
-
The documentation should probably mention that the https://craftcms.com/docs/3.x/config/config-settings.html#runqueueautomatically |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a solved problem. I found the solution as I typed this. I will leave the solution for other people.
The problem
When I try to log into the admin area, I sometimes get an Internal Server Error.
There are two types of errors in
storage/logs/web.log
:Some files in
/storage
do not have correct permissions. If I runchown -R www-data:www-data storage
, the admin area works again.The issue comes back every few days. I wake up in the morning and the Craft backend gives me an Internal Server Error.
The symptoms
My Craft setup
alpine:3.13
as the Docker image.php7-fpm
to process requests./storage
directory is not a Docker mounted volume, just a regular directory inside the image.* * * * * /var/www/craft queue/run >> /var/log/cron.log 2>&1
)The solution
www-data
(confirmed by the error log), but something is creating files in /storage asroot
....recurring task, running in the background... IT'S CRON!
cron runs the craft queue every minute as root. It creates files in /storage with root as the owner. When PHP tries to access them as www-data, it gets a permission error.
The solution: run the craft queue cronjob as
www-data
instead of the defaultroot
(add-u www-data
). Make sure that www-data has permission to run /var/www/craftBeta Was this translation helpful? Give feedback.
All reactions