Upgrade from 21.0.1 to 21.0.3 Borked

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 21.0.1
Operating system and version (eg, Ubuntu 20.04): Docker Container
Apache or nginx version (eg, Apache 2.4.25): Nginx inside docker container
PHP version (eg, 7.4): inside docker container

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Launch web ui upgrade
  2. Watch it fail spectacularly.
  3. Web interface stuck on “Update in Progress”

The output of your Nextcloud log in Admin > Logging:

NO UI

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => 'ocig2dkih2mx',
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' =>
  array (
    0 => '192.168.1.96:444',
    1 => 'nextcloud.echenique.com',
  ),
  'dbtype' => 'mysql',
  'version' => '21.0.1.1',
  'overwriteprotocol' => 'https',
  'overwrite.cli.url' => 'https://192.168.1.96:444',
  'dbname' => 'nextcloud',
  'dbhost' => '192.168.1.96:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncapp',
  'dbpassword' => 'xxxxxxxxxxx',
  'installed' => true,
  'maintenance' => false,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'do-not-reply',
  'mail_domain' => 'echenique.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'relay-monkey@echenique.com',
  'mail_smtppassword' => 'xxxxxxxxx',
  'theme' => '',
  'loglevel' => 2,
  'updater.secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
);

The output of your Apache/nginx/system log in /var/log/____:

2021/07/07 19:31:59 [error] 414#414: *14305 access forbidden by rule, client: 172.18.0.1, server: _, request: "GET /.well-known/webfinger HTTP/1.1", host: "nextcloud.echenique.com:443"
2021/07/07 19:31:59 [error] 414#414: *14306 access forbidden by rule, client: 172.18.0.1, server: _, request: "GET /.well-known/nodeinfo HTTP/1.1", host: "nextcloud.echenique.com:443"
2021/07/07 19:33:17 [error] 414#414: *14338 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 172.18.0.1, server: _, request: "POST /updater/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.echenique.com:443"
2021/07/07 19:34:44 [error] 414#414: *14384 FastCGI sent in stderr: "PHP message: PHP Warning:  rename(/data/updater-ocig2dkih2mx/downloads/nextcloud/ocs-provider/index.php): failed to open stream: No such file or directory in /config/www/nextcloud/updater/index.php on line 1048PHP message: PHP Warning:  rename(/data/updater-ocig2dkih2mx/downloads/nextcloud/ocs-provider/index.php,/config/www/nextcloud/updater/../ocs-provider/index.php): No such file or directory in /config/www/nextcloud/updater/index.php on line 1048" while reading response header from upstream, client: 172.18.0.1, server: _, request: "POST /updater/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.echenique.com:443"
2021/07/07 19:34:50 [error] 414#414: *14387 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: failed to open stream: No such file or directory in Unknown on line 0PHP message: PHP Fatal error:  Unknown: Failed opening required '/config/www/nextcloud/ocs/v2.php' (include_path='.:/usr/share/php7') in Unknown on line 0" while reading response header from upstream, client: 172.18.0.1, server: _, request: "GET /ocs/v2.php/core/navigation/apps?absolute=true&format=json HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.echenique.com:443"
2021/07/07 19:34:56 [error] 414#414: *14392 FastCGI sent in stderr: "PHP message: PHP Warning:  rename(/data/updater-ocig2dkih2mx/downloads/nextcloud/ocs/v1.php): failed to open stream: No such file or directory in /config/www/nextcloud/updater/index.php on line 1048PHP message: PHP Warning:  rename(/data/updater-ocig2dkih2mx/downloads/nextcloud/ocs/v1.php,/config/www/nextcloud/updater/../ocs/v1.php): No such file or directory in /config/www/nextcloud/updater/index.php on line 1048" while reading response header from upstream, client: 172.18.0.1, server: _, request: "POST /updater/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.echenique.com:443"
2021/07/07 19:35:12 [error] 414#414: *14394 FastCGI sent in stderr: "PHP message: PHP Warning:  rename(/data/updater-ocig2dkih2mx/downloads/nextcloud/resources/codesigning/root.crl): failed to open stream: No such file or directory in /config/www/nextcloud/updater/index.php on line 1048PHP message: PHP Warning:  rename(/data/updater-ocig2dkih2mx/downloads/nextcloud/resources/codesigning/root.crl,/config/www/nextcloud/updater/../resources/codesigning/root.crl): No such file or directory in /config/www/nextcloud/updater/index.php on line 1048" while reading response header from upstream, client: 172.18.0.1, server: _, request: "POST /updater/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.echenique.com:443"
2021/07/07 19:35:13 [error] 414#414: *14396 FastCGI sent in stderr: "PHP message: PHP Warning:  rename(/data/updater-ocig2dkih2mx/downloads/nextcloud/resources/config/ca-bundle.crt): failed to open stream: No such file or directory in /config/www/nextcloud/updater/index.php on line 1048PHP message: PHP Warning:  rename(/data/updater-ocig2dkih2mx/downloads/nextcloud/resources/config/ca-bundle.crt,/config/www/nextcloud/updater/../resources/config/ca-bundle.crt): No such file or directory in /config/www/nextcloud/updater/index.php on line 1048" while reading response header from upstream, client: 172.18.0.1, server: _, request: "POST /updater/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.echenique.com:443"
2021/07/07 19:35:15 [error] 414#414: *14398 FastCGI sent in stderr: "PHP message: PHP Warning:  rename(/data/updater-ocig2dkih2mx/downloads/nextcloud/lib/composer/composer/autoload_psr4.php): failed to open stream: No such file or directory in /config/www/nextcloud/updater/index.php on line 1048PHP message: PHP Warning:  rename(/data/updater-ocig2dkih2mx/downloads/nextcloud/lib/composer/composer/autoload_psr4.php,/config/www/nextcloud/updater/../lib/composer/composer/autoload_psr4.php): No such file or directory in /config/www/nextcloud/updater/index.php on line 1048" while reading response header from upstream, client: 172.18.0.1, server: _, request: "POST /updater/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.echenique.com:443"
2021/07/07 19:36:37 [error] 414#414: *14410 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 172.18.0.1, server: _, request: "POST /updater/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.echenique.com:443"

Hi @etrigan63, have you acces to a shell on your nextcloud server ?
if yes find the nextcloud datadirectory and open nextcloud.log. Send somes lines, not all. ( in many case, it is in /var/www/nextcloud/data)

{"reqId":"kWgBzvVU8Ssq2Kck5uWY","level":3,"time":"2021-07-07T23:29:43+00:00","remoteAddr":"172.18.0.1","user":"guru","app":"index","method":"GET","url":"/apps/theming/favicon/dashboard?v=0","message":{"Exception":"OCP\\Files\\NotPermittedException","Message":"No create permission for path","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/private/Files/SimpleFS/NewSimpleFile.php","line":134,"function":"newFile","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/ImageManager.php","line":191,"function":"putContent","class":"OC\\Files\\SimpleFS\\NewSimpleFile","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/Controller/IconController.php","line":131,"function":"setCachedImage","class":"OCA\\Theming\\ImageManager","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":218,"function":"getFavicon","class":"OCA\\Theming\\Controller\\IconController","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":127,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/config/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/config/www/nextcloud/lib/private/Files/Node/Folder.php","Line":209,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0","version":"21.0.1.1"}
{"reqId":"fVRO1Iivvj4NnSisIgK0","level":3,"time":"2021-07-07T23:29:43+00:00","remoteAddr":"172.18.0.1","user":"guru","app":"index","method":"GET","url":"/apps/theming/icon/dashboard?v=0","message":{"Exception":"OCP\\Files\\NotPermittedException","Message":"No create permission for path","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/private/Files/SimpleFS/NewSimpleFile.php","line":134,"function":"newFile","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/ImageManager.php","line":191,"function":"putContent","class":"OC\\Files\\SimpleFS\\NewSimpleFile","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/Controller/IconController.php","line":167,"function":"setCachedImage","class":"OCA\\Theming\\ImageManager","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":218,"function":"getTouchIcon","class":"OCA\\Theming\\Controller\\IconController","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":127,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/config/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/config/www/nextcloud/lib/private/Files/Node/Folder.php","Line":209,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0","version":"21.0.1.1"}

@etrigan63, have you check the permissions on you nextcloud folder ?

chown’d the config folder to the user “abc”.

Ran the updater. Got this:

root@117aa498df1a:/# sudo -u abc php /config/www/nextcloud/updater/updater.phar
Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4

Step 6 is currently in process. Please call this command later.
root@117aa498df1a:/# 

How do i restart the upgrade process?

@etrigan63 I think you can restart your apache/nginx and do :
sudo -u abc php /config/www/nextcloud/updater/updater.phar

That is what gave me the aforementioned message about step 6.

@etrigan63 it gave you the message after restarting nginx ?

Restarted the container and it gives the same message.

@Mageunic Removed the .step file and restarted the update. Failed with the following error:

[ ] Downloading ...PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 134217736 bytes) in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 763

Removed .step file and updated php-local-ini. restarted container and restarted update. Fingers crossed.

@Mageunic
A bazillion error messages and it failed. Again.

PHP Warning:  rmdir(/data/updater-ocig2dkih2mx/downloads/nextcloud/config): No such file or directory in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 772
PHP Warning:  rmdir(/data/updater-ocig2dkih2mx/downloads/nextcloud/data): No such file or directory in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 772
PHP Warning:  rmdir(/data/updater-ocig2dkih2mx/downloads/nextcloud): No such file or directory in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 772
[✔] Downloading
[✔] Verify integrity
[ ] Extracting ...PHP Warning:  require(/config/www/nextcloud/updater/../version.php): failed to open stream: No such file or directory in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 658
PHP Fatal error:  require(): Failed opening required '/config/www/nextcloud/updater/../version.php' (include_path='.:/usr/share/php7') in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 658

@etrigan63 this is really strange

there is no clear reason of the issue…
maybe this can help but I think not :
sudo -u abc php /config/www/nextcloud/occ maintenance:repair

@Mageunic
Cleared the download directory, removed the step file restarted and got further:

[ ] Extracting ...PHP Warning:  ZipArchive::extractTo(/data/updater-ocig2dkih2mx/downloads/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php): failed to open stream: No such file or directory in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 680
[✘] Extracting failed
Error during unpacking zipfile: No error

Update failed. To resume or retry just execute the updater again.

Tried what you suggested:

root@117aa498df1a:/# sudo -u abc php /config/www/nextcloud/occ maintenance:repair
Composer autoloader not found, unable to continue. Check the folder "3rdparty". Running "git submodule update --init" will initialize the git submodule that handles the subfolder "3rdparty".root@117aa498df1a:/# 
Start update? [y/N] y

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[ ] Extracting ...PHP Warning:  require(/config/www/nextcloud/updater/../version.php): failed to open stream: No such file or directory in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 658
PHP Fatal error:  require(): Failed opening required '/config/www/nextcloud/updater/../version.php' (include_path='.:/usr/share/php7') in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 658
root@117aa498df1a:/# 

@etrigan63 make a backup of your data ( files of data directory / your database / themes, if you use a custom themes / config.php) and try to reinstall your nextcloud installation with the same versions you use currently ( not the next versions).

I think something is broken in your installation …

https://docs.nextcloud.com/server/latest/admin_manual/maintenance/backup.html
rename the older folder and after download/unzip the new installation, copy your config.php in the folder ( /nextcloud/config/).