With the latest Aegir (3.4), Drush (8.0.3), Drupal (7.43) and CiviCRM (4.6.13), I get the following warnings on `verify` tasks:

CiviCRM: in _provision_civicrm_fixpermissions()	
-
Changed permissions of /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/templates_c to 2770	
-
Changed group ownership /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/templates_c to www-data	
-
fileperms(): stat failed for /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/upload FileSystem.php:148	
-
Could not change permissions /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/upload to 2770 (chmod to 2770 failed on /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/upload)	
-
chgrp(): No such file or directory FileSystem.php:448	
-
filegroup(): stat failed for /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/upload FileSystem.php:227	
-
Could not change group ownership of /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/upload to www-data (chgrp to www-data failed on /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/upload)	
-
fileperms(): stat failed for /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/persist FileSystem.php:148	
-
Could not change permissions /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/persist to 2770 (chmod to 2770 failed on /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/persist)	
-
chgrp(): No such file or directory FileSystem.php:448	
-
filegroup(): stat failed for /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/persist FileSystem.php:227	
-
Could not change group ownership of /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/persist to www-data (chgrp to www-data failed on /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/persist)	
-
Changed permissions of /var/aegir/platforms/demtools-civicrm-20160225/sites/contact-type-debug.demcloud.org/files/civicrm/custom to 2770

In fact, similar warnings are partially duplicated later as well.

It looks like we're trying to fix permissions on directories that have been deleted as part of a cache-clear, or something similar, but haven't been re-created yet. Also, we're ending up calling this code multiple times.

Patch forthcoming.

Comments

ergonlogic created an issue. See original summary.

ergonlogic’s picture

ergonlogic’s picture

Status: Active » Needs review
ergonlogic’s picture

I added a few more commits to that branch to:

  1. Create missing directories: http://cgit.drupalcode.org/hosting_civicrm/commit/?h=dev/2679048&id=9ae3...
  2. Run fix-permissions during upgrades: http://cgit.drupalcode.org/hosting_civicrm/commit/?h=dev/2679048&id=ea35...
  3. and finally, to run upgrade validation function prior to upgrade: http://cgit.drupalcode.org/hosting_civicrm/commit/?h=dev/2679048&id=3773...

With a recent upgrade to CiviCRM 4.6.14, I had to add the following:

   $civipaths = array(
     '/files/civicrm/templates_c',
+    '/files/civicrm/templates_c/en_US',
+    '/files/civicrm/templates_c/en_US/uk_UA',
+    '/files/civicrm/templates_c/en_US/fr_FR',
+    '/files/civicrm/templates_c/en_US/ru_RU',
+    '/files/civicrm/templates_c/en_US/es_ES',
+    '/files/civicrm/templates_c/en_US/ar_EG',
+    '/files/civicrm/templates_c/en_US/en_GB',
     '/files/civicrm/upload',
     '/files/civicrm/persist',
     '/files/civicrm/custom',

This is obviously wrong, but was required to get the upgrades to complete. I believe these latter bits are due to one or more bugs in CiviCRM.

helmo’s picture

I noticed similar chmod/chgrp warnings on a new install, the dev/2679048 branch solves these.

After opening the civi dashboard I do still get this one:

Directory /var/aegir/platforms/myplatform/sites/civi2.dev.exampl.com/files/civicrm/ext is not writable. Please change your file permissions.

I guess we should add a line for that:

diff --git a/drush/provision_civicrm.inc b/drush/provision_civicrm.inc
index 6cb6320..d4d70a8 100644
--- a/drush/provision_civicrm.inc
+++ b/drush/provision_civicrm.inc
@@ -150,6 +150,7 @@ function _provision_civicrm_fixpermissions() {
     '/files/civicrm/custom',
     '/files/civicrm/ConfigAndLog',
     '/files/civicrm/dynamic',
+    '/files/civicrm/ext',
   );
 
   foreach ($civipaths as $p) {
bgm’s picture

bgm’s picture

Status: Needs review » Fixed

Patch has been merged in 7.x-3.x / Aegir 3.5.

Status: Fixed » Closed (fixed)

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