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)
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.
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