Docker upgrade to 23.0.0 fails

Nextcloud version (eg, 20.0.5): 21.0.3.1
Operating system and version (eg, Ubuntu 20.04): Official Docker image
Apache or nginx version (eg, Apache 2.4.25): nginx/1.14.2
PHP version (eg, 7.4): PHP 7.3.31-1

The issue you are facing:
Tried to upgrade to 23.0.0 by stopping and recreating the container, pulled the latest image and I’m not now stuck at the upgrade page. The page lists several applications which would be deactivated.

There are two issues:

  1. If I launch the upgrade (from the GUI), I get an error message “Exception: Updates between multiple major versions and downgrades are unsupported.”, which I understand. How can I then upgrade to v22.x.X first? I’ve found the 22.2.3 image on Docker Hub: could this be as simple as forcing this image in recreating the container?
  2. There still isn’t any Cancel button, despite numerous requests from users, so I just can’t cancel upgrade and stick to the current version.

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

Steps to replicate it:

  1. In Portainer, select the nextcloud_app_1 container.
  2. Stop the container
  3. Recreate the container, and pull the latest image

The output of your Nextcloud log in Admin > Logging:

Cannot connect...

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

::::::::::::::
config/config.php
::::::::::::::
<?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,
    ),
  ),
  'instanceid' => 'oc7ahdu6c6ph',
  'passwordsalt' => 'salt',
  'secret' => 'secret',
  'trusted_domains' => 
  array (
    0 => '192.168.1.19',
    1 => 'nc.mydomain.com',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '21.0.3.1',
  'overwrite.cli.url' => 'http://192.168.1.19:8080',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ndbuser',
  'dbpassword' => 'dbpassword',
  'installed' => true,
  'default_phone_region' => 'fr_FR',
  'mail_from_address' => 'ncadmin',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'mydomain.com',
  'mail_smtphost' => 'host',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'ncadmin@mydomain.com',
  'mail_smtppassword' => 'smtppassword',
  'mail_smtpsecure' => 'ssl',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.secret' => 'secret',
);

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

Error log is empty

Thanks in advance for any help!

just use the right image for your container. something with 22 in the name.

but use the same version you use now. (alpine, apache, fpm)

well. it might be too late. when you start the container and a higher version in the image is detected the update starts. this happens here.

Hi Reiner and thanks for the tip!

I don’t really know which version is installed currently as the compose file only display image: nextcloud. How can I determine which image is used? Could I just use image: nextcloud:22.2.3?

Looking forward to reading your advice.

that should be latest right now by default.

that (or image: nextcloud:22) would be the way to go.

make a backup before you try. :wink:

Hi Reiner,

I’ll try to apply the tag “:22” as advised, but what should I backup first (data are persistent)? config.php only?

By the way, is there any way to cancel the upgrade? As already written, the upgrade process is flawed as it should check the current version against the new one prior to triggering the upgrade! Here, I’m in v21, so the upgrade function should prevent me from upgrading to v23! Now that the process is launched, is there any file I could tweak to cancel it? Then I could safely upgrade to v22, then v23…

Hi all and Happy New Year!

Issues from the previous year are still there :wink:, so I still need some help: updating the Portainer stack with “nextcloud:22” just led to a “504 Bad gateway” error when trying to log on Nextcloud. I suspect the v22 image requires different parameters…

Then back to image: nextcloud only, which obviously falls back on upgrading from v21 to v23: forbidden.

2 questions:

  1. Is there any way to “kill” the whole Nextcloud container without losing all related data and apps? I’m not a Docker expert but I think I could just stop/kill container, delete stack and recreate it with the same volumes (obviously pointing to the same database).
  2. Is there any way to cancel an upgrade? There MUST be a config.php, upgrade.php or whatever file to delete or modify, I can’t believe there is no way to do so!

Thanks in advance for any help!

Hi @Reiner_Nippes,

Sorry, I wasn’t working on my Nextcloud instance until yesterday…

I’ve finally managed to reinstall the whole stuff by stopping the stack, deactivating and removing all containers, deleting all related folders to remove any config file which could survive and recreating the stack with the nextcloud:latest image. I just had to create all users again (4 accounts, this was pretty quickly done :wink:) and I’ll now have to push all files again to the cloud.

Thanks again for your help, I now have an update procedure that will prevent starting from scratch again and again! :wink: