Update 19 - 20 - 21 issues on Synology NAS

I run several instances of Nextcloud on a Synology NAS/DSM6/Apache2.4/PHP7.4. The web user on the Synology is http

A couple of days ago I used the web updater to update one instance from Nextcloud 19 to Nextcloud 20. The update failed right at the end with an Internal Server Error report, the issue turned out to be that permissions for nextcloud/config/config.php had turned to Read only for http and read/write for myusername, and the owner of /config was changed to myusername rather than http. When I reset the permissions, all was well.

So yesterday I used the web updater to update the same instance to Nextcloud 21. This failed multiple times at different stages, nearly every time it was due to the same permissions change as noted above, and after manually giving http suitable permissions I was able to move slowly through the process. There was one other issue, an “no APCu” error fixed by removing the APCu line from config.php

To summarise, it appears that the web updater keeps resetting the owner of /config to myusername and the http permissions for config.php to read only.

I would welcome any thoughts - is this an issue with the web updater, or is there something I can do to fix it? It took so long to complete that I am now rather scared of updating my other four instances.

I would use a folder that belongs only to the web user, and also run the updater (even from command line) with the web user’s permissions. Then it shouldn’t change the permissions to any other user.
It looks a bit strange, do you run the upgrade with your user? Does it change the owner of a file or just the permissions for the owner, group and others (chown vs. chmod)? The permissions (chmod) for owner, group and others can be through the nextcloud procedures, the owner itself, looks strange to me. In this case it could be some other “clean up” perhaps form synology??

It is very strange. The entire nextcloud directory structure is owned by http.

To answer your questions:

  1. Do I run the upgrade with my user? I’ve been running the updater from my nextcloud admin account via the web updater. But in order to complete the 20-21 update I had (after changing the permissions) to use -u http with the command line updater. The 19-20 upgrade, however, successfully continued to completion (after the permissions intervention) from the web updated.

  2. As noted above, the owner of config.php is changed to myusername and myusername gets full permissions (chown).

i have switched php from 7.4 which is my default, t0 7.2 and 7.3, I have also switched the apache version from 2.2 to 2.4. Makes no difference.

I conclude that it is the Synology, though the permissions aren’t changed other than during the update.

Do you have systemtools like ps to check who is running the php process?