Nextcloud 27 minor version upgrade fails (docker)

Nextcloud version : nextcloud:27.1.3-apache
Operating system and version: Ubuntu 22.04.3 LTS with Docker

The issue you are facing:

Trying to upgrade from 27.1.3 to 27.1.6 fails with error message:

Exception: Updates between multiple major versions and downgrades are unsupported.

Is this the first time you’ve seen this error? : Yes, at least for minor upgrades

Steps to replicate it:

  1. Roll back all files from backup
  2. Change image from nextcloud:27.1.3-apache to nextcloud:27.1.6-apache
  3. Redeploy stack

I can’t replicate with a fresh installation. Some files/data seems corrupt.

The output of your Nextcloud log in Admin > Logging:
Location inaccessible because of failed upgrade.

version.php:

<?php 
$OC_Version = array(27,1,3,2);
$OC_VersionString = '27.1.3';
$OC_Edition = '';
$OC_Channel = 'stable';
$OC_VersionCanBeUpgradedFrom = array (
  'nextcloud' => 
  array (
    '26.0' => true,
    '27.0' => true,
    '27.1' => true,
  ),
  'owncloud' => 
  array (
    '10.13' => true,
  ),
);
$OC_Build = '2023-11-23T17:54:42+00:00 2668bd0cd54784b8464b15b23ea7b7336ee1bdc3';
$vendor = 'nextcloud';

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

<?php
$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,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'nextcloud3redisx',
    'password' => REDACTED,
    'port' => 6379,
  ),
  'trusted_proxies' => 
  array (
    0 => 'REDACTED,
  ),
  'instanceid' => REDACTED,
  'passwordsalt' => REDACTED,
  'secret' => REDACTED,
  'trusted_domains' => 
  array (
    0 => REDACTED,
    1 => REDACTED
  ),
  'datadirectory' => '/mnt',
  'default_locale' => 'de_DE',
  'default_phone_region' => 'DE',
  'allow_user_to_change_display_name' => false,
  'dbtype' => 'pgsql',
  'version' => '27.1.3.2',
  'overwriteprotocol' => 'https',
  'overwrite.cli.url' => REDACTED,
  'skeletondirectory' => '',
  'dbname' => 'nextcloud3',
  'dbhost' => 'nextcloud3dbx',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => REDACTED,
  'dbpassword' => REDACTED,
  'installed' => true,
  'simpleSignUpLink.shown' => false,
  'oidc_login_client_id' => REDACTED,
  'oidc_login_client_secret' => REDACTED,
  'oidc_login_provider_url' => REDACTED,
  array (
  ...
  ),
  'app_install_overwrite' => 
  array (
    0 => 'oidc_login',
  ),
  'maintenance' => true,
  'sharing.maxAutocompleteResults' => 1,
  'sharing.minSearchStringLength' => 4,
  'session_lifetime' => 259200,
  'loglevel' => 0,
  'theme' => '',
);


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

Configuring Redis as session handler

Initializing nextcloud 27.1.5.1 ...

Upgrading nextcloud from 27.1.3.2 ...

=> 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

Configuring Redis as session handle

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.

{"reqId":"-","level":3,"time":"2024-02-15T18:06:59+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Updates between multiple major versions and downgrades are unsupported.","userAgent":"--","version":"27.1.3.2","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":139,"function":"doUpgrade","class":"OC\\Updater","type":"->","args":["27.1.6.2","27.1.3.2"]},{"file":"/var/www/html/core/Command/Upgrade.php","line":225,"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":211,"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":100,"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":240,"message":"Updates between multiple major versions and downgrades are unsupported.","exception":{},"CustomMessage":"Updates between multiple major versions and downgrades are unsupported."}}
{"reqId":"-","level":3,"time":"2024-02-15T18:06:59+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::failure: Exception: Updates between multiple major versions and downgrades are unsupported.","userAgent":"--","version":"27.1.3.2","data":{"app":"updater"}}
{"reqId":"-","level":3,"time":"2024-02-15T18:06:59+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update failed","userAgent":"--","version":"27.1.3.2","data":{"app":"updater"}}

Thanks for helping!

I forgot to mention: I already tried a backup and restore in the follow way:

  • save config.php
  • save database dump
  • stop stack
  • delete everything in
    • nextcloud data folder (not the ‘datadirectory’ that contains user data)
    • nextcloud db folder
  • redeploy stack
  • overwrite config.php
  • drop database
  • import backup database

The cloud works fine but an upgrade will fail with the same error as before.
From my understanding nextcloud checks the version.php to see if an upgrade is possible.
How can this check fail in this scenario?
Is there any other way to get this error message if the version comparisons succeeds?

Can you post your actual Compose file?

Also anything else you’re doing like building via Dockerfile?

1 Like

I am not building any images myself.
This is the compose file after the failed update:

version: '3'
services:
  nextcloud3dbx:
    image: postgres:16.0-alpine3.17
    container_name: nextcloud3dbx
    volumes:
      - /REDACTED1:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=nextcloud3
      - POSTGRES_USER=REDACTED
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    
    restart: unless-stopped
    networks:
      - nextcloud3x_network
      
  nextcloud3redisx:
    image: redis:alpine
    container_name: nextcloud3redisx
    volumes:
      - /REDACTED2:/data
      - /REDACTED3:/usr/local/etc/redis
    environment:
      - REDIS_REPLICATION_MODE=master
    command: redis-server --requirepass ${REDIS_PASSWORD}
    restart: unless-stopped
    networks:
      - nextcloud3x_network
      
  nextcloud3appx:
    image: nextcloud:27.1.6-apache
    ports:
      - "0.0.0.0:8555:80"
    networks:
      - nextcloud3x_network
    container_name: nextcloud3appx
    environment:
      - NC_TRUSTED_DOMAINS=REDACTED
      - TRUSTED_PROXIES=REDACTED
      - POSTGRES_HOST=nextcloud3dbx
      - POSTGRES_DB=nextcloud3
      - PHP_UPLOAD_LIMIT=5G
      - POSTGRES_USER=REDACTED
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - REDIS_HOST=nextcloud3redisx
      - REDIS_HOST_PASSWORD=${REDIS_PASSWORD}
    depends_on:
      - nextcloud3dbx
      - nextcloud3redisx
    volumes:
      - /REDACTED4:/var/www/html
      - /REDACTED5:/mnt

    restart: unless-stopped
    
  nextcloud3cronx:
    container_name: nextcloud3cronx
    networks:
      - nextcloud3x_network
    restart: unless-stopped
    image: rcdailey/nextcloud-cronjob@sha256:f6e765f1b46dc692205f1ccb8d19f06d53561c75778d62b1c5bc4ef079b2861f
    depends_on:
      - nextcloud3appx
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock:ro
    - /etc/localtime:/etc/localtime:ro
    environment:
      - NEXTCLOUD_CONTAINER_NAME=nextcloud3appx
      - NEXTCLOUD_EXEC_SHELL=sh
      - NEXTCLOUD_CRON_MINUTE_INTERVAL=3

networks:
  nextcloud3x_network:

Before upgrading the only difference is the image: nextcloud:27.1.3-apache