I see the following types of errors when verifying a CiviCRM site:

Failed calling chmod() on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/templates_c/en_US/%%0C/0CB/0CBEC124%%default.tpl.php.	
-
Failed calling chmod() on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/templates_c/en_US/%%0C/0CB.	
-
Failed calling chmod() on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/templates_c/en_US/%%0C.

... and:

Failed calling chmod() on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/templates_c.	
-
Changed permissions of /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/templates_c to 2770	
-
chgrp(): Operation not permitted FileSystem.php:451	
-
Failed calling chgrp() on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/templates_c/en_US/%%CC/CCD/CCDBFFBE%%openFlashChart.tpl.php.	
-
chgrp(): Operation not permitted FileSystem.php:451	
-
Failed calling chgrp() on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/templates_c/en_US/%%CC/CCD.	
-
chgrp(): Operation not permitted FileSystem.php:451	
-
Failed calling chgrp() on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/templates_c/en_US/%%CC.

... and:

Failed calling chgrp() on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/templates_c.	
-
Changed group ownership /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/templates_c to www-data	
-
Failed calling chmod() on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/upload.	
-
fileperms(): stat failed for /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/upload FileSystem.php:148	
-
Could not change permissions /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/upload to 2770 (chmod to 2770 failed on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/upload)	
-
chgrp(): No such file or directory FileSystem.php:451	
-
Failed calling chgrp() on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/upload.	
-
filegroup(): stat failed for /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/upload FileSystem.php:227	
-
Could not change group ownership of /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/upload to www-data (chgrp to www-data failed on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/upload)	
-
Failed calling chmod() on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/persist.	
-
fileperms(): stat failed for /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/persist FileSystem.php:148	
-
Could not change permissions /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/persist to 2770 (chmod to 2770 failed on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/persist)	
-
chgrp(): No such file or directory FileSystem.php:451	
-
Failed calling chgrp() on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/persist.	
-
filegroup(): stat failed for /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/persist FileSystem.php:227	
-
Could not change group ownership of /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/persist to www-data (chgrp to www-data failed on /var/aegir/platforms/demtools-civicrm-20160726/sites/uacase-74.demcloud.org/files/civicrm/persist)
CommentFileSizeAuthor
#5 2791953-5.patch382 bytesergonlogic
#4 2791953-4.patch4.73 KBergonlogic
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ergonlogic created an issue. See original summary.

ergonlogic’s picture

I've posted this as a META issue, since this has been a long-standing issue that may have multiple factors causing it. If we can tease those apart, perhaps we can spawn more specific issue to address them.

ergonlogic’s picture

With the new file permission and ownership fixes to come out of #2616426: Add 'fix permissions' task, _provision_civicrm_fixpermissions() becomes pretty much redundant. Of course, that'd make those feature dependencies of hosting_civicrm...

There remains the code at the end of that function, to delete Config.IDS.ini files from various locations. Since that's essentially all that's left, I'd suggest renaming that function to something like _provision_civicrm_clear_config_cache()

A number of the warnings listed in the original bug report were due to attempts in _provision_civicrm_fixpermissions() to chgrp or chmod directories that don't exist.

Patch forthcoming.

ergonlogic’s picture

FileSize
4.73 KB

Here's a patch to clean up the permissions fix stuff.

ergonlogic’s picture

Status: Active » Needs review
FileSize
382 bytes

... and here's a patch to depend on the new features. I'm not certain this is really required, as such.

gboudrias’s picture

Patch #4 works afaict. At least the patch applies and the warnings are no longer appearing.

For anyone else wanting to test this patch: You need to run install.sh in both fix_permissions and fix_ownership as root after enabling the respective modules.

Edit: I meant Patch #4, not 5.

ShaneOnABike’s picture

I would be happy to test this but honestly I don't understand what you mean by running install.sh? I'm presently running into this issue

gboudrias’s picture

Status: Needs review » Reviewed & tested by the community

It's been a while since I tested this, but the fix_permissions and fix_ownership modules need to be "installed" by a root user, since you need to give the Aegir user the access to change file permissions (which normally requires root itself).

The install scripts are in fix_ownership/scripts and fix_ownership/scripts respectively, which are both part of hosting_tasks_extra (which comes with Aegir and is in the hostmaster profile).

ShaneOnABike’s picture

Yahoo! This works a charm can we roll it into the module?

  • helmo committed 45a13e9 on 7.x-3.x authored by ergonlogic
    Issue #2791953 by ergonlogic: [META] File operation failures
    
helmo’s picture

Status: Reviewed & tested by the community » Fixed

committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

bgm’s picture

Heads up: this caused an important regression that can cause obscure bugs: https://www.drupal.org/project/hosting_civicrm/issues/2972031

joegl’s picture

I am not sure which issue to comment on because this seems to be common problem. When we verify a site with CiviCRM the files/civicrm/templates_c directory has its permissions, owner, and group changed from whatever it was set to. This is not limited to that one directory, but that's the one that causes the entire website to bomb/WSOD.

This is on Drupal 7.57, CiviCRM 5.9.1, and Hosting CiviCRM 7.3.170.

bgm’s picture

Hi @joegl, that sounds like #2972031: Regression: template_c must be setguid, which is still open (I posted a workaround there, but we should really implement a better fix).