Task "Upgrading resources of application 'G Suite'" fails. Permission denied.
Modified on: Fri, 17 Nov 2023 12:08 PMOriginal Publishing Date:
2020-01-22
2020-01-22
Symptoms
Task "Upgrading resources of application 'G Suite'" fails with error:
Internal error: APSC: Upgrade to ver. 3.0-208 : resource f127d174-8915-468a-b82f-9f6555fafa7a of type 'globals' (http://www.googleappsforwork.com/googleappsvault/globals/11.1) for APS application 'G Suite-3.0-208' : file_put_contents(typeCache/7989a4b5-6a38-49e2-b011-d8eee668018a.json): failed to open stream: Permission denied at /var/www/html/apsgoogle/lib/runtime/aps/2/cache.php:55.
Cause
Wrong ownership of 'typeCache' folder:
[root@endpoint ]# ll -d /var/www/html/apsgoogle/typeCache/
drwxrwxr-x 2 apache apache 4096 Mar 8 16:24 /var/www/html/apsgoogle/typeCache/
Since Google APS uses its own PHP handler /var/www/html/apsgoogle/cgi-bin/php-cgi
that runs on behalf on 'google' user:
[root@endpoint ]# ll /var/www/html/apsgoogle/cgi-bin/php-cgi
-r-xr-xr-x 1 google google 96 Jul 6 2017 /var/www/html/apsgoogle/cgi-bin/php-cgi
, that user should be able to write to 'typeCache' folder.
Resolution
Correct ownership accordingly:
[root@endpoint ]# chown google.google /var/www/html/apsgoogle/typeCache/