Closed mateuszstonawski closed 2 years ago
You could join the container as user 1000
docker exec -u 1000 my-container ash
Then it is not letting me use the bin/console cache:clear
command.
With throwing the "same" error:
Unable to write in the "/var/www/html/var/cache/prod_h438eee902a83f223cb534a5e6ec3771f" directory.
Maybe because the cache folder is already wrong written. chown -R 1000;1000 /var/www/html don't fix it?
Ah nice, it seems that chown -R 1000 /var/www/html
now helped, so that I could use docker exec -itu 1000 my-container /bin/sh
and then bin/console cache:clear
. The frontend is then loading like it should.
Thanks for your quick help. :)
I am using the image in a docker-compose setup for local theme development. Therefore I am using the
bin/console cache:clear
command to clear the current cache with entering the container via CLI.But there is a permission issue that I currently don't know how to fix. Always when I'm clearing the cache with that command and enter the website, I am getting a 500 Internal Server Error. When entering the /admin, I am getting the json response saying:
Unable to create the cache directory (/var/www/html/var/cache/prod_h438eee902a83f223cb534a5e6ec3771f/twig/b3).
I already know that this has to be an issue with permissions but I could not find a working solution. I have already tried
sudo chown -R www-data:www-data /var/www/html/
but it did not help.When manually deleting the cache folder, the page loads again. But this seems not to be a clean work flow.
Did someone have the same issue and knows a solution?