Unable to upgrade to version 29 from 28.0.11

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 28.0.11
Operating system and version FreeBSD 13.3
Apache 24-2.4.62
PHP version 8.1.29_1

The issue you are facing:


Nextcloud
Update to 29.0.0
Exception: Updates between multiple major versions and downgrades are unsupported.

Detailed logs 
Preparing update

Set log level to debug

Turned on maintenance mode

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

The update was unsuccessful. For more information check our forum post covering this issue.

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

Steps to replicate it:

  1. Download next version from Index of /server/releases
  2. Copy into web directory, check permissions and migrate data and config file
  3. Run upgrade from web browser or command line

The output of your Nextcloud log in Admin > Logging:

{"reqId":"SzDTf3sVKv8GwvnIN8UQ","level":1,"time":"2024-11-08T22:19:02+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::setDebugLogLevel: Set log level to debug","userAgent":"--","version":"28.0.11.1","data":{"app":"updater"}}
{"reqId":"SzDTf3sVKv8GwvnIN8UQ","level":1,"time":"2024-11-08T22:19:02+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceEnabled: Turned on maintenance mode","userAgent":"--","version":"28.0.11.1","data":{"app":"updater"}}
{"reqId":"SzDTf3sVKv8GwvnIN8UQ","level":0,"time":"2024-11-08T22:19:02+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"starting upgrade from 28.0.11.1 to 29.0.0.19","userAgent":"--","version":"28.0.11.1","data":{"app":"core"}}
{"reqId":"SzDTf3sVKv8GwvnIN8UQ","level":3,"time":"2024-11-08T22:19:02+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.11.1","exception":{"Exception":"Exception","Message":"Updates between multiple major versions and downgrades are unsupported.","Code":0,"Trace":[{"file":"/usr/local/www/nextcloud-29-0-0/lib/private/Updater.php","line":129,"function":"doUpgrade","class":"OC\\Updater","type":"->","args":["29.0.0.19","28.0.11.1"]},{"file":"/usr/local/www/nextcloud-29-0-0/core/Command/Upgrade.php","line":216,"function":"upgrade","class":"OC\\Updater","type":"->","args":[]},{"file":"/usr/local/www/nextcloud-29-0-0/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":"/usr/local/www/nextcloud-29-0-0/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":"/usr/local/www/nextcloud-29-0-0/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":"/usr/local/www/nextcloud-29-0-0/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":"/usr/local/www/nextcloud-29-0-0/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":"/usr/local/www/nextcloud-29-0-0/console.php","line":113,"function":"run","class":"OC\\Console\\Application","type":"->","args":[]},{"file":"/usr/local/www/nextcloud-29-0-0/occ","line":11,"args":["/usr/local/www/nextcloud-29-0-0/console.php"],"function":"require_once"}],"File":"/usr/local/www/nextcloud-29-0-0/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":"SzDTf3sVKv8GwvnIN8UQ","level":3,"time":"2024-11-08T22:19:02+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.11.1","data":{"app":"updater"}}
{"reqId":"SzDTf3sVKv8GwvnIN8UQ","level":3,"time":"2024-11-08T22:19:02+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update failed","userAgent":"--","version":"28.0.11.1","data":{"app":"updater"}}
{"reqId":"SzDTf3sVKv8GwvnIN8UQ","level":1,"time":"2024-11-08T22:19:02+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"--","version":"28.0.11.1","data":{"app":"updater"}}
{"reqId":"SzDTf3sVKv8GwvnIN8UQ","level":1,"time":"2024-11-08T22:19:02+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Debug(0)","userAgent":"--","version":"28.0.11.1","data":{"app":"updater"}}

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

<?php
$CONFIG = array (
  'debug' => false,
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
  ),
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => 0,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '{ip}',
    'port' => 6379,
  ),
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'domain.xxx',
  ),
  'datadirectory' => '/usr/local/www/nextcloud/data',
  'dbtype' => 'pgsql',
  'version' => '28.0.11.1',
  'overwrite.cli.url' => 'domain.xxx',
  'dbname' => 'xxx',
  'dbhost' => '{ip}',
  'dbport' => '5432',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'maintenance' => true,
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_smtpmode' => 'sendmail',
  'mail_from_address' => 'xxx',
  'mail_domain' => 'domain.xxx',
  'theme' => '',
  'filelocking.enabled' => true,
  'preview_max_scale_factor' => 1,
  'preview_max_memory' => 2048,
  'app.mail.imap.timeout' => 1,
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'updater.secret' => 'xxx',
);

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

No error messages showing Nextcloud

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.

See above as unable to access web UI 

Before you run the updater, can you first on command line run the:

php occ upgrade (you might need sudo or su to run it as the webserver user)

first, so perhaps some tables or apps or something has not finished upgrading the last time?

Thanks for the response.

I have tried this as well but the same problem exists?

For now I have updated to 28.0.12:

sudo -u www php occ upgrade
Nextcloud is already latest version

If I use version 29.0.0 I get this:

sudo -u www php occ 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
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Resetting log level

Just to clarify… these are vanilla builds downloaded from the website. My original installation was built from FreeBSD @Ports

In the original install I have a few apps installed which aren’t part of vanilla so I have an apps and apps-pkg folder of which from above I am not using the apps-pkg folder.

I wonder if there is some reference in the database to an older version from a 3rd party installed app causing this?

Using the original “failed” install -

The list from apps-pkg:

ls nextcloud-prod/apps-pkg
activity		files_reminders		settings
admin_audit		files_sharing		sharebymail
bruteforcesettings	files_trashbin		support
calendar		files_versions		survey_client
circles			firstrunwizard		suspicious_login
cloud_federation_api	logreader		systemtags
comments		lookup_server_connector	tasks
contacts		nextcloud_announcements	text
contactsinteraction	notes			theming
dashboard		notifications		twofactor_backupcodes
dav			oauth2			twofactor_totp
encryption		password_policy		updatenotification
federatedfilesharing	photos			user_ldap
federation		privacy			user_status
files			provisioning_api	viewer
files_downloadlimit	recommendations		weather_status
files_external		related_resources	workflowengine
files_pdfviewer		serverinfo

and apps:

ls nextcloud-prod/apps
bruteforcesettings	music			snappymail
calendar		notes			stable1.4.zip
contacts		ocdownloader		tasks
files_rightclick	ocdownloader.tar.gz	weather
limit_login_to_ip	phonetrack		zimbradrive
mail			previewgenerator	zimbradrive.tar.gz
mail.tar.gz

My current apps list from 28.0.12:

 ls nextcloud-28-0-12/apps
activity		files_sharing		settings
admin_audit		files_trashbin		sharebymail
bruteforcesettings	files_versions		support
circles			firstrunwizard		survey_client
cloud_federation_api	logreader		suspicious_login
comments		lookup_server_connector	systemtags
contactsinteraction	nextcloud_announcements	text
dashboard		notifications		theming
dav			oauth2			twofactor_backupcodes
encryption		password_policy		twofactor_totp
federatedfilesharing	photos			updatenotification
federation		privacy			user_ldap
files			provisioning_api	user_status
files_external		recommendations		viewer
files_pdfviewer		related_resources	weather_status
files_reminders		serverinfo		workflowengine

Though the upgrade to 29.0.0 is actually vanilla too as I downloaded that from the above link -

ls nextcloud-29-0-0/apps
activity		files_sharing		sharebymail
admin_audit		files_trashbin		support
bruteforcesettings	files_versions		survey_client
circles			firstrunwizard		suspicious_login
cloud_federation_api	logreader		systemtags
comments		lookup_server_connector	text
contactsinteraction	nextcloud_announcements	theming
dashboard		notifications		twofactor_backupcodes
dav			oauth2			twofactor_totp
encryption		password_policy		updatenotification
federatedfilesharing	photos			user_ldap
federation		privacy			user_status
files			provisioning_api	viewer
files_downloadlimit	recommendations		weather_status
files_external		related_resources	workflowengine
files_pdfviewer		serverinfo
files_reminders		settings

So in theory it should work unless as suggested something in the DB is keeping the “upgrade” from failing?

It sounds like you’re doing manual updates, correct? Is this the process you’re following?

What’s different about how you’re doing your update to 28.0.12 versus 29.0.0?

So you have two setups installed?

and a third one?
:face_with_spiral_eyes:

If you use packaged versions (from ports, docker images, vm images, …), check their update procedures. Often they want you to update their packages differently.

You can have different setups on the same machine, but make sure to keep everything separate (data-folders, databases, …) to avoid to mix things up.

1 Like

Hi everyone!!

Sorry for the confusion and many thanks for the responses…

What actually happened from the beginning is that I upgraded my FreeBSD @Ports collection which went from version 26 or 27 all the way up to 29 as I hadn’t done it in a while.

Of course that would not work as Nextcloud needs to be kept updated incrementing each version +1.

Failed upgrade!

I then read around and understood that I had missed version 28.x.x so I manually upgraded to that and all was fine…

I am not running 3x or more version in case there is a misunderstanding!

I have the folders in /usr/local/www which Apache is not serving up. What I have done for now… until I get things sorted, is to symlink what Apache needs using:

ln -s nextcloud-xx-x-x nextcloud

it basically enables me to easily swap between versions until I get things sorted to being back to where the @Ports collection needs it to be which is version 29.x.x currently

So all in all… yes! this is pretty much the procedure I am following (@jtr) :

https://docs.nextcloud.com/server/latest/admin_manual/maintenance/manual_upgrade.html

  • Temporarily for now!

No difference in procedure at all… essentially

I wonder if I should open a bug report on this or is there something else I could try?

Maybe dumping the DB and reinstalling then reloading the original DB into the new one?

I don’t think this is a bug. I think something is mixed up in your environment.

I’m still unclear about what you have in place.

The version checking primarily in reliant on two values:

  • version within the config/config.php of the installation you’re operating in (this, in effect, indicates the version of Nextcloud you have upgraded the database to)
  • the contents of version.php of the installation you’re operating in (this is the version of Nextcloud you’re attempting to install)

Hmm… how can I clarify that?

version.php contains:

<?php 
$OC_Version = array(28,0,12,2);
$OC_VersionString = '28.0.12';
$OC_Edition = '';
$OC_Channel = 'stable';
$OC_VersionCanBeUpgradedFrom = array (
  'nextcloud' => 
  array (
    '27.0' => true,
    '27.1' => true,
    '28.0' => true,
  ),
  'owncloud' => 
  array (
    '10.13' => true,
  ),
);
$OC_Build = '2024-11-07T09:03:36+00:00 d52e850623bd7f9ea8d880a39e440d58e7145257';
$vendor = 'nextcloud';

config.php contains:

'version' => '28.0.12.2',

It seems to all match…

And the version.php of the downloaded files when you try to do the upgrade? I suppose you use the latest 29 version?
Not that you got a wrong version by accident.

It’s not great that the error message does not mention more details about the versions, that it would be more obvious.

The error is thrown here:

If you change this a bit, you can print the actual versions.

throw new \Exception('Updates between multiple major versions and downgrades are unsupported. Current version: ' . $currentVersion . ', Installed version: ' . $installedVersion);