Bolt: [BUG] Permissions keep reverting when updating/clearing cache

Created on 10 Apr 2017  路  4Comments  路  Source: bolt/bolt

Just updated Bolt and got permissions errors:

Script Bolt\Composer\ScriptHandler::installAssets handling the post-update-cmd event terminated with an exception

[Bolt\Filesystem\Exception\IOException]
Failed to delete file

I made sure to chmod the whole app/cache directory to 777 and then updated again and it worked. Then I ran php app/nut cache:clear (worked fine) followed by php app/nut database:update which gives an error:

[InvalidArgumentException]
The directory "/path/to/app/cache/development/data" is not writable.

The problem is that when the cache is cleared, the data directory is removed and recreated with different permissions (755) and a different user (_www) so now running anything from the command line doesn't work.

Details

  • Relevant Bolt Version: 3.2.10
  • Install type: Composer install
  • PHP version: 5.5.38
  • Used web server: Apache 2.4.25
question

All 4 comments

This is not a bug. I can see how this can be annoying, but it's a consequence of the way your server was set up.

Either make sure the webuser and "CLI user" are the same, or you could try my _CHMODINATOR_ 馃 extension to ease the pain: https://market.bolt.cm/view/bobdenotter/chmodinator

Sorry I don't see how this is not a bug. The fact you have a plugin to work around this issue clearly shows something is wrong.

What is incorrect about the way my server was set up? There is a special user that the web server uses (www or www-data), that's how every server I've ever seen in 15+ years works too. The "webuser and CLI user" cannot be the same.

At the very least you should use permissions of 775 so that I can set my CLI user and www to the same group.

umask, setfacl?

Workaround for people that don't understand umask in #6827

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dolcy picture dolcy  路  5Comments

xiaohutai picture xiaohutai  路  5Comments

develth picture develth  路  5Comments

Mariyo picture Mariyo  路  3Comments

GwendolenLynch picture GwendolenLynch  路  5Comments