Update from 27 to 28 fails: Updates between multiple major versions and downgrades are unsupported

I’m running Nextcloud 27.1.9 and try to upgrade to 28.0.5 via CLI (web update hasn’t been working for quite some time).

I’m using instructions from Upgrade manually — Nextcloud latest Administration Manual latest documentation

However when I run occ upgrade I get the following error:

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
Turned on maintenance mode
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Resetting log level

I tried to run occ with -vvv parameter but didn’t get any verbose output.

Is there any other way to get more verbose output from occ? Or can someone explain what checks are done that can potentially lead to above mentioned error message?

Are you sure you didn’t download the Archive file for 29.0.0 and upload it by accident?

P.S. What issues do you run into using the Updater? Have you tried using the Updater from the CLI (updater.phar)[1]?

[1] Upgrade via built-in updater — Nextcloud latest Administration Manual latest documentation

You should use the → commandline based updater ← for updates if the web update does not work.

Much and good luck,

Yes, I am sure that I’m not using 29 - I first downloaded latest.zip and then realized that my installation is too old for the latest zip :joy:

Thanks for the tip with the commandline based updater - this one prints out an error message whereas web updater just said: Check for expected files failed.

sudo -u apache php --define apc.enable_cli=1 /serve/xxx/nextcloud/updater/updater.phar

Nextcloud Updater - version: v27.1.6-2-gfa49766 dirty

Current version is 27.1.9.

Update to Nextcloud 28.0.5 available. (channel: “stable”)
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-28.0.5.zip
Open changelog :arrow_upper_right:

Steps that will be executed:
Check for expected files
Check for write permissions
Create backup
Verify integrity
Enable maintenance mode
Replace entry points
Delete old files
Move new files in place

Start update? [y/N] y

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

Check for expected files …PHP Warning: file_put_contents(/serve/owncloud-data/updater-ocsu80ki2op8/.step): Failed to open stream: Permission denied in phar:///serve/xxx/nextcloud/updater/updater.phar/lib/Updater.php on line 1029
[✘] Check for expected files failed
Could not write to .step

Update failed. To resume or retry just execute the updater again.

but I don’t understand why this error happens. It was able to create the directory but then failed to write a file into it?

drwxr-x— 2 apache apache 0 May 17 16:17 updater-ocsu80ki2op8

if I try from cli

sudo -u apache touch /serve/owncloud-data/updater-ocsu80ki2op8/.step

file is created

-rw-r----- 1 apache apache 0 May 17 16:21 /serve/owncloud-data/updater-ocsu80ki2op8/.step

Did you remove all previous .step files first?

If not try this:

  • remove all old .step files from /serve/owncloud-data/updater-ocsu80ki2op8/` directory and try again.



That is indeed weird. Because just before that, in the code, the directory is created and the file is created (empty) via touch(). That’s succeeding in your case. The failure is only when there is a standard PHP file_put_contents() to place the actual step data inside of it.

What happens when you do something like echo blah > /serve/owncloud-data/updater-ocsu80ki2op8/.step?

And what version of PHP is this? (php -v)

Put this into a file called test.php:

   var_dump(file_put_contents("/tmp/blah", "blah blah blah"));

If /tmp/blah contains “blah blah blah” (good) then adjust the test.php file and re-try:

   var_dump(file_put_contents("/serve/owncloud-data/updater-ocsu80ki2op8/.step", "not a real step file"));

That is the line that doesn’t work in your environment for some reason.

With the new information from cli-updater output I was able to find the solution.

Writing it down if anyone is facing the same issue:

I’m having exactly the same setup as this guy here: [Bug] Upgrade nC 13.0.2 to 14.0.4 Could not write to .step · Issue #12770 · nextcloud/server · GitHub and facing the same error.

However the solution was to disable the setting hide dot files = yes in smb.conf on TrueNAS. Once done updater is now working.

No idea why Nextcloud all of a sudden doesn’t like this setting anymore. I’ve checked my update.log file and problems started from version 26 onwards. Before that updates always worked.

Hope this helps if anyone else stumbles across this issue.

1 Like

Hah. Yes, that would do it.

Presumably that option was toggled at some point. Updater (regardless of mode: web or command line) would have never worked with that.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.