NC12B2 upgrade failed nextcloud currently down

I was running NC12B2 UB1604 and I was having the update button not working as a known problem.

I then did the CLI update: sudo -u www-data php updater/updater.phar

It got stuck at delete old files…
[â] Check for expected files
[â] Check for write permissions
[â] Enable maintenance mode
[â] Create backup
[â] Downloading
[â] Verify integrity
[â] Extracting
[â] Replace entry points
[ ] Delete old files …PHP Warning: unlink(/var/www/html/nextcloud/updater/…/core/skeleton.old/Nextcloud.mp4): Permission denied in phar:///var/www/html/nextcloud/updater/updater.phar/lib/Updater.php on line 759
[â] Delete old files failed
Could not unlink: /var/www/html/nextcloud/updater/…/core/skeleton.old/Nextcloud.mp4

Update failed. To resume or retry just execute the updater again.
root@nextcloud:/var/www/html/nextcloud# sudo -u www-data php updater/updater.phar
Nextcloud Updater - version: v11.0.3-19-g3e2d9de

When Running the updater again as suggested:
] Extracting …PHP Warning: require(/var/www/html/nextcloud/updater/…/version.php): failed to open stream: No such file or directory in phar:///var/www/html/nextcloud/updater/updater.phar/lib/Updater.php on line 582
PHP Fatal error: require(): Failed opening required ‘/var/www/html/nextcloud/updater/…/version.php’ (include_path=’.:/usr/share/php’) in phar:///var/www/html/nextcloud/updater/updater.phar/lib/Updater.php on line 582

At the moment my nextcloud is totally down hanging at frontpage with Update in Process.

I did try to set the maintenance option to false but no luck.

How should I get the updater to work again for now I’m stuck as from the tips on several forum sections I could not get it to work.

Ensure your permissions are correct and www-data has ownership/r/w on the file(s) in question and run the updater again.

Otherwise, you can restore the backup it made in the 4th step.

Thnx Jason! But how do I reset the updater to retry again after I changed permission; I don’t get the updater status changed at this moment.

My concern is as well to the fact that I did say at the 1st error to just rerun updater again but it just made it worse:
Extracting …PHP Warning: require(/var/www/html/nextcloud/updater/…/version.php): failed to open stream: No such file or directory in phar:///var/www/html/nextcloud/updater/updater.phar/lib/Updater.php on line 582
PHP Fatal error: require(): Failed opening required ‘/var/www/html/nextcloud/updater/…/version.php’ (include_path=’.:/usr/share/php’) in phar:///var/www/html/nextcloud/updater/updater.phar/lib/Updater.php on line 582

Err, yes that does look worse.

Can you verify you have backups in /data/updater-[somestring]/backups/...... ?

Yes I have: nextcloud-12.0.0.18; I however never restored one yet so if you have a few pointers? OCC seems to be giving me problems now as well :frowning:

Copy the latest backup out to a new folder in the webroot, then either:

  • Rename the current install, then rename the copy to the original
  • Create/edit a vhost in Apache to direct traffic to the new directory

It doesn’t look like the update made it to database, so I should think you’ll be fine once you’ve done either of the above. Fingers crossed.

Don’t forget to move/copy your data folder too.

Thnx again Jason: well… the copy of backup to webroot & then rename all worked however still: "Update in process."
Even after a reboot; any suggestions to go forward?

Oh dear. Do you have a database backup?
You could try the occ upgrade once more too.

oh dear oh dear oh dear I have no occ any longer in 12.x I only see it in old NC11.03 backup directory’s…
I have maybe an old mysqlback from yesterday … I hope … let me check

I just did a mysqlimport -u [uname] -p[pass] [dbname] [backupfile.sql] from last night and the execution worked OK but still no go :frowning: “Update in Process”

@tflidd @MorrisJobke @jospoortvliet have you guys seen this? If it’s not the db then something in data causing this?

In the interim, clear your browser cache.

Cache is cleared already I did try to logon from several different PC’s and even different browsers; all stuck at this frontpage. I can try to roll back to an disaster recovery image with NC12B1 but preferred not as I loose then some data and users

Users perhaps, but you have your current data directory in place so extracting the new data since will be no difficult task.

Hang fire for the others a moment, I’ll see if I can find reference to this error elsewhere.

Edit, you could also manually update, like the old days. Get an install up and running from the latest zip, copy in your data, config, optionally any apps, themes and restore the database to the current state (you took a backup before restoring the previous version?) Or run occ update to bring the 11.x db up to 12.

1 Like

Jason, OCC is not working neither existing in my entire NC12; it was in my old 11.0x backup folder but it seems with the upgrade from 11.0.3 to NC12B1/B2 my occ got removed without me noticing it. Is this a bug or known?

Without further updates I’m planning to destroy my NC12 and either build it up from scratch with NC12.0 and ask users to move over the data again manually that they still like.
cheers & thnx for helping out today.

I don’t see anything on searching that mentions OCC disappearing. You’ll do well to raise an issue on https:/;github.com/nextcloud/server/issues

So is OCC working when you’re in the webroot of the “restored” backup? I don’t think you’re at the point of binning it and migrating users just yet, you still have a database and a copy of the data directory, so you should be more than capable of restoring this either into a backup or a new instance.

I recovered from an old 11.03 recovery image I created. case closed.
See still: https://github.com/nextcloud/server/issues/5178 #Tshirt ?

@jospoortvliet :slight_smile:

Cool! If this turns out to be a real upgrade bug and you were first to find it, you earn a shirt :wink:

Be sure to give all info needed to fix it, I see you didn’t use the full template to give info like PHP version, logs etc which will probably be needed to verify and fix it.

Probably good to link to this issue, too, btw.

1 Like

well here is already another 11.03 to 12.0 bug reported:
https://github.com/nextcloud/server/issues/4836 (it was fixed after re-upgrading from 11.03 to 12.0 final)
and another one:
https://github.com/nextcloud/server/issues/4819 (fixes as well in 12.0 final)

I’ll try to get the rest of the template updated later today

You’re indeed working hard on earning a shirt :wink:

Sent me your address by private message pls!