I'm facing very strange behaviour on Drupal 8.8.5, CentOS Linux release 7.5.1804, PHP 7.2.19 and HTTPD - Apache/2.4.6
Basically, after updating to 8.8.5 (that has been a real headache), the system throws errors while flushing css+js files on "flush caches".
Drupal\Core\File\Exception\FileException: Failed to unlink file 'public://css/css_Y3zRgmC0P7yIXk_w_H9qyrPs3aMkKRv44SMfupbSCMc.css.gz'. in Drupal\Core\File\FileSystem->delete() (line 340 of/var/www/html/project/core/lib/Drupal/Core/File/FileSystem.php).
Warning: unlink(/var/www/html/project/sites/default/files/css/css_Y3zRgmC0P7yIXk_w_H9qyrPs3aMkKRv44SMfupbSCMc.css.gz): Permission denied in Drupal\Core\File\FileSystem->unlink() (line 124 of /var/www/html/synergie/core/lib/Drupal/Core/File/FileSystem.php)
This obviously leads to bad frontend and admin panel behaviour.
I've literally tried to do everything I could, by:
What I've found very strange, is that by manually debugging the unlink method on FileSystem.php, it lead to some strange results:
public://css/css_Y3zRgmC0P7yIXk_w_H9qyrPs3aMkKRv44SMfupbSCMc.css.gz: readable and writable
/var/www/html/project/sites/default/files/css/css_Y3zRgmC0P7yIXk_w_H9qyrPs3aMkKRv44SMfupbSCMc.css.gz: readable but not writable
Some notes: - Httpd runs on apache user and apache group
I've tried to do every possible combination of folder and write permission and owner and group to every directory and child subdirectories of /var/www/html/project/sites/
I've already tried to follow these instructions: Web Archive
I've also run this "folder and file permissions script": Drupal Website
Do you have ideas or suggestions? I cannot go past this one
Sounds like SELinux blocking...
Find current mode of SELinux and temporarily shut it down.
Getenforce # see current mode.
Sudo setenforce 0 # shut it down.
Try your thing. If that’s cause, just add rule to allow locations like /var/www/your Docroot