docker icon indicating copy to clipboard operation
docker copied to clipboard

Upgrade attempt over 2 major versions leads to hardly recoverable state

Open aponert opened this issue 4 years ago • 6 comments

Although the documentation states, that upgrading must happen to the immediate successor version, trying to do so inadvertently leads to a non usable system afterwards.

As I see, in the entrypoint you check, wether we downgrade, or not. If I then return to the correct version, everything works.

In the other case, however, it seems the new nextcloud files are already rsynced, when the Exception: Updates between multiple major versions and downgrades are unsupported. app_1 | Update failed log appears.

Then trying to restart with the correct old version container makes it think a downgrade is in progress. Then we have an unusable system.

It would be just consequent, to cut off an upgrade like this as early as possible.

aponert avatar May 27 '20 15:05 aponert

Encountered the same problem.

ryanrain2016 avatar Jun 01 '20 03:06 ryanrain2016

@theq86 I try to upgrade from 16 to 18, but failed. Then I overwrite version.php with the nextcloud v16 and upgrade to v17. It worked!

ryanrain2016 avatar Jun 01 '20 03:06 ryanrain2016

It is good, that it is fixable. But It should rather be taken of that it can not happen in the first place. Downgrading check works that way.

aponert avatar Jun 01 '20 21:06 aponert

I try to upgrade from 16 to 18, but failed. Then I overwrite version.php with the nextcloud v16 and upgrade to v17. It worked!

@ryanrain2016 I pulled 20 now and was on 17. So what you are saying is, that I can replace the version.php (from 20) with the version.php from 18 and try to do the db update? And then go on with 19?

n3w avatar Nov 25 '20 17:11 n3w

same problem, before upgrade, 20 is runing pull new 22 image:

www-data@nextcloud-c849ff9c4-p6lxr:~/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

restart with old 20 image, error:

Can't start Nextcloud because the version of the data (22.1.1.2) is higher than the docker image version (20.0.3.2) and downgrading is not supported. Are you sure you have pulled the newest image version?

how can i recover the server?

joshuafc avatar Sep 07 '21 03:09 joshuafc

As ryanrain2016 mentioned, the manual solution to this is downgrading the version.php file back to last working version, run the same version of the container and do iterative updates. More info here: https://help.nextcloud.com/t/skipped-major-version-21-23-did-not-run-the-updater-yet/139638/2?u=vset

Gaeldrin avatar May 29 '22 11:05 Gaeldrin

I am not sure why the fix for this issue (#1304) was not merged. I had another attempt here: #2018.

wetneb avatar Jun 24 '23 09:06 wetneb