[Solved] Upgrade fails for Nextcloud (22.x --> 23 --> 24 --> 25)

Hi all,

I’m trying and failing to upgrade Nextcloud 22.x to 25.x.

On closer inspection of my second attempt, it seems the upgrade to 23 is OK, but on the way from 23 to 24 it goes wrong.

My YunoHost server

Hardware: Old laptop or computer at home
YunoHost version:
Server hardware architecture is lxc amd64
Server is running Linux kernel 5.11.22-5-pve
Server is running Debian 11.6
Server is running YunoHost 11.0.10.2 (stable)

I have access to my server : Through SSH / through the webadmin / direct access via keyboard / screen
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : In some cases, LXC might give unexpected results. That is not an issue here, I think.


Today I was happy to migrate to YNH 11 with hardly any trouble (borgbackup and netdata were in the way, got uninstalled, will reinstall).

After the migration, I finally was able to upgrade most of the apps that got stuck while on YNH 4.x. Many had no problem, two did: Matrix/Synapse and Nextcloud.

The upgrade of Nextcloud fails gracefully: the upgrade gets rolled back, the backup restored and everything works, which is nice. Only not upgraded.


I had two attempts so far. The logs of the first and second attempt seem to point at different causes.

After the first attempt I installed php 8.2 and update-alternatives --config php to PHP 8.1 (that is the version suggested by Nextcloud for v 25).

The first attempt fails at

2023-01-05 18:07:18,038: DEBUG - An unhandled exception has been thrown:
2023-01-05 18:07:18,039: DEBUG - RedisException: Connection refused in /var/www/nextcloud/lib/private/RedisFactory.php:132

The second attempt (after the PHP changes) does not mention the RedisException, so a step forward I think. It does complain about read-only config:

2023-01-05 23:07:39,748: WARNING - In Config.php line 298:
2023-01-05 23:07:39,748: DEBUG - 
2023-01-05 23:07:39,748: WARNING -   Config is set to be read-only via option "config_is_read_only".
2023-01-05 23:07:39,748: DEBUG - 
2023-01-05 23:07:39,748: DEBUG - 
2023-01-05 23:07:39,749: WARNING - maintenance:mode [--on] [--off]
2023-01-05 23:07:39,749: DEBUG - 
2023-01-05 23:07:39,770: DEBUG - + ynh_exit_properly
2023-01-05 23:07:40,275: DEBUG - + ynh_clean_setup
2023-01-05 23:07:40,275: DEBUG - + ynh_restore_upgradebackup
2023-01-05 23:07:40,276: DEBUG - + ynh_print_err '--message=Upgrade failed.'
2023-01-05 23:07:40,291: DEBUG - + ynh_print_log '[Error] Upgrade failed.

There are warnings about to-be-upgraded plugins, but in previous upgrades they just would get disabled. I don’t think those are a problem.

Tomorrow I’ll try setting the config to read/write.

Any other suggestions in the meantime?

Wohoo! That was it :smiley:

This is how that section of the config now looks like (it was true before):

# cat  /var/www/nextcloud/config/config.php |grep only
  'config_is_read_only' => false,

Not only did the upgrade run successfully, it also ran much faster! Instead of close to an hour, it took just 15 minutes.

To conclude, here’s the log.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.