Cannot upgrade docker installation: v23 says installation to old, v22 says it's too new

Hello

I have a nextcloud installation based on the official docker-compose file.
(https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/insecure/mariadb/fpm/docker-compose.yml)

I’m currently running version 22.1.1.2. As it’s been a while since my last
update I decided to finally get to a more recent version, again, using the
instructions from that site:

$ docker-compose pull
$ docker-compose up -d

I’m now stuck in a dependency loop:

  • v23.XX is refusing to update, because my installation wasn’t the last version of v22.XX before.
  • v22.XX is also refusing to update, because it wrongly believes that I’m trying to downgrade from v23

Here’s the error I’m getting:

/var/www/html $ 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

I don’t think my database has actually been modified by the v23 update script
yet. Is it possible to somehow force the update?

Thank you

there is no requirement to upgrade to the latest minor version before major version upgrade - this should be a reason for your issue.

The upgrade from 22 to 23 should not be an issue. Maybe you was too fast on your first try - I see pretty long delay after the points docker container has started until Nextcloud became available… the reason is upgrading to next major version results in many app updates (one can monitor the progress using docker logs command).

try 23 again and wait long enough and check for issues within both docker logsand nextcloud.log… if you have a backup the easiest solution would be to recover latest working state and re-try the upgrade, if not follow discussions in this forum - this situation and possible solutions are discussed pretty often (especially when people try to jump upgrade over multiple major versions)…

Thanks for your reply. I was under the impression I needed to go through all versions first, since that’s what nextcloud’s internal updater does. Good to know that isn’t the case

I’ve tried again, this time waiting for 30 minutes before attempting to update. In addition, I tried the web based updater as well now, with the same result:


Starting the container with v21 or v22 gives me this:

2022-03-01T14:29:07.140332865Z Configuring Redis as session handler
2022-03-01T14:29:11.062598847Z Can't start Nextcloud because the version of the data (23.0.2.1) is higher than the docker image version (21.0.9.1) and downgrading is not supported. Are you sure you have pulled the newest image version?

The messages repeat over and over as the container keeps restarting

you have to upgrade step by step through all major versions as stated in the official guide:

It is only possible to upgrade one major version at a time. For example, if you want to upgrade from version 14 to 16, you will have to upgrade from version 14 to 15, then from 15 to 16.

you could try to revert you old version

but please beware or downgrades it could brake your system!

WHY? I summarize: you tried 3 unsupported operations for no reason (web updater and 2 downgrades) but didn’t collect the logs as I recommended? maybe this forum is not the right place to help you…

Of course I have checked the log file, that’s where my errors are coming from.

2022-03-01T14:29:07.140332865Z Configuring Redis as session handler
2022-03-01T14:29:11.062598847Z Can't start Nextcloud because the version of the data (23.0.2.1) is higher than the docker image version (21.0.9.1) and downgrading is not supported. Are you sure you have pulled the newest image version?

There is more log entries, all of which are just rehashes of this exact message.

Can't start Nextcloud because the version of the data is higher than the docker image version and downgrading is not supported

This looks very interesting, I will try that, thank you.

And as for the confusion about upgrading to the latest minor version: There is multiple sources, including in this forum that tell you to upgrade to the latest minor version first. So that is what I did. There is no need to get aggressive, I am just trying every possibility I can think of, because I haven’t seen any results so far.

this is not wrong (especially if you prefer stability you will automatically end on the last minor version before major upgrade) this is not a big deal so you could do it, just before the major update, but there is usually no need and I performed at least two major updates coming not from the latest minor version before (logically seen this recommendation is nonsence as current-1 release keep receiveing updates even after the next version is released).

I’m sorry but this is the only reaction I’m capable according to this

rather to focus on the only supported one: troubleshoot the 23…

Hello fellow gurus, I am getting the same error as Zaky’s screenshot.

Maybe this scenario helps.

I believe this might be related to the docker version of Nextcloud 23.0.2.
I say this because I have two servers, Truenas Core and Truenas Scale.
On core (not docker, running inside a jail), I upgraded Nextcloud to 23.0.2 and everything works. I then moved the database over to scale, modified Nextcloud’s config on core to point to the new SQL server on scale and everything still works. I then fire up the same version of Nextcloud on scale but running in docker and I end up with the button to upgrade and when I click it, I get the following error: Exception: Updates between multiple major versions and downgrades are unsupported.

Let me know if you need more info…

For me it sound like completely different issue (especially with your changes in mind)… Please follow the the official migration procedure to migrate to new server:

https://docs.nextcloud.com/server/stable/admin_manual/maintenance/migrating.html