Update from 13.0.1.1 to 13.0.2 Error

Dear support, it is already 3rd time in a row when I could not finish my upgrade wia web interface…
Today I meet funcy issue:

Could not rmdir: /var/www/nextcloud/updater/../ocs-provider

It is funny, because this folder does not exist any more:

#ls -la updater/
total 660
drwxr-x---  2 www-data www-data   4096 Jan 25 14:03 .
drwxr-xr-x 14 root     www-data   4096 Apr 20 10:12 ..
-rw-r-----  1 www-data www-data  63296 Apr 17 16:51 index.php
-rw-r-----  1 www-data www-data 598191 Apr 17 16:51 updater.phar

If I click “Retry” it is same error shown.
Any Idea how to proceed?

Try

ls -al /var/www/nextcloud/updater/../ocs-provider
:wink:

The actual path is:
/var/www/nextcloud/ocs-provider

Edit:
I assume this is a permission issue. Probably this directory has a different ownership defined or write permission is missing.

Yes, I catch it when I wrote…

# ls -la /var/www/nextcloud/updater/../ocs-provider
total 8
drwxr-x---  2 www-data www-data 4096 May  7 16:21 .
drwxr-xr-x 14 root     www-data 4096 Apr 20 10:12 ..

Basically it is also empty.

I see … strange. You could try to remove the folder manually then and hit retry in the web updater.

I have the same Idea and just removed it… Now it is stopps with next folder:

Could not rmdir: /var/www/nextcloud/updater/../3rdparty

In my case root folder of nextcloud belongs to root, as it made per script:

# ls -la
total 116
drwxr-xr-x 13 root     www-data  4096 May  7 16:37 .
drwxr-xr-x  6 root     root      4096 Apr 27 20:23 ..

I changed it to www-data and now it works…

# sudo chown www-data:www-data ../nextcloud
#ls -la ../
total 24
...
drwxr-xr-x 13 www-data www-data 4096 May  7 16:37 nextcloud

Now is the question: why correct strong permissions will break my web update?

UPDATE:
It is unbelievable… It is finished with same “core/shipped.json is not available” error!
What I did wrong?

The web updater is a PHP application and consequently runs with web server user rights - in your case www-data.
When you change ownership of folders and files to root, then obviously the web server cannot write to these files/ folders, meaning they cannot be overwritten, moved nor deleted. As a result the web updater cannot perform the required steps and fails.

This is the reason why it is not advised to use these strong permission. Admins who still use these strong permissions necessarily have to reset ownership and permission to default before using the web updater or perform manual updates via command line instead.

Concluding:

  • undo strong permissions before upgrading
  • or better don’t use the strong permissions (as earlier discussed by NC devs: the advantage is low compared to the many issues the users run into)

Ok, but why it is always fails with “core/shipped.json is not available” even if www-data is owner and had full access?

Probably this?

I’m not sure, but we have manually intervened in the update process. Maybe it’s causing the core/shipped.js issue in return. Just guessing though, but I never ran into that issue so far and always restored default ownership/ permission before the update and didn’t use strong permissions at last since NC12.

1 Like

I just broke permissions once after restore and try to repair them. Since that I did few 12x upgrade and did not meet any issue, but 13 always fails after deleting everything in the folder, even all of it belongs to www-data…

# ls -la data/updater-xxxxxxxx/backups/
total 28
drwxr-x---  7 www-data www-data 4096 May  7 15:56 .
drwxr-x---  4 www-data www-data 4096 May  7 16:54 ..
drwxr-x--- 14 www-data www-data 4096 Jan 23 13:00 nextcloud-12.0.0.29
drwxr-x--- 14 www-data www-data 4096 Jan 25 13:41 nextcloud-12.0.4.3
drwxr-x--- 14 www-data www-data 4096 Feb 13 09:57 nextcloud-12.0.5.3
drwxr-x--- 14 www-data www-data 4096 Apr 17 16:21 nextcloud-13.0.0.14
drwxr-x--- 13 www-data www-data 4096 May  7 16:17 nextcloud-13.0.1.1