docker icon indicating copy to clipboard operation
docker copied to clipboard

Update from 22 to 23 failed b/c of exception: Updates between multiple major versions are unsupported

Open AlexCloudDev opened this issue 3 years ago • 12 comments

Hey, i can't update to 23, because when i try so, i got the exception: Updates between multiple major versions and downgrades are unsupported.

But i'm at 22.

Unfortunately this exception is also bugged, after it stops the upgrade process, you're stuck in maintenance mode and you can't go back to your former version, because now it says "version of the data is higher than the docker image version". So your installation is corrupted.

AlexCloudDev avatar Dec 03 '21 21:12 AlexCloudDev

In my case setting config.php to version "23.0.0.10" helped. (this version was the output of occ version)

devRoemer avatar Dec 04 '21 08:12 devRoemer

You can try the following:

docker exec -u 82 -it $your_nc_container /bin/sh This opens a shell inside of the container with the www-data-user (in my case the uid inside the container is 82).

Then you can execute the following: php occ upgrade

And: php occ maintenance:mode --off

Basically a normal manual upgrade.

Note: this is less than ideal. It is bad practice and I would not recommend it. But if you need your nextcloud and do not have a backup of the containers before the upgrade, this could be a fix. In my case, I regained access to my nextcloud, will export my data and redeploy freshly.

axkng avatar Dec 04 '21 12:12 axkng

I ran into this coming from 22.1.0.1. According to the contents of version.php that was replaced (but shouldn't have been!) 23 requires 22.2 or 23.

I followed the instructions in this blog post and was able to fix the version numbers and pull the latest nextcloud:stable release upgrading successfully to 22.2 and then nextcloud:latest to 23.0.0.

gradiian avatar Dec 04 '21 14:12 gradiian

In my case setting config.php to version "23.0.0.10" helped. (this version was the output of occ version)

worked for me. Full steps below:

1- docker exect -it xxx bash (enter the running container) 2- apt update && apt install nano 3- nano config/config.php 4- replace current (old) version by 23.0.0.10 5- su - www-data -s /bin/bash -c 'PHP_MEMORY_LIMIT=512M php /var/www/html/occ upgrade' 6- su - www-data -s /bin/bash -c 'PHP_MEMORY_LIMIT=512M php /var/www/html/occ maintenance:mode --off'

waterdrop01 avatar Dec 04 '21 21:12 waterdrop01

I had the same problem from 22.1.1 to 23, but after upgrading to 22.2.3, then it goes ok to 23. In my case, I am doing it not with docker but using git.

f4kt avatar Dec 05 '21 23:12 f4kt

I ran into this coming from 22.1.0.1. According to the contents of version.php that was replaced (but shouldn't have been!) 23 requires 22.2 or 23.

I followed the instructions in this blog post and was able to fix the version numbers and pull the latest nextcloud:stable release upgrading successfully to 22.2 and then nextcloud:latest to 23.0.0.

I had the same problem, this fixed it for me, thank you! -> edited Version numbers to the version I had before -> edited docker image to use image nextcloud:22 -> update to 22.2.3 worked

PacNiKK avatar Dec 08 '21 11:12 PacNiKK

I ran into this coming from 22.1.0.1. According to the contents of version.php that was replaced (but shouldn't have been!) 23 requires 22.2 or 23.

I followed the instructions in this blog post and was able to fix the version numbers and pull the latest nextcloud:stable release upgrading successfully to 22.2 and then nextcloud:latest to 23.0.0.

This also worked for me. The blog post does a good job of explaining it. In my case i used a Ubuntu-Container to do the editing. I mounted the nextcloud (app) volume on the Ubuntu-Container and edited the files that way.

Apsysikal avatar Dec 14 '21 20:12 Apsysikal

So when will this be fixed?

ell1e avatar Dec 15 '21 23:12 ell1e

@waterdrop01's fix almost solved the problem for me.

I had to downgrade MariaDB to 10.5 because I was getting:

Exception: Database error when running migration latest for app core

Once I downgraded MariaDB through docker, I was able to perform the nextcloud upgrade successfully. I'll be staying on MariaDB 10.5 for the forseeable future. :-/

So far it is running great. Thank you @waterdrop01 and the nextcloud team!

kemp avatar Dec 16 '21 17:12 kemp

I ran into this coming from 22.1.0.1. According to the contents of version.php that was replaced (but shouldn't have been!) 23 requires 22.2 or 23.

I followed the instructions in this blog post and was able to fix the version numbers and pull the latest nextcloud:stable release upgrading successfully to 22.2 and then nextcloud:latest to 23.0.0.

Hey, this article was exactly what I was looking for! Thank you, also if for whatever reason you can't get apt to work on the docker container (my nextcloud is running within a TrueNAS environment) don't forget you can always ALWAYS use curl to download the binaries (for nano) directly. https://packages.debian.org/bullseye/amd64/nano/download

tf-anguskong avatar Dec 18 '22 07:12 tf-anguskong

I can confirm this is still an issue, coming from 23-25.

This is a common problem that's going to get even more common as more people run nextcloud in docker - the following steps would end in a broken state:

  • Install nextcloud by adding the following dockerfile as recommended on https://help.nextcloud.com/t/using-dockerfile-to-extend-base-docker-compose-installation/133806
  nextcloud:
    image: nextcloud:latest

Or on https://hub.docker.com/_/nextcloud

 app:
    image: nextcloud
    ... 
  • Sometime later after 2 major version upgrades running: docker-compose pull

Basically the recommended install instructions lead to this bug.

And the top google result for how to resolve (https://help.nextcloud.com/t/cannot-upgrade-docker-based-nextcloud/133345/4) has a moderator dismissing anyone that didn't read the manual which isn't a good look either.

peterbraden avatar Feb 28 '23 09:02 peterbraden

The same steps mentioned above works for latest release as well

1- docker exect -it xxx bash (enter the running container) 2- apt update && apt install nano 3- nano config/config.php 4- replace current (old) version by 25.0.0.10 5- su - www-data -s /bin/bash -c 'PHP_MEMORY_LIMIT=512M php /var/www/html/occ upgrade' 6- su - www-data -s /bin/bash -c 'PHP_MEMORY_LIMIT=512M php /var/www/html/occ maintenance:mode --off'

ankurgogate avatar May 10 '23 18:05 ankurgogate

Fixed in #2018

joshtrichards avatar Mar 25 '24 20:03 joshtrichards