Upgrade failed at step 9 (delete old files) without any error in the logs

Nextcloud version: 22.2.7.1
Operating system and version: Raspberry Pi OS Bullseye
Apache or nginx version: Apache 2.4.53
PHP version : 7.4

I started an upgrade (NC 22 to NC 23.0.4) using the GUI. This failed at step 9 (delete old files), without any message in the “show error details” box.
That’s not the first time an upgrade (for NC or OwnCloud) failed, but usually, the Internets help me to find a solution. This time, I do not even know what to look for :frowning:
There is no error message in the logs, occ is missing (many files are actually missing from my root folder) and I cannot reach the web interface, due to a missing .htaccess.

  • Do you have any idea how to finish the upgrade?
  • Or, how could I revert to the pre-upgrade backup (e.g. to try again)? I’d better not fiddle myself with the contents of the data/updater-.../backups folder without first reading any documentation on how to do so properly.

Thanks!

Content of updater.log
There is no clear error here :frowning:
I cannot understand why it stopped at the end of step 9 and did not go forward. Note that my wi-fi connection may have gone down at that time, maybe an async request from my browser failed at that time? If so, my browser maybe just “stopped triggerring steps” after step 9, and I might just manually force steps 10+? Is that even possible? Would that make sense?

2022-05-09T21:00:38+0200 TjnBOwcluB [info] request to updater
2022-05-09T21:00:38+0200 TjnBOwcluB [info] currentStep()
2022-05-09T21:00:38+0200 TjnBOwcluB [info] show HTML page
2022-05-09T21:00:38+0200 TjnBOwcluB [info] current version: 22.2.7 build time: 2022-04-21T15:32:48+00:00 7fcf8a6edc048a78fa2715f379e1202eb2533277
2022-05-09T21:00:38+0200 TjnBOwcluB [info] getUpdateServerResponse()
2022-05-09T21:00:38+0200 TjnBOwcluB [info] updaterServer: https://updates.nextcloud.com/updater_server/
2022-05-09T21:00:38+0200 TjnBOwcluB [info] releaseChannel: stable
2022-05-09T21:00:38+0200 TjnBOwcluB [info] internal version: 22.2.7.1
2022-05-09T21:00:38+0200 TjnBOwcluB [info] updateURL: https://updates.nextcloud.com/updater_server/?version=22x2x7x1xxxstablexx2022-04-21T15%3A32%3A48%2B00%3A00+7fcf8a6edc048a78fa2715f379e1202eb2533277x7x4x29
2022-05-09T21:00:39+0200 TjnBOwcluB [info] getUpdateServerResponse response: Array
(
    [version] => 23.0.4.1
    [versionstring] => Nextcloud 23.0.4
    [url] => https://download.nextcloud.com/server/releases/nextcloud-23.0.4.zip
    [web] => https://docs.nextcloud.com/server/23/admin_manual/maintenance/upgrade.html
    [changes] => https://updates.nextcloud.com/changelog_server/?version=23.0.4
    [autoupdater] => 1
    [eol] => 0
    [signature] => ...
)

2022-05-09T21:00:39+0200 TjnBOwcluB [info] checkForUpdate() Array
(
    [version] => 23.0.4.1
    [versionstring] => Nextcloud 23.0.4
    [url] => https://download.nextcloud.com/server/releases/nextcloud-23.0.4.zip
    [web] => https://docs.nextcloud.com/server/23/admin_manual/maintenance/upgrade.html
    [changes] => https://updates.nextcloud.com/changelog_server/?version=23.0.4
    [autoupdater] => 1
    [eol] => 0
    [signature] => ...
)

2022-05-09T21:00:39+0200 TjnBOwcluB [info] getChangelogURL()
2022-05-09T21:00:39+0200 TjnBOwcluB [info] end of checkForUpdate() Update to Nextcloud 23.0.4 available. (channel: "stable")<br /><span class="light">Following file will be downloaded automatically:</span> <code class="light">https://download.nextcloud.com/server/releases/nextcloud-23.0.4.zip</code><br /><a class="external_link" href="https://nextcloud.com/changelog/#23-0-4" target="_blank" rel="noreferrer noopener">Open changelog ↗</a>
2022-05-09T21:00:40+0200 7dECE2VakS [info] request to updater
2022-05-09T21:00:40+0200 7dECE2VakS [info] currentStep()
2022-05-09T21:00:40+0200 7dECE2VakS [info] POST request for step "1"
2022-05-09T21:00:41+0200 7dECE2VakS [info] startStep("1")
2022-05-09T21:00:41+0200 7dECE2VakS [info] checkForExpectedFilesAndFolders()
2022-05-09T21:00:41+0200 7dECE2VakS [info] end of checkForExpectedFilesAndFolders()
2022-05-09T21:00:41+0200 7dECE2VakS [info] endStep("1")
2022-05-09T21:00:41+0200 eLZPtbDtM7 [info] request to updater
2022-05-09T21:00:41+0200 eLZPtbDtM7 [info] currentStep()
2022-05-09T21:00:41+0200 eLZPtbDtM7 [info] Step 1 is in state "end".
2022-05-09T21:00:41+0200 eLZPtbDtM7 [info] POST request for step "2"
2022-05-09T21:00:41+0200 eLZPtbDtM7 [info] startStep("2")
2022-05-09T21:00:41+0200 eLZPtbDtM7 [info] checkWritePermissions()
2022-05-09T21:00:41+0200 eLZPtbDtM7 [info] end of checkWritePermissions()
2022-05-09T21:00:41+0200 eLZPtbDtM7 [info] endStep("2")
2022-05-09T21:00:41+0200 4lelz4dEca [info] request to updater
2022-05-09T21:00:41+0200 4lelz4dEca [info] currentStep()
2022-05-09T21:00:41+0200 4lelz4dEca [info] Step 2 is in state "end".
2022-05-09T21:00:41+0200 4lelz4dEca [info] POST request for step "3"
2022-05-09T21:00:41+0200 4lelz4dEca [info] startStep("3")
2022-05-09T21:00:41+0200 4lelz4dEca [info] createBackup()
2022-05-09T21:00:41+0200 4lelz4dEca [info] backup folder location: /srv/nextcloud/data/updater-..../backups/nextcloud-22.2.7.1-1652122841/
2022-05-09T21:06:21+0200 4lelz4dEca [info] end of createBackup()
2022-05-09T21:06:21+0200 4lelz4dEca [info] endStep("3")
2022-05-09T21:06:21+0200 yltfbAOntv [info] request to updater
2022-05-09T21:06:21+0200 yltfbAOntv [info] currentStep()
2022-05-09T21:06:21+0200 yltfbAOntv [info] Step 3 is in state "end".
2022-05-09T21:06:21+0200 yltfbAOntv [info] POST request for step "4"
2022-05-09T21:06:21+0200 yltfbAOntv [info] startStep("4")
2022-05-09T21:06:21+0200 yltfbAOntv [info] downloadUpdate()
2022-05-09T21:06:21+0200 yltfbAOntv [info] getUpdateServerResponse()
2022-05-09T21:06:21+0200 yltfbAOntv [info] updaterServer: https://updates.nextcloud.com/updater_server/
2022-05-09T21:06:21+0200 yltfbAOntv [info] releaseChannel: stable
2022-05-09T21:06:21+0200 yltfbAOntv [info] internal version: 22.2.7.1
2022-05-09T21:06:21+0200 yltfbAOntv [info] updateURL: https://updates.nextcloud.com/updater_server/?version=22x2x7x1xxxstablexx2022-04-21T15%3A32%3A48%2B00%3A00+7fcf8a6edc048a78fa2715f379e1202eb2533277x7x4x29
2022-05-09T21:06:22+0200 yltfbAOntv [info] getUpdateServerResponse response: Array
(
    [version] => 23.0.4.1
    [versionstring] => Nextcloud 23.0.4
    [url] => https://download.nextcloud.com/server/releases/nextcloud-23.0.4.zip
    [web] => https://docs.nextcloud.com/server/23/admin_manual/maintenance/upgrade.html
    [changes] => https://updates.nextcloud.com/changelog_server/?version=23.0.4
    [autoupdater] => 1
    [eol] => 0
    [signature] =>...
)

2022-05-09T21:06:22+0200 yltfbAOntv [info] storage location exists
2022-05-09T21:06:44+0200 yltfbAOntv [info] end of downloadUpdate()
2022-05-09T21:06:44+0200 yltfbAOntv [info] endStep("4")
2022-05-09T21:06:44+0200 FBfebJO2BV [info] request to updater
2022-05-09T21:06:44+0200 FBfebJO2BV [info] currentStep()
2022-05-09T21:06:44+0200 FBfebJO2BV [info] Step 4 is in state "end".
2022-05-09T21:06:44+0200 FBfebJO2BV [info] POST request for step "5"
2022-05-09T21:06:45+0200 FBfebJO2BV [info] startStep("5")
2022-05-09T21:06:45+0200 FBfebJO2BV [info] verifyIntegrity()
2022-05-09T21:06:45+0200 FBfebJO2BV [info] getUpdateServerResponse()
2022-05-09T21:06:45+0200 FBfebJO2BV [info] updaterServer: https://updates.nextcloud.com/updater_server/
2022-05-09T21:06:45+0200 FBfebJO2BV [info] releaseChannel: stable
2022-05-09T21:06:45+0200 FBfebJO2BV [info] internal version: 22.2.7.1
2022-05-09T21:06:45+0200 FBfebJO2BV [info] updateURL: https://updates.nextcloud.com/updater_server/?version=22x2x7x1xxxstablexx2022-04-21T15%3A32%3A48%2B00%3A00+7fcf8a6edc048a78fa2715f379e1202eb2533277x7x4x29
2022-05-09T21:06:45+0200 FBfebJO2BV [info] getUpdateServerResponse response: Array
(
    [version] => 23.0.4.1
    [versionstring] => Nextcloud 23.0.4
    [url] => https://download.nextcloud.com/server/releases/nextcloud-23.0.4.zip
    [web] => https://docs.nextcloud.com/server/23/admin_manual/maintenance/upgrade.html
    [changes] => https://updates.nextcloud.com/changelog_server/?version=23.0.4
    [autoupdater] => 1
    [eol] => 0
    [signature] => ...
)

2022-05-09T21:06:45+0200 FBfebJO2BV [info] storage location: /srv/nextcloud/data/updater-.../downloads/
2022-05-09T21:06:48+0200 FBfebJO2BV [info] end of verifyIntegrity()
2022-05-09T21:06:48+0200 FBfebJO2BV [info] endStep("5")
2022-05-09T21:06:48+0200 OpGQzRvoCJ [info] request to updater
2022-05-09T21:06:48+0200 OpGQzRvoCJ [info] currentStep()
2022-05-09T21:06:48+0200 OpGQzRvoCJ [info] Step 5 is in state "end".
2022-05-09T21:06:48+0200 OpGQzRvoCJ [info] POST request for step "6"
2022-05-09T21:06:48+0200 OpGQzRvoCJ [info] startStep("6")
2022-05-09T21:06:48+0200 OpGQzRvoCJ [info] extractDownload()
2022-05-09T21:06:48+0200 OpGQzRvoCJ [info] storage location: /srv/nextcloud/data/updater-.../downloads/
2022-05-09T21:07:13+0200 OpGQzRvoCJ [info] end of extractDownload()
2022-05-09T21:07:13+0200 OpGQzRvoCJ [info] endStep("6")
2022-05-09T21:07:13+0200 06P1l80bpO [info] request to updater
2022-05-09T21:07:13+0200 06P1l80bpO [info] currentStep()
2022-05-09T21:07:13+0200 06P1l80bpO [info] Step 6 is in state "end".
2022-05-09T21:07:13+0200 06P1l80bpO [info] POST request for step "7"
2022-05-09T21:07:13+0200 06P1l80bpO [info] startStep("7")
2022-05-09T21:07:13+0200 06P1l80bpO [info] setMaintenanceMode("true")
2022-05-09T21:07:13+0200 06P1l80bpO [info] configFileName /srv/nextcloud/updater/../config/config.php
2022-05-09T21:07:13+0200 06P1l80bpO [info] end of setMaintenanceMode()
2022-05-09T21:07:13+0200 06P1l80bpO [info] endStep("7")
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] request to updater
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] currentStep()
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] Step 7 is in state "end".
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] POST request for step "8"
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] startStep("8")
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] replaceEntryPoints()
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] replace index.php
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] replace status.php
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] replace remote.php
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] replace public.php
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] replace ocs/v1.php
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] replace ocs/v2.php
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] end of replaceEntryPoints()
2022-05-09T21:07:13+0200 pqcP5CGgVw [info] endStep("8")
2022-05-09T21:07:13+0200 CP39kkXdwI [info] request to updater
2022-05-09T21:07:13+0200 CP39kkXdwI [info] currentStep()
2022-05-09T21:07:13+0200 CP39kkXdwI [info] Step 8 is in state "end".
2022-05-09T21:07:13+0200 CP39kkXdwI [info] POST request for step "9"
2022-05-09T21:07:14+0200 CP39kkXdwI [info] startStep("9")
2022-05-09T21:07:14+0200 CP39kkXdwI [info] deleteOldFiles()
2022-05-09T21:07:15+0200 CP39kkXdwI [info] config sample exists
2022-05-09T21:07:15+0200 CP39kkXdwI [info] themes README exists
2022-05-09T21:11:52+0200 CP39kkXdwI [info] end of deleteOldFiles()
2022-05-09T21:11:52+0200 CP39kkXdwI [info] endStep("9")

The content of the root folder

$ ls -lah /srv/nextcloud
drwxr-x---  7 www-data www-data 4.0K May  9 21:11 .
drwxr-xr-x 21 root     root     4.0K May  8 00:54 ..
drwxr-x---  7 www-data www-data 4.0K May  9 21:07 apps
drwxr-x---  2 www-data www-data 4.0K May  9 21:07 config
drwxrwx--- 12 www-data www-data  12K May  1 00:00 data
-rw-r--r--  1 www-data www-data   57 May  9 21:07 index.php
-rw-r--r--  1 www-data www-data   57 May  9 21:07 public.php
-rw-r--r--  1 www-data www-data   57 May  9 21:07 remote.php
-rw-r--r--  1 www-data www-data   57 May  9 21:07 status.php
drwxr-x---  2 www-data www-data 4.0K May  9 21:07 themes
drwxr-x---  2 www-data www-data 4.0K May  9 20:57 updater

The output of your Nextcloud log in Admin > Logging: I cannot login (missing .htaccessand Apache error AH01276: Cannot serve directory /srv/nextcloud/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive) so I cannot tell.

The output of your config.php file

$ cat /srv/nextcloud/config/config.php
cat config.php
<?php
$CONFIG = array (
  'updatechecker' => false,
  'instanceid' => '.....',
  'passwordsalt' => '....',
  'secret' => '.....',
  'trusted_domains' =>
  array (
    0 => 'my.host.tld',
    1 => '10.40.1.200',
  ),
  'datadirectory' => '/srv/nextcloud/data',
  'overwrite.cli.url' => 'https://my.host.tld',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
  ),
  'dbtype' => 'mysql',
  'version' => '22.2.7.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '.....',
  'logtimezone' => 'UTC',
  'installed' => true,
  'theme' => '',
  'loglevel' => 0,
  'maintenance' => true,
  'updater.secret' => '...',
);

The output of your Apache log:

AH01276: Cannot serve directory /srv/nextcloud/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive

That’s due to the fact I have no .htaccess in my root folder, and thus index.phpis ignored.

The rest is irrelevant, as it dates back from before the failure and shows no error.

Output errors in nextcloud.log
Not sure that’s relevant, no error show up here, and date back from before the failure

{"reqId":"b79lJN9upsDlCHAtoK9t","level":0,"time":"2022-05-09T18:59:58+00:00","remoteAddr":"10.40.1.130","user":"admin","app":"scss_cacher","method":"GET","url":"/index.php/apps/dashboard/","message":"SCSSCacher::isCached 1dd7-b4d4-icons.css dependencies successfully cached for 5 minutes","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0","version":"22.2.7.1"}
{"reqId":"b79lJN9upsDlCHAtoK9t","level":0,"time":"2022-05-09T18:59:58+00:00","remoteAddr":"10.40.1.130","user":"admin","app":"scss_cacher","method":"GET","url":"/index.php/apps/dashboard/","message":"SCSSCacher::process ordinary check follows","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0","version":"22.2.7.1"}
{"reqId":"b79lJN9upsDlCHAtoK9t","level":0,"time":"2022-05-09T18:59:58+00:00","remoteAddr":"10.40.1.130","user":"admin","app":"scss_cacher","method":"GET","url":"/index.php/apps/dashboard/","message":"SCSSCacher::process ordinary check follows","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0","version":"22.2.7.1"}
{"reqId":"tZt1E8M1EVR3aEsS0SEo","level":1,"time":"2022-05-09T18:59:59+00:00","remoteAddr":"10.40.1.130","user":"admin","app":"no app in context","method":"GET","url":"/index.php/settings/ajax/checksetup","message":"Deprecated event type for OCP\\IDBConnection::CHECK_MISSING_PRIMARY_KEYS: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0","version":"22.2.7.1"}
{"reqId":"tZt1E8M1EVR3aEsS0SEo","level":1,"time":"2022-05-09T19:00:00+00:00","remoteAddr":"10.40.1.130","user":"admin","app":"no app in context","method":"GET","url":"/index.php/settings/ajax/checksetup","message":"Deprecated event type for OCP\\IDBConnection::CHECK_MISSING_INDEXES: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0","version":"22.2.7.1"}
{"reqId":"tZt1E8M1EVR3aEsS0SEo","level":1,"time":"2022-05-09T19:00:01+00:00","remoteAddr":"10.40.1.130","user":"admin","app":"no app in context","method":"GET","url":"/index.php/settings/ajax/checksetup","message":"Deprecated event type for OCP\\IDBConnection::CHECK_MISSING_COLUMNS: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0","version":"22.2.7.1"}
{"reqId":"B0WkziTafFqsycEUUtLj","level":0,"time":"2022-05-09T19:00:14+00:00","remoteAddr":"10.40.1.130","user":"--","app":"files_sharing","method":"GET","url":"/index.php/core/js/oc.js?v=795c398e","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0","version":"22.2.7.1"}
{"reqId":"3htRCmp09wQxMSEXmI7w","level":0,"time":"2022-05-09T19:00:26+00:00","remoteAddr":"","user":"--","app":"files_sharing","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"22.2.7.1"}
{"reqId":"ND3ErJLdpLOxh43ENgGC","level":0,"time":"2022-05-09T19:00:26+00:00","remoteAddr":"10.40.1.130","user":"admin","app":"files_sharing","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0","version":"22.2.7.1"}
{"reqId":"Ib3bFJusabkHAGj123HZ","level":0,"time":"2022-05-09T19:00:38+00:00","remoteAddr":"10.40.1.130","user":"admin","app":"files_sharing","method":"GET","url":"/index.php/apps/updatenotification/credentials","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0","version":"22.2.7.1"}
{"reqId":"6nMg3B38cwVqpOfz9sbX","level":0,"time":"2022-05-09T19:00:39+00:00","remoteAddr":"10.40.1.130","user":"admin","app":"files_sharing","method":"GET","url":"/favicon.ico","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0","version":"22.2.7.1"}

Well, I finally restored a backup I had made myself, and re-attempted the upgrade (via the CLI this time), and it worked.

That’s too bad because I suppose I was closing to completing the upgrade.

  • Is there somewhere some documentation about how to restore from the backup created by the installer (instead of mine, that was much larger and took a longer time to be reverted)?
  • in case an installer step finished without any error in updater.log, is it safe to force proceed with the next step? If so, how to do so?

Thanks!

I ran across this myself and your picture helped me resolve the issue on mine. You show root for … the file listing. Mine had . and … both as root.
I originally ran in the /var/www/nextcloud sub-directory directory
chown -R www-data:www-data *
which fixed the backup issue.
Only after I ran the bottom two commands that the delete issue was resolved.
chown -R www-data:www-data .
chown -R www-data:www-data …

Hope this helps in the future.