Update freeze: Could not open input file: occ

I ran the web updater to upgrade from 14.0.2 to 14.0.4.
The Upgrade got stuck and now I can’t enter my Nextcloud instance.
It shows Update in process.
I changed maintainance mode from true to false but that doesn’t change anything.
Also I tried the occ command to disable maintainance. All I get is Coukd not open input file: occ.
And now, I am helpless. I know that I have to run the command within the nextcloud root folder. I also checked the permissions. I dunno what to do now?

Any ideas?
Regards

what is the user your web server (apache? ninx?) runs as. On a Debian system this would be www-data. Inside the nextcloud directory, run the command

ls -l

It tells the owner of each file. You have to run the occ command as this user.

sudo -u www-data php occ …

Tell us if this helps.

It’s nginx and the user is www-data:

drwxr-xr-x 7 www-data www-data 4096 Jan 12 17:01 nextcloud

The command I tried: sudo -u www-data php occ maintenance:mode --off

Inside nextcloud:

/var/www/nextcloud $ ls -l
insgesamt 36
drwxr-xr-x 5 www-data www-data 4096 Jan 12 17:01 apps
drwxr-xr-x 2 www-data www-data 4096 Jan 15 22:31 config
drwxr-xr-x 2 www-data www-data 4096 Jun 14 2018 data
-rw-r–r-- 1 www-data www-data 57 Jan 12 17:01 index.php
-rw-r–r-- 1 www-data www-data 57 Jan 12 17:01 public.php
-rw-r–r-- 1 www-data www-data 57 Jan 12 17:01 remote.php
-rw-r–r-- 1 www-data www-data 57 Jan 12 17:01 status.php
drwxr-xr-x 2 www-data www-data 4096 Jan 12 17:01 themes
drwxr-xr-x 2 www-data www-data 4096 Apr 26 2018 updater

if you run this command (please replace XXXX with you NC ID) you will probably see that updater finished step 9, what is deleting of an old NC installation:

cat /var/www/nextcloud/data/updater-XXXXXX/.step

If this is a case, please follow instructions from this post: Update to 13 fails - core/shipped.json is not available - #4 by gas85

There is even “one command” solution for this case:

1 Like

My nextcloud/data folder just contains 2 files:

/var/www/nextcloud/data $ ls
index.html nextcloud.log

the last entries in the nextcloud.log are from june last year.
so the commands won’t work.
If I remember it correctly than the webupdater was at step cleaning up but I am not sure.

Thats strange… Basically this is where your data saved.
But based on this:

It looks like your clean up step (that is basically number 9) has the same issue that I mentioned here:

But you have not folder updater-xxxxx inside of the data folder. Could you please check if you did not rejected your data folder, just check your config.php (run inside of NC folder) to see where your data folder is:

grep datadirectory config/config.php
'datadirectory' => '/var/www/nextcloud/data',

I am so sorry for being that stupid. My data folder location is on a external hdd drive. I did not think of that at all. So I followed your commands and copied the updater-xxxxxx folder to /var/www/ and was able to run the update and disable maintainance mode via occ. Perfect!
I was wandering if that issue will happen again and startet to update to version 15.
The update is hanging at the same point. The web updater shows that it tries data folder under /var/www/nextcloud/data and fails, because the real data folder is elsewhere.

After moving files from updater-xxxxxx to /var/www/ I was able to do the update again.

The question now, how can I prevent this happening in the future? Is there another config I have to say that the data location is not on the default location?
In the past I was able to update using the web updater, so what changed?

1 Like

If you set your data folder correct in configuration file:

Then, I think you can open a ticket that updater will ignores settings of data folder set in config.php: Issues · nextcloud/server · GitHub
As soon as it solved, you will not meet this problem again :smiley:

Config file is fine. I will open a ticket.
Thanks for your assistance!

this command saved my day! Thank you!

1 Like