Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
AlexCloudDev opened this issue Dec 3, 2021 · 13 comments
Labels
bug feature: upgrading Upgrading an existing deployment to a new image/NC version

Comments

@AlexCloudDev
Copy link

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.

@devRoemer
Copy link

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

@axkng
Copy link

axkng commented Dec 4, 2021

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.

@gradiian
Copy link

gradiian commented Dec 4, 2021

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.

@waterdrop01
Copy link

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'

@f4kt
Copy link

f4kt commented Dec 5, 2021

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.

@PacNiKK
Copy link

PacNiKK commented Dec 8, 2021

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

@Apsysikal
Copy link

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.

@ell1e
Copy link

ell1e commented Dec 15, 2021

So when will this be fixed?

@kemp
Copy link

kemp commented Dec 16, 2021

@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!

@tf-anguskong
Copy link

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

@peterbraden
Copy link

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:

  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.

@ankurgogate
Copy link

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'

@joshtrichards joshtrichards added feature: upgrading Upgrading an existing deployment to a new image/NC version bug labels Oct 24, 2023
@joshtrichards
Copy link
Member

Fixed in #2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feature: upgrading Upgrading an existing deployment to a new image/NC version
Projects
None yet
Development

No branches or pull requests