Thank you. I went ahead and removed both the assets and the .well-known directories and that stage now passes. But now it fails copying files to the updater directory (abridged error below). That directory is owned by root and is 0644 permissions.
Check for write permissions
The following places can not be written to:/var/www/nextcloud/updater/…/ocs-provider/.
/var/www/nextcloud/updater/…/ocs-provider/index.php
/var/www/nextcloud/updater/…/resources/config/ca-bundle.crt
/var/www/nextcloud/updater/…/resources/config/.
/var/www/nextcloud/updater/…/resources/config/mimetypealiases.dist.json
/var/www/nextcloud/updater/…/resources/config/mimetypemapping.dist.json
/var/www/nextcloud/updater/…/resources/.
/var/www/nextcloud/updater/…/resources/codesigning/.
/var/www/nextcloud/updater/…/resources/codesigning/owncloud.crt
/var/www/nextcloud/updater/…/resources/codesigning/root.crt
/var/www/nextcloud/updater/…/resources/codesigning/core.crt
/var/www/nextcloud/updater/…/robots.txt
/var/www/nextcloud/updater/…/db_structure.xml
/var/www/nextcloud/updater/…/l10n/rm-old.sh
/var/www/nextcloud/updater/…/l10n/.
/var/www/nextcloud/updater/…/l10n/l10n.pl
About the permissions: This is exactly the problem. Your http user needs to own the whole nextcloud directory to successfully do an upgrade. Have a look into the upgrade part of the admin manual, there you find scripts to change the folder permissions for upgrading and back to strict afterwards.
Thank you. I copied the script and made it executable. It runs but doesn’t return the screen prints I see in it.
I stepped through it line by line and can see that the updater folder is now owned by www-data user and group and is 750, but the update still says it can’t write to the location.
I confirmed that Apache is running as www-data
Check for write permissions
The following places can not be written to:
/var/www/nextcloud/updater/…/ocs-provider/.
/var/www/nextcloud/updater/…/ocs-provider/index.php
/var/www/nextcloud/updater/…/resources/config/ca-bundle.crt
/var/www/nextcloud/updater/…/resources/config/.
Sorry, stumbling through this for the first time. In case anyone else is as well, here is the correct command to set perms for upgrading on Ubuntu
chown -R www-data:www-data /var/www/nextcloud
I found that for this install, which seems small (no local data), but has external links to large directory structures, the web GUI told us to update from the command line. Commands:
cd /var/www/nextcloud
sudo -u www-data php occ upgrade
I got the upgrade done after running chown -R www-data:www-data
But when I run the script to lock things back down, users report this error at the login screen:
Cannot write into “apps” directory.
This can usually be fixed by giving the webserver access to the apps directory or disabling the appstore in the config file.
Rerunning the pre-upgrade command resolves this, but doesn’t seem like the recommended perms for a production system.
The script given in the second link should make the apps directory beside data, config and themes writeable while keeping the remaining secure. In case you need to adjust the directories at the top of the script. As I remember beside data, the apps directory can also be moved to another place. This seems the best solution for production systems for me, as app updates and several configurations stay possible, while the remaining folders stay secure. So just for nextcloud upgrade you need to change.
I followed the above instructions, but when the time to upgrade, it not upgradable.
Therefore, I had to give entire folder of NC permission as of www-data:www-data.
Yeah exactly, for whole nextcloud upgrade the whole folder needs to be owned by www-data:www-data, afterwards for production you should use strong permission according to the admin manual/script again.