Nextcloud Upgrade Fails - Check Write Permissions

I’m trying to upgrade from Nextcloud 11.0.3 to 12.0.1 as the Nextcloud Updater suggests to me. The process fails at step “Check write permissions”.

Check for write permissions
The following places can not be written to:

/var/www/html/nextcloud/updater/../.
/var/www/html/nextcloud/updater/../3rdparty/.
/var/www/html/nextcloud/updater/../3rdparty/sabre/.
/var/www/html/nextcloud/updater/../3rdparty/sabre/vobject/.
/var/www/html/nextcloud/updater/../3rdparty/sabre/vobject/composer.json
/var/www/html/nextcloud/updater/../3rdparty/sabre/vobject/.gitignore
/var/www/html/nextcloud/updater/../3rdparty/sabre/vobject/LICENSE
/var/www/html/nextcloud/updater/../3rdparty/sabre/vobject/lib/.
/var/www/html/nextcloud/updater/../3rdparty/sabre/vobject/lib/StringUtil.php
/var/www/html/nextcloud/updater/../3rdparty/sabre/vobject/lib/Parser/.
/var/www/html/nextcloud/updater/../3rdparty/sabre/vobject/lib/Parser/XML.php
/var/www/html/nextcloud/updater/../3rdparty/sabre/vobject/lib/Parser/Parser.php
/var/www/html/nextcloud/updater/../3rdparty/sabre/vobject/lib/Parser/Json.php
/var/www/html/nextcloud/updater/../3rdparty/sabre/vobject/lib/Parser/XML/.
/var/www/html/nextcloud/updater/../3rdparty/sabre/vobject/lib/Parser/XML/Element/.

… I think I don’t need to post the whole list of files. The folders are owned by apache:apache (System is CentOS 7):

[root@htzsv001 nextcloud]# ll
total 116
drwxr-xr-x. 29 apache apache 4096 Apr 22 08:29 3rdparty
drwxr-xr-x. 41 apache apache 4096 Apr 22 08:27 apps
-rw-r–r--. 1 apache apache 8868 Apr 22 08:27 AUTHORS
drwxrwxr-x. 2 apache apache 49 May 16 09:09 config
-rw-r–r--. 1 apache apache 3638 Apr 22 08:27 console.php
drwxr-xr-x. 16 apache apache 4096 May 22 14:11 core
-rw-r–r--. 1 apache apache 5353 Apr 22 08:27 cron.php
-rw-r–r--. 1 apache apache 40622 Apr 22 08:27 db_structure.xml
-rw-r–r--. 1 apache apache 179 Apr 22 08:27 index.html
-rw-r–r--. 1 apache apache 2471 Apr 22 08:27 index.php
drwxr-xr-x. 3 apache apache 87 Apr 22 08:27 l10n
drwxr-xr-x. 6 apache apache 129 Apr 22 08:27 lib
-rw-r–r--. 1 apache apache 283 Apr 22 08:27 occ
drwxr-xr-x. 2 apache apache 93 Apr 22 08:27 ocs
drwxr-xr-x. 2 apache apache 23 Apr 22 08:27 ocs-provider
-rw-r–r--. 1 apache apache 3184 Apr 22 08:27 public.php
-rw-r–r--. 1 apache apache 5431 Apr 22 08:27 remote.php
drwxr-xr-x. 4 apache apache 51 Apr 22 08:27 resources
-rw-r–r--. 1 apache apache 26 Apr 22 08:27 robots.txt
drwxr-xr-x. 11 apache apache 4096 Apr 22 08:27 settings
-rw-r–r--. 1 apache apache 2110 Apr 22 08:27 status.php
drwxr-xr-x. 3 apache apache 47 Apr 22 08:27 themes
drwxr-xr-x. 2 apache apache 55 Apr 22 08:27 updater
-rw-r–r--. 1 apache apache 380 Apr 22 08:29 version.php

[root@htzsv001 nextcloud]# ls -la updater/
total 644
drwxr-xr-x. 2 apache apache 55 Apr 22 08:27 .
drwxr-xr-x. 14 apache apache 4096 Jul 31 08:52 …
-rw-r–r--. 1 apache apache 57353 Apr 22 08:27 index.php
-rw-r–r--. 1 apache apache 591718 Apr 22 08:27 updater.phar

Anyone has an idea what’s wrong? Is the upgrade done with a different user than apache (Though I couldn’t imagine how and why)?
Thanks a lot,
Nils

Anyone has an idea about this? Do I need to provide more information?

Is apache the user your webserver runns as? I don’t have a centos ready, but I think to remember that apache runns as httpd or daemon something like that?

Yes, httpd runs under user apache:
apache 2720 0.0 0.0 397648 11632 ? S Aug14 0:00 /usr/sbin/httpd -DFOREGROUND

Update: Out of frustration I have given Write permissions to all users in the Nextcloud folder:
chmod -R a+w nextcloud/
however I still get the same error. Will try to do a manual update now :confused:

Update: Command Line Upgrade via occ didn’t work as it said I already have the most recent version. Manually upgrading by replacing the folder and copying config.php worked without any issues.

On CentOS 7 usually SELinux is what causes frustration in the first place. So…
setsebool -P httpd_unified 1
should do the job. At least it did for me.
SELinux is still your friend though. :wink:

5 Likes

This is the one, thank you. :slight_smile:

Thank you so much! I had exactly the same problem wit the same OS (CentOS 7) and SELinux enabled.

Thnks!!! it worked for me

Thanks for the tip!
Disabling SELinux helped.