[Nextcloud 29.0.0] Exception: Updates between multiple major versions and downgrades are unsupported

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com 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:

example

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

longer
example
here

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): 29.0.0.19
Operating system and version (eg, Ubuntu 20.04): Docker on Ubuntu 23.10
Apache or nginx version (eg, Apache 2.4.25): nginx/1.18.0 (Ubuntu)
PHP version (eg, 7.4): docker

The issue you are facing:

I’m using Docker and had nextcloud 28.0.1.1 installed and I wanted to upgrade to the latest version so I grabbed the latest image (29.0.0.19) and ran that. Nextcloud is now stuck in maintenance mode and the logs say “Exception: Updates between multiple major versions and downgrades are unsupported.”

I’m only updating to the next major version. What am I supposed to do?

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

  1. Grab latest docker image
  2. Stop the docker instance and remove it
  3. docker-compose up

The output of your Nextcloud log in Admin > Logging:

Initializing nextcloud 29.0.0.19 ...
Upgrading nextcloud from 28.0.1.1 ...
=> Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/pre-upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Turned on maintenance mode
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Resetting log level
=> Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/before-starting
[30-Apr-2024 09:44:55] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[30-Apr-2024 09:44:55] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[30-Apr-2024 09:44:55] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[30-Apr-2024 09:44:55] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[30-Apr-2024 09:44:55] NOTICE: fpm is running, pid 1
[30-Apr-2024 09:44:55] NOTICE: ready to handle connections

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

Using docker

The output of your Apache/nginx/system log in /var/log/____:

Using docker

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

No errors

Please post:

  • your Docker compose
  • The contents of /var/www/html/version.php from in your container
  • the output of occ config:list system

docker-compose.yaml:

version: '3.8'

networks:
    nextcloud:
        external: false

services:
    nextcloud:
        image: nextcloud:fpm
        # must match `www-data:www-data` on the host
        # see: `grep www-data /etc/passwd`
        user: '33:33'
        environment:
          # path inside container: `/var/www/html/data`
          # created on the host: `/opt/nextcloud/data`
          - SQLITE_DATABASE=nc.sqlite3
          - NEXTCLOUD_TRUSTED_DOMAINS=redacted
        ports:
          - 1337:9000
        volumes:
          - /home/nextuser:/var/www/html
          - /home/nextuser/data:/var/www/html/data
          - /home/nextuser/config:/var/www/html/config
        restart: unless-stopped
        networks:
          - nextcloud

version.php

www-data@ae77561f75d9:~/html$ cat  /var/www/html/version.php 
<?php 
$OC_Version = array(29,0,0,19);
$OC_VersionString = '29.0.0';
$OC_Edition = '';
$OC_Channel = 'stable';
$OC_VersionCanBeUpgradedFrom = array (
  'nextcloud' => 
  array (
    '28.0' => true,
    '29.0' => true,
  ),
  'owncloud' => 
  array (
    '10.13' => true,
  ),
);
$OC_Build = '2024-04-23T15:11:45+00:00 744e0ddb1e9117a1d912ff29dfdac62d1e1dc72e';
$vendor = 'nextcloud';

occ config:list system

www-data@ae77561f75d9:/$ /var/www/html/occ config:list system
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
{
    "system": {
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "redacted"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "sqlite3",
        "version": "28.0.1.1",
        "overwrite.cli.url": "redacted",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": true,
        "loglevel": 2,
        "theme": ""
    }
}

Can I bump this?

The only thing I see unusual so far is the above. This is a little weird, since the 2nd and 3rd lines are basically mounting over themselves, since they’re already included with the mount defined in the 1st line. I suspect you got the idea to do this from a named volume config example where it might make sense. It doesn’t make sense to do with bind mounts. Though in most cases I think it’ll be alright.

Is the underlying system just straight Ubuntu on bare metal or a VM? No Docker Desktop or anything like that involved, correct?

Anything weird about the history of this installation? Has it been upgraded at all before?

I’d say try upgrading just from 28.0.1->28.0.2 or something, but the spot you’re in now is that the Docker image updated the code in the /var/www/html already and now it’s just the db migrations that are trying to run. And it still wouldn’t help identify the underlying root cause for why you’re running into this situation.

Oh, to double-check, what’s the output of occ config:list core?

EDIT: In your nextcloud.log there should be a line that says “starting upgrade from” that was written during the upgrade attempt. Can you share what it says?

Not sure why I did that but it seems to work. I’ve changed it anyway.

Correct. Just a raspberry pi (4 I think.) and ubuntu server.

It’s been upgraded several times (at least from version 24). I had an issue once in the past but I don’t remember what it was and I’ve upgraded a few times since then.

Yeah I’m worried about going back. I was hoping to get some answers here before I try that.

www-data@e166383e7558:~/html$ ./occ config:list core
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
{
    "apps": {
        "core": {
            "installedat": "1665584093.4879",
            "lastupdatedat": "0",
            "vendor": "nextcloud",
            "public_files": "files_sharing\/public.php",
            "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
            "installed.bundles": "[\"CoreBundle\"]",
            "theming.variables": "b92d206521717ac032f8aa58d3c7ff2f",
            "lastcron": "1711466984",
            "lastupdateResult": "[]",
            "moveavatarsdone": "yes",
            "previewsCleanedUp": "1",
            "files_metadata": "{\"photos-original_date_time\":{\"value\":null,\"type\":\"int\",\"indexed\":true,\"editPermission\":0},\"photos-exif\":{\"value\":null,\"type\":\"array\",\"indexed\":false,\"editPermission\":0},\"photos-ifd0\":{\"value\":null,\"type\":\"array\",\"indexed\":false,\"editPermission\":0},\"photos-size\":{\"value\":null,\"type\":\"array\",\"indexed\":false,\"editPermission\":0}}",
            "files_metadata_installed": "1",
            "oc.integritycheck.checker": "[]"
        }
    }
}
{"reqId":"yeNBLZlxcJy2JVhIoQzV","level":0,"time":"2024-04-30T09:44:51+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"starting upgrade from 28.0.1.1 to 29.0.0.19","userAgent":"--","version":"28.0.1.1","data":{"app":"core"}}
{"reqId":"yeNBLZlxcJy2JVhIoQzV","level":3,"time":"2024-04-30T09:44:51+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Updates between multiple major versions and downgrades are unsupported.","userAgent":"--","version":"28.0.1.1","exception":{"Exception":"Exception","Message":"Updates between multiple major versions and downgrades are unsupported.","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Updater.php","line":129,"function":"doUpgrade","class":"OC\\Updater","type":"->","args":["29.0.0.19","28.0.1.1"]},{"file":"/var/www/html/core/Command/Upgrade.php","line":216,"function":"upgrade","class":"OC\\Updater","type":"->","args":[]},{"file":"/var/www/html/3rdparty/symfony/console/Command/Command.php","line":298,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->","args":[["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/3rdparty/symfony/console/Application.php","line":1040,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->","args":[["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/3rdparty/symfony/console/Application.php","line":301,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->","args":[["OC\\Core\\Command\\Upgrade"],["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/3rdparty/symfony/console/Application.php","line":171,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->","args":[["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/lib/private/Console/Application.php","line":213,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->","args":[["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/console.php","line":113,"function":"run","class":"OC\\Console\\Application","type":"->","args":[]},{"file":"/var/www/html/occ","line":11,"args":["/var/www/html/console.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Updater.php","Line":230,"message":"Updates between multiple major versions and downgrades are unsupported.","exception":{},"CustomMessage":"Updates between multiple major versions and downgrades are unsupported."}}
{"reqId":"yeNBLZlxcJy2JVhIoQzV","level":3,"time":"2024-04-30T09:44:51+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::failure: Exception: Updates between multiple major versions and downgrades are unsupported.","userAgent":"--","version":"28.0.1.1","data":{"app":"updater"}}
{"reqId":"yeNBLZlxcJy2JVhIoQzV","level":3,"time":"2024-04-30T09:44:51+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update failed","userAgent":"--","version":"28.0.1.1","data":{"app":"updater"}}
{"reqId":"yeNBLZlxcJy2JVhIoQzV","level":1,"time":"2024-04-30T09:44:51+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"--","version":"28.0.1.1","data":{"app":"updater"}}
{"reqId":"yeNBLZlxcJy2JVhIoQzV","level":1,"time":"2024-04-30T09:44:51+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Warning(2)","userAgent":"--","version":"28.0.1.1","data":{"app":"updater"}}

Inspired by this topic I changed lib/private/Updater.php like this

                #$currentVendor = $this->config->getAppValue('core', 'vendor', '');
                $currentVendor = $this->getVendor();

then ran ./occ upgrade and that did the trick.

I just hope it doesn’t come back to haunt me later.

2 Likes