How to upgrade my Nextcloud 24 instance to 25?

Is it possible to update my nextcloud 24 instance to 25? I have mine installed from zip (started with version 23 and updated to 24) running on Ubuntu 20.04 LTS. When I run the updater in the web UI it runs through the steps, then give the button to exit maintenence mode and continue, but it comes up to a white blank screen from there on. I have rebooted the instance (it runs in an lxd container), but it never comes back so I revert the snapshot.

I have tried installed the snap in another fresh 22.04 container, but there is so much integration I have with onlyoffice, and could not get that or the Zimbra integration to work in version 26 from the snap.

So back to my original plan, just update the 24 NC instance. Has anyone else run into this? Will keep digging for clues and what logs to gather, but it has always been pretty straightforward to update my instance. If it matters I am running 7.3.3 of onlyoffice, and Zimbra 9.0 patch 41. Thank you!

In my experience web interface updates most commonly tend to fail due to PHP time out’s. If you can use php occ upgrade on the cli you’ll find you tend to have fewer issues. Additionally you need to check your nextcloud.log file located in your data dir after a failed update to determine what’s actually gone wrong, it could be something as simple as a directory having the wrong permissions all the way to a failed database migration.

Ok, thanks for the tip on the updater.

I tried

php occ upgrade

but it didn’t like that.

So for grins I ran through the updater process again just to shake out the logs and see if there were any clues. When I initially tried it gave off an error about /config.bak - went in and saw root was the owner, changed it to www-data and I was off and running. Failed again. Same issue.

Here is what is in the netcloud.log file:

{"reqId":"kiBkSgCwogXXwPFCXZEE","level":3,"time":"2023-07-28T17:19:06+00:00","remoteAddr":"x.x.x.x","user":"--","app":"PHP","method":"GET","url":"/","message":"Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) at /var/www/","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36 Edg/114.0.1823.79","version":"","data":{"app":"PHP"}}

and if it’s any help, here is the updater.log with any PII removed:

2023-07-28T17:18:31+0000 V1AHpjhLAu [info] getUpdateServerResponse response: Array
    [version] =>
    [versionstring] => Nextcloud 25.0.9
    [url] =>
    [web] =>
    [changes] =>
    [autoupdater] => 1
    [eol] => 0

2023-07-28T17:18:31+0000 V1AHpjhLAu [info] storage location: /var/www/
2023-07-28T17:18:31+0000 V1AHpjhLAu [info] end of verifyIntegrity()
2023-07-28T17:18:31+0000 V1AHpjhLAu [info] endStep("5")
2023-07-28T17:18:31+0000 b2Hjpu5ij1 [info] request to updater
2023-07-28T17:18:31+0000 b2Hjpu5ij1 [info] currentStep()
2023-07-28T17:18:31+0000 b2Hjpu5ij1 [info] Step 5 is in state "end".
2023-07-28T17:18:31+0000 b2Hjpu5ij1 [info] POST request for step "6"
2023-07-28T17:18:31+0000 b2Hjpu5ij1 [info] startStep("6")
2023-07-28T17:18:31+0000 b2Hjpu5ij1 [info] extractDownload()
2023-07-28T17:18:31+0000 b2Hjpu5ij1 [info] storage location: /var/www/
2023-07-28T17:18:40+0000 b2Hjpu5ij1 [info] end of extractDownload()
2023-07-28T17:18:40+0000 b2Hjpu5ij1 [info] endStep("6")
2023-07-28T17:18:40+0000 x2UBPPjlgJ [info] request to updater
2023-07-28T17:18:40+0000 x2UBPPjlgJ [info] currentStep()
2023-07-28T17:18:40+0000 x2UBPPjlgJ [info] Step 6 is in state "end".
2023-07-28T17:18:40+0000 x2UBPPjlgJ [info] POST request for step "7"
2023-07-28T17:18:40+0000 x2UBPPjlgJ [info] startStep("7")
2023-07-28T17:18:40+0000 x2UBPPjlgJ [info] setMaintenanceMode("true")
2023-07-28T17:18:40+0000 x2UBPPjlgJ [info] configFileName /var/www/
2023-07-28T17:18:40+0000 x2UBPPjlgJ [info] end of setMaintenanceMode()
2023-07-28T17:18:40+0000 x2UBPPjlgJ [info] endStep("7")
2023-07-28T17:18:40+0000 9ZjrbkqIKc [info] request to updater
2023-07-28T17:18:40+0000 9ZjrbkqIKc [info] currentStep()
2023-07-28T17:18:40+0000 9ZjrbkqIKc [info] Step 7 is in state "end".
2023-07-28T17:18:40+0000 9ZjrbkqIKc [info] POST request for step "8"
2023-07-28T17:18:40+0000 9ZjrbkqIKc [info] startStep("8")

Another clue, tried running sudo php /var/www/ upgrade
and get:

An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

Not sure if I could just bring the v25 archive in and unzip it to my directory or if that is even an option. php is still at 7.4. I have tried searching for a straightforward path to update.

Anyway, will revert back again.
As always, open to ideas.

So to follow up, wound up needing to add

apc.enable_cli = 1

To the etc/php/8.1/cli/php.ini file to get occ commands working without errors. Somehow over the years the config fell into shall I say less than ideal settings. There were a ton of updater- backups taking up space as well.

I also followed this: Using the occ command — Nextcloud latest Administration Manual latest documentation

So I ended up doing rsync to back up the /data directory, and dumped the mysql db. and in a roundabout way ended up migrating everything to a new instance running in a Ubuntu 22.04 container, just because I could tell I had a lot of old settings in config,php that needed freshening, like the datadirectory and the trusted domains were still set to the old domain and address. Redis server settings were way off, so set that up from scratch. Kinda amazing it worked at all! Once I copied everyone’s files over in /data, I then ran

sudo -u www-data php /var/www/html/nextcloud/occ files:scan --all

This allowed me to walk the learning curve on the new instance so I didn’t need to take the production nc offline for very long.

Now everything runs great on with php8.1, and I have everyones files, photos, cookbooks and apps working great so far. So I feel better just going over everything fresh.

In the future I will try to avoid the updater utility in the UI, and stick to occ commands, putting it in maintanence mode and running the upgrade from cli and re-checking all the config files. I read a few other horror stories here about relying on the updater, so lesson learned. I had pretty good luck with it until this upgrade, but I think the install was dicey from the start perhaps where I had missed a few tweaks that showed up later- and ran into the PHP timeout issue anyway.

1 Like