Upgrading 19.0.8 to 20.0.7 fails: Updates between multiple major versions assumed by updater

Hi all,

we were running Nextcloud version 18.0.13 until this evening and decided to upgrade to 20.0.7.
So we walked through the updates
18.0.13 => 18.0.14
18.0.14 => 19.0.8
without any problems. Instance was running after every update, everything working, no errors in the logs.
Now trying to update from 19.0.8 => 20.0.7 throws us an exception that updates between multiple major versions and downgrades are unsupported:

# sudo -u www-data 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

nextcloud.log showing the same error:

{“reqId”:“9oVqSEAJmeT0chnpQfiy”,“level”:3,“time”:“2021-02-10T22:11:30+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"",“url”:"–",“message”:"\OC\Updater::failure: Exception: Updates between multiple major versions and downgrades are unsupported.",“userAgent”:"–",“version”:“”}
{“reqId”:“9oVqSEAJmeT0chnpQfiy”,“level”:3,“time”:“2021-02-10T22:11:30+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"",“url”:"–",“message”:"\OC\Updater::updateEnd: Update failed",“userAgent”:"–",“version”:“”}
{“reqId”:“9oVqSEAJmeT0chnpQfiy”,“level”:1,“time”:“2021-02-10T22:11:30+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"",“url”:"–",“message”:"\OC\Updater::maintenanceActive: Maintenance mode is kept active",“userAgent”:"–",“version”:“”}
{“reqId”:“9oVqSEAJmeT0chnpQfiy”,“level”:1,“time”:“2021-02-10T22:11:30+00:00”,“remoteAddr”:"",“user”:"–",“app”:“updater”,“method”:"",“url”:"–",“message”:"\OC\Updater::resetLogLevel: Reset log level to Warning(2)",“userAgent”:"–",“version”:“”}

He obviously thinks we are still on 18.0.13?
We are doing manual upgrades since using Nextcloud.

Our usual steps:

  1. cd /opt/nextcloud_www
  2. sudo -u www-data php occ maintenance:mode --on
  3. /etc/init.d/apache2 stop
  4. mv /opt/nextcloud_www /opt/nextcloud_www.old
  5. (Backup MySQL database using mysqldump)
  6. cd /usr/src
  7. tar -xvjf nextcloud-.tar.bz2
  8. chown -R www-data:www-data nextcloud
  9. find nextcloud/ -type d -exec chmod 750 {} ;
  10. find nextcloud/ -type f -exec chmod 640 {} ;
  11. mv nextcloud /opt/nextcloud_www
  12. cp -a /opt/nextcloud_www.old/config/config.php /opt/nextcloud_www/config
  13. cd /opt/nextcloud_www.old/apps
  14. cp -a drawio notes polls gpxpod spreed richdocuments /opt/nextcloud_www/apps
  15. /etc/init.d/apache2 start
  16. cd /opt/nextcloud_www
  17. sudo -u www-data php occ upgrade
  18. sudo -u www-data php occ maintenance:update:htaccess
  19. sudo -u www-data php occ db:add-missing-indice
  20. sudo -u www-data php occ db:add-missing-columns
  21. sudo -u www-data php occ db:convert-filecache-bigint
  22. sudo -u www-data php occ maintenance:mode --off

Environment is an Ubuntu Server 16.04.7 LTS with all updates installed. Using Apache 2.4.18 and MySQL 5.7.33 from official Ubuntu repository and PHP 7.4 from ondrej (https://launchpad.net/~ondrej/+archive/ubuntu/php) running as module.
Webfiles installed in /opt/nextcloud_www, data directory is /opt/nextcloud.

We already tried a maintenance:repair with version 19.0.8, but no errors were shown.

Web UI is also showing we were running on 19.0.8 and offers us an update to 20.0.7.

We don’t really know where to look since everyone else getting this error is really trying to jump over major versions :slight_smile:

Any hint or help is much appreciated and thank you in advance!

Greetings from Germany


Hi Bjoern,
you probably already solved this, but for anyone else searching for a solution to a similar problem this might be of use. I just encountered the same issue upgrading from 20.0.3 to 21.0.1. Before the update I thought it was wise to delete the line

  version => '20.0.3',

from my config.php… turns out it is not. The upgrade seems to get its previous version info from there.