ongr-io / ElasticsearchBundle

Symfony bundle for Elasticsearch with steroids
MIT License
313 stars 189 forks source link

var/$env/cache/ongr/elasticsearch is not writeable #968

Open pkly opened 3 years ago

pkly commented 3 years ago

It seems like the bundle doesn't automatically change permissions for the folder to actually write to cache when creating it, it sometimes works and sometimes causes a 500 error, which is rather easily fixable via chmod, but it shouldn't happen in the first place.

piotr-cz commented 2 years ago

Same here, The var/cache/$env directories have chmod 40777, while only the var/cache/$env/ongr and it's subdirectories have chmod 40775 every time we run bin/console cache:clear command.

Since we run deploy with other user than we run cron commands, we end up with an exception:

[InvalidArgumentException]
The directory "/xxx/var/cache/prod/ongr/elasticsearch" is not writable.

This could be related to the doctrine/cache package which creates directories with 775 permissions/ umask 0002 by default (https://github.com/doctrine/cache/blob/1.4.x/lib/Doctrine/Common/Cache/FilesystemCache.php#L35)