Failed upgrade from 28.0.1 to 28.0.3 - how do I get back?

I use nextcloud on debian stable, “manually” installed from the tarballs (initially), then updated with the updater more or less smoothly every time.

For some reason the web based updater ended up failing at step “extracting”. Accessing from the browser led to a cryptic error message about git submodules. So I launched php /var/www/nextcloud/updater/updater.phar to try and recover from there but this is the output:

Nextcloud Updater - version: v27.1.0rc3-34-g94c444b dirty

Current version is 28.0.1.

Update to Nextcloud 28.0.3 available. (channel: "stable")
Following file will be downloaded automatically:
Open changelog ↗

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

Start update? [y/N] y

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

[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[ ] Extracting ...PHP Warning:  require(/var/www/nextcloud/updater/../version.php): Failed to open stream: No such file or directory in phar:///var/www/nextcloud/updater/updater.phar/lib/Updater.php on line 694
PHP Fatal error:  Uncaught Error: Failed opening required '/var/www/nextcloud/updater/../version.php' (include_path='.:/usr/share/php') in phar:///var/www/nextcloud/updater/updater.phar/lib/Updater.php:694
Stack trace:
#0 phar:///var/www/nextcloud/updater/updater.phar/lib/Updater.php(732): NC\Updater\Updater->getVersionByVersionFile()
#1 phar:///var/www/nextcloud/updater/updater.phar/lib/UpdateCommand.php(384): NC\Updater\Updater->extractDownload()
#2 phar:///var/www/nextcloud/updater/updater.phar/lib/UpdateCommand.php(237): NC\Updater\UpdateCommand->executeStep()
#3 phar:///var/www/nextcloud/updater/updater.phar/vendor/symfony/console/Command/Command.php(255): NC\Updater\UpdateCommand->execute()
#4 phar:///var/www/nextcloud/updater/updater.phar/vendor/symfony/console/Application.php(1021): Symfony\Component\Console\Command\Command->run()
#5 phar:///var/www/nextcloud/updater/updater.phar/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
#6 phar:///var/www/nextcloud/updater/updater.phar/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#7 phar:///var/www/nextcloud/updater/updater.phar/updater.php(10): Symfony\Component\Console\Application->run()
#8 /var/www/nextcloud/updater/updater.phar(14): require('...')
#9 {main}
  thrown in phar:///var/www/nextcloud/updater/updater.phar/lib/Updater.php on line 694

So… is there any hope that I can recover from here or did the failed upgrade just nuked my installation? I have some fairly recent backups from the backup apps, but maybe all is not lost at this point?

Thanks for your help

Looking for logs, it seems that a missing “shipped.json” is what lead to the inital failure:

2024-03-06T09:41:01+0100 PSE7Q48vaM [info] Step 8 is in state "end".
2024-03-06T09:41:01+0100 PSE7Q48vaM [info] POST request for step "9"
2024-03-06T09:41:01+0100 PSE7Q48vaM [info] startStep("9")
2024-03-06T09:41:01+0100 PSE7Q48vaM [info] deleteOldFiles()
2024-03-06T09:41:03+0100 PSE7Q48vaM [info] config sample exists
2024-03-06T09:41:03+0100 PSE7Q48vaM [info] themes README exists
2024-03-06T09:42:23+0100 PSE7Q48vaM [info] end of deleteOldFiles()
2024-03-06T09:42:23+0100 PSE7Q48vaM [info] endStep("9")
2024-03-06T09:42:44+0100 o0nq1nKyej [info] request to updater
2024-03-06T09:42:44+0100 o0nq1nKyej [info] currentStep()
2024-03-06T09:42:44+0100 o0nq1nKyej [info] Step 9 is in state "end".
2024-03-06T09:42:44+0100 o0nq1nKyej [info] POST request for step "9"
2024-03-06T09:42:44+0100 o0nq1nKyej [info] startStep("9")
2024-03-06T09:42:44+0100 o0nq1nKyej [info] deleteOldFiles()
2024-03-06T09:42:44+0100 o0nq1nKyej [error] POST request failed with other exception
2024-03-06T09:42:44+0100 o0nq1nKyej [error] Exception: Exception
Message: core/shipped.json is not available
#0 /var/www/nextcloud/updater/index.php(1361): Updater->deleteOldFiles()
#1 {main}

2024-03-06T09:42:44+0100 o0nq1nKyej [info] rollbackChanges("9")
2024-03-06T09:42:44+0100 o0nq1nKyej [info] unlink .step
2024-03-06T09:42:44+0100 o0nq1nKyej [info] rollbackChanges - step >= 7
2024-03-06T09:42:44+0100 o0nq1nKyej [info] end of  rollbackChanges()

Hum, I’m not sure this should be recommended but I managed to get it back up by restoring the updater-generated backup and relaunching updater.phar.

rsync /var/www/nextcloud/data/updater-oc1a2tpaodei/backups/nextcloud- /var/www/nextcloud/ -av
sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/updater/updater.phar
sudo -u www-data php8.2 --define apc.enable_cli=1 /var/www/nextcloud/occ upgrade
sudo -u www-data php8.2 --define apc.enable_cli=1 /var/www/nextcloud/occ  maintenance:mode --off
sudo systemctl restart php8.2-fpm.service

See you at the next upgrade :wink:


Indeed, that’s a fatal error. Any idea why it could missing from your installation folder? It’s used both at install time and during every update attempt so if you’ve used the Updater successfully in the past it was certainly once there.

It should be located at /var/www/nextcloud/core/shipped.json.

What happens if you trigger a manual integrity check of your core installation (occ integrity:check-core)?

You missed my self-response where I fixed my issue.

Unsurprisingly integrity:check-core now has no issues…

I saw you fixed it by reverting back to v28.0.1. I was trying to determine why this occurred to start with. :slight_smile:

I reverted then launched the CLI upgrader so now I’m on 28.0.3, but I too would love to understand what went wrong. NC updates are less smooth than I hoped…

I had this same issue but with docker.
I bashed into the container and ran
php ./occ upgrade
php ./occ maintenance:mode --off

With php ./occ upgrade gave an output that the upgrade was successful.

nothing in the nextcloud logs

Last week I had the same issue

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