Nextcloud update failure and CL update

Nextcloud update failure and CL update

Trying to update our Nextcloud instance failed with backup failure.

This is just a note for our own future reference.

Obviously there must be disk full problem or, permission issue.

Web updater does not give us detailed information, so we needed command line interface, which we forgot already how… So:

https://www.linuxbabe.com/cloud-storage/upgrade-nextcloud-command-line-gui

$ cd /var/www/nextcloud
$ sudo -u www-data php7.4 updater/updater.phar 
Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4

Current version is 23.0.7.

Update to Nextcloud 23.0.9 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-23.0.9.zip
Open changelog ↗

Steps that will be executed:
[ ] Check for expected files
[ ] Check for write permissions
[ ] Create backup
[ ] Downloading
[ ] Verify integrity
[ ] Extracting
[ ] Enable maintenance mode
[ ] Replace entry points
[ ] Delete old files
[ ] Move new files in place
[ ] Done

Start update? [y/N] y

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

[✔] Check for expected files
[✔] Check for write permissions
[ ] Create backup ...PHP Warning:  copy(/var/www/nextcloud/config/config.php.20220831): failed to open stream: Permission denied in phar:///var/www/nextcloud/updater/updater.phar/lib/Updater.php on line 395
[✘] Create backup failed
Could not copy "/var/www/nextcloud/config/config.php.20220831" to (...)

Update failed. To resume or retry just execute the updater again.

So, we copied config file with different user than apache user, that caused the updater an error.

Changed owner and re-ran the Web updater with no errors any more.