Nextcloud 25 upgrade issue (supposedly unsupported upgrade path)

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): According to occ status: version: versionstring: 25.0.1
Operating system and version (eg, Ubuntu 20.04): docker container tag 25.0.1
Apache or nginx version (eg, Apache 2.4.25): the one which ships in the container
PHP version (eg, 7.4): 8.1.12

The issue you are facing:

I ran an upgrade through the web interface (I am not sure which version I was using before, but it should have been v24). Then the web interface was stuck in maintenance mode. I checked the logs and found the same error message in this post:

As I had the same error in my log, I disabled spreed as well.
I then saw the update notes in the web interface.
But when I attempt to upgrade (also through occ upgrade), I get the error message:
“Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed”

I tried downgrading the container to v24, but then I get the message that the db and data are on a higher version (v25.0.1.1).

So I don’t know what to do anymore. I can’t downgrade and I can’t upgrade.

I’m grateful for any hints.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Get the last docker image of v24 and install it
  2. Do an upgrade in the web interface
  3. Should be stuck in maintenance mode
  4. upgrade container to latest (I did this 2 days after I triggered the upgrade).
  5. disable spreed
  6. now you can’t upgrade or downgrade

The output of your Nextcloud log in Admin > Logging:


The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
  'overwriteprotocol' => 'https',
  'trusted_proxies' => 
  array (
    0 => '',
  'passwordsalt' => 'removed',
  'secret' => 'removed',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'removed',
    2 => 'removed',
    3 => 'server',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'https://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => '',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud.admin',
  'dbpassword' => 'removed',
  'installed' => true,
  'instanceid' => 'ocxft5ghouo7',
  'maintenance' => true,
  'loglevel' => 2,
  'theme' => '',

In the other logs there is nothing interesting. I unfortunately didn’t save them persistently, so the logs from the attempted upgrade are gone since I recreated the container :frowning:

Is this the official Docker image? If so, you aren’t supposed to upgrade it from the web updater. You just update the image, and it runs the upgrade automatically.

Just to clarify, it should not be stuck in maintenance mode… If it doesn’t come out of maintenance mode automatically after a while (give it some time to work on the db upgrade after starting), you should bring it out of maintenance mode manually.

It’s important to verify that the previous upgrade has fully finished and any warnings such as adding db indices have been settled before starting another upgrade.

I suspect that’s exactly the case because your config file says:

I’m not sure what steps to take from that point since it sounds like the db has been upgraded to v25. It would probably be the safest action long term to restore from your v23 backup and redo the upgrade to v24.

You could possibly try changing the version number in the config to whatever v24 you tried to upgrade to… but your instance may not be fully that version, and so that could make it unstable too.

The web updater really should prevent both “user errors”:

  1. upgrading from 23 to 25
  2. upgrading an image through webupdater*

* Is it possible to detect that you’re in a container from within?

Hi @KarlF12 and @nursoda

yes, it’s the official docker image.

thank you for your input.
I realized that even though the docker image has been upgraded, I still had an environment variable set to v23 (the version which was current when I created the container the first time). Maybe I could have tried to change that.

However, seems quite hopeless.
My data directroy is in another persistent volume, so I decided to just delete the database, make a fresh install of Nextcloud and then bind my data volumne under /var/www/html/data again and then run occ files:scan --all which should recreate the database index for my files.
I don’t really care about the settings.
Still, it’s a weird issue.

Sorry, I don’t really follow your question. From within what?

I’m a container noob, so I assumed that it might be an issue for the webupdater script to be able to detect whether it should abort due to the fact that the admin/user tried to webupdate where she/he rather should update the container itself.

@nursoda Yeah I was assuming that I can do an update if the possibility is there within the web interface.
Btw. I just made a fresh container. So for me everything works again.

Assumptions can get you in trouble. For reference, here is the upgrade process for the official Docker images.