Could not open input file: occ. Restoring backup from failed update

Nextcloud version: nextcloud-27.1.0.7-1700467839
Operating system and version: Ubuntu 22.04.3 LTS
Apache or nginx version: nginx/1.18.0 (Ubuntu)
PHP version: 8.1

I tried to update nextcloud via web interface. Got stuck, and relaunched a couple times by backing up the updater folder and relaunching via cli (mv updater-XXX updater-BK; sudo -u www-data php /var/www/nextcloud/updater/updater.phar). Got stuck again, so now I gave up.

I’d like to restore to how things were, but I’m still getting update in progress.

Looking for solutions I saw that I had to call sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off but the first surprise was that I had none of the usual file people referenced under /var/www/nextcloud (by usual files I mean occ, console.php, etc.). Nevertheless I tried copying the missing file from git, but still, something kept missing.

I tried two other options:

  • cloning the git repo: I don’t really like this options as it would be like reinstalling nextcloud. I just want to restore my installation
  • replacing the /var/www/nextcloud folder with the backup under updater. With this attempt I get the response 404 instead of the update in progress. Moreover, I can’t open the occ file in any way, even after setting acp.enbable=1 in all the php config I could find (under /etc/php/(my_version 8.1)/(cli | mods-available|fpm)/*.ini) and setting the permission correctly with chown -R 'www-data':'www-data' *

I should also mention that there is no docker involved (installed directly) and that the nextcloud data is saved on a samba mounted volume.

If more details are needed, let me know and I’ll try to provide them.

I’m currently stuck and out of options. If somebody could shed some light on how to restore or resolve this situation I would be extremely grateful.

Thank you in advance

What sort of version string is this? Is that a typo?

Where, precisely, is it getting stuck? What step? There’s also an Updater specific log: data/updater.log that should give you the details of what it’s doing.

Sounds like Updater made it to at least step 8, which is the entry points of the existing installation are replaced.

Don’t do this. If anything you can do a Manual Update (see the Admin Manual under the Maintenance section).

  1. It would be informative to figure out why things got stuck at such an odd spot in the Updater.
  2. Perform a Manual Update (Upgrade manually — Nextcloud latest Administration Manual latest documentation)

You can skip and just do item 2 if you don’t want to troubleshoot this further.

1 Like

Since I can’t access the console interface, I retrieved the version from the name of the backup folder under the updater. It was updater-XXX/backups/nextcloud-27.1.0.7-1700467839

The first time it got stuck at step 10. The other times after or during the extraction of the files

Here’s the updater.log if you want more details. (I tried to run it a few times).

Thank you. I haven’t tried that option yet. I will look into it.

I was able to solve it by following the guide pointed out by @jtr .
Thank you very much :heartpulse:

1 Like

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