Upgrade failed / fix "installed: false" state

Dear community,

I’d like to kindly ask you for your help. When I used the web-based upgrade process to upgrade my Nextcloud 20.0.9 installation to version 20.0.14, the upgrade failed, because the disk was full. After fixing the storage problem, I am facing the problem that my NextCloud instance is now in “not installed” state:

www-data@nextcloud:~/nextcloud$ php occ status
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Nextcloud is not installed - only a limited number of commands are available

  • installed: false
  • version: 20.0.14.2
  • versionstring: 20.0.14
  • edition:

The web interface says I need to create the file “config/CAN_INSTALL”, but when I do so, NextCloud wants to re-install and then fails because of existing data.

How can I fix that? I want to keep my existing config.php, data, and MariaDB database.

Maybe the following section of data/updater.log helps to understand what went wrong:

2022-01-05T10:42:57+0100 7KyVGdZjNB [info] request to updater
2022-01-05T10:42:57+0100 7KyVGdZjNB [info] currentStep()
2022-01-05T10:42:57+0100 7KyVGdZjNB [info] show HTML page
2022-01-05T10:42:57+0100 7KyVGdZjNB [info] current version: 20.0.9 build time: 2021-04-08T13:25:59+00:00 7022222ac25f9ac1f0f9ad8e5219b3854e71156a
2022-01-05T10:42:57+0100 7KyVGdZjNB [info] getUpdateServerResponse()
2022-01-05T10:42:57+0100 7KyVGdZjNB [info] updaterServer: https://updates.nextcloud.com/updater_server/
2022-01-05T10:42:57+0100 7KyVGdZjNB [info] releaseChannel: stable
2022-01-05T10:42:57+0100 7KyVGdZjNB [info] internal version: 20.0.9.1
2022-01-05T10:42:57+0100 7KyVGdZjNB [info] updateURL: https://updates.nextcloud.com/updater_server/?version=20x0x9x1xxxstablexx2021-04-08T13%3A25%3A59%2B00%3A00+7022222ac25f9ac1f0f9ad8e5219b3854e71156ax7x3x31
2022-01-05T10:42:57+0100 7KyVGdZjNB [info] getUpdateServerResponse response: Array
(
    [version] => 20.0.14.2
    [versionstring] => Nextcloud 20.0.14
    [url] => https://download.nextcloud.com/server/releases/nextcloud-20.0.14.zip
    [web] => https://docs.nextcloud.com/server/20/admin_manual/maintenance/upgrade.html
    [changes] => https://updates.nextcloud.com/changelog_server/?version=20.0.14
    [autoupdater] => 1
    [eol] => 1
    [signature] => ie2H7/drKls2RxE5aS50ocGeXIBiAlczHvhCeObYF21s0qQtx0mGJe6TUvA8diQ5
T3ZiZwRLQT2BH6GKHbOt6ku6RRSTILhglffUAv3CellNrYmkyAl1ob6/4H5/XHjC
DgQ6Ykglk7xvQICw2l7s4tfa8KNIWLdPuWfUvXBBDsXKtFEmv8d0SU+f/dQR6JKu
uLzb1cmunoldyvH/qC4XdKx1r/JqPEaQxW7l3WQeXaLCA2OiLxIBcHH6ucNJ4ik6
fZCxpy3szm7gaozWquGfD+oglIY7GLVsbeZBTDFgF44OcDAY/29AL3TKRKN+cnQr
6feVFe2PlZ2FK5zxWZNYfw==
)

2022-01-05T10:42:57+0100 7KyVGdZjNB [info] checkForUpdate() Array
(
    [version] => 20.0.14.2
    [versionstring] => Nextcloud 20.0.14
    [url] => https://download.nextcloud.com/server/releases/nextcloud-20.0.14.zip
    [web] => https://docs.nextcloud.com/server/20/admin_manual/maintenance/upgrade.html
    [changes] => https://updates.nextcloud.com/changelog_server/?version=20.0.14
    [autoupdater] => 1
    [eol] => 1
    [signature] => ie2H7/drKls2RxE5aS50ocGeXIBiAlczHvhCeObYF21s0qQtx0mGJe6TUvA8diQ5
T3ZiZwRLQT2BH6GKHbOt6ku6RRSTILhglffUAv3CellNrYmkyAl1ob6/4H5/XHjC
DgQ6Ykglk7xvQICw2l7s4tfa8KNIWLdPuWfUvXBBDsXKtFEmv8d0SU+f/dQR6JKu
uLzb1cmunoldyvH/qC4XdKx1r/JqPEaQxW7l3WQeXaLCA2OiLxIBcHH6ucNJ4ik6
fZCxpy3szm7gaozWquGfD+oglIY7GLVsbeZBTDFgF44OcDAY/29AL3TKRKN+cnQr
6feVFe2PlZ2FK5zxWZNYfw==
)

2022-01-05T10:42:57+0100 7KyVGdZjNB [info] getChangelogURL()
2022-01-05T10:42:57+0100 7KyVGdZjNB [info] end of checkForUpdate() Update to Nextcloud 20.0.14 available. (channel: "stable")<br /><span class="light">Following file will be downloaded automatically:</span> <code class="light">https://download.nextcloud.com/server/releases/nextcloud-20.0.14.zip</code><br /><a class="external_link" href="https://nextcloud.com/changelog/#20-0-14" target="_blank" rel="noreferrer noopener">Open changelog ↗</a>
2022-01-05T10:43:02+0100 2dBQu0oBZU [info] request to updater
2022-01-05T10:43:02+0100 2dBQu0oBZU [info] currentStep()
2022-01-05T10:43:02+0100 2dBQu0oBZU [info] POST request for step "1"
2022-01-05T10:43:02+0100 2dBQu0oBZU [info] startStep("1")
2022-01-05T10:43:02+0100 2dBQu0oBZU [info] checkForExpectedFilesAndFolders()
2022-01-05T10:43:02+0100 2dBQu0oBZU [info] end of checkForExpectedFilesAndFolders()
2022-01-05T10:43:02+0100 2dBQu0oBZU [info] endStep("1")
2022-01-05T10:43:02+0100 ZrUIWr2v65 [info] request to updater
2022-01-05T10:43:02+0100 ZrUIWr2v65 [info] currentStep()
2022-01-05T10:43:02+0100 ZrUIWr2v65 [info] Step 1 is in state "end".
2022-01-05T10:43:02+0100 ZrUIWr2v65 [info] POST request for step "2"
2022-01-05T10:43:02+0100 ZrUIWr2v65 [info] startStep("2")
2022-01-05T10:43:02+0100 ZrUIWr2v65 [info] checkWritePermissions()
2022-01-05T10:43:02+0100 ZrUIWr2v65 [info] end of checkWritePermissions()
2022-01-05T10:43:02+0100 ZrUIWr2v65 [info] endStep("2")
2022-01-05T10:43:02+0100 S7Nbv40z6F [info] request to updater
2022-01-05T10:43:02+0100 S7Nbv40z6F [info] currentStep()
2022-01-05T10:43:02+0100 S7Nbv40z6F [info] Step 2 is in state "end".
2022-01-05T10:43:02+0100 S7Nbv40z6F [info] POST request for step "3"
2022-01-05T10:43:02+0100 S7Nbv40z6F [info] startStep("3")
2022-01-05T10:43:02+0100 S7Nbv40z6F [info] createBackup()
2022-01-05T10:43:02+0100 S7Nbv40z6F [info] backup folder location: /var/www/nextcloud/data/updater-oc28wb5l14lu/backups/nextcloud-20.0.9.1-1641375782/
2022-01-05T10:43:14+0100 S7Nbv40z6F [error] POST request failed with other exception
2022-01-05T10:43:14+0100 S7Nbv40z6F [error] Exception: Exception
Message: Could not copy "/var/www/nextcloud/apps/password_policy/lists/list-9.php" to "/var/www/nextcloud/data/updater-oc28wb5l14lu/backups/nextcloud-20.0.9.1-1641375782/apps/password_policy/lists/list-9.php"
Code:0
Trace:
#0 /var/www/nextcloud/updater/index.php(1367): Updater->createBackup()
#1 {main}
File:/var/www/nextcloud/updater/index.php
Line:553

2022-01-05T10:43:14+0100 S7Nbv40z6F [info] rollbackChanges("3")
2022-01-05T10:43:14+0100 S7Nbv40z6F [info] unlink .step
2022-01-05T10:43:14+0100 S7Nbv40z6F [info] end of  rollbackChanges()
2022-01-05T10:43:37+0100 HlmswSZLqQ [info] request to updater
2022-01-05T10:43:37+0100 HlmswSZLqQ [info] currentStep()
2022-01-05T10:43:37+0100 HlmswSZLqQ [info] POST request for step "3"
2022-01-05T10:43:37+0100 HlmswSZLqQ [info] startStep("3")
2022-01-05T10:43:37+0100 HlmswSZLqQ [error] POST request failed with other exception
2022-01-05T10:43:37+0100 HlmswSZLqQ [error] Exception: Exception
Message: Could not write to .step
Code:0
Trace:
#0 /var/www/nextcloud/updater/index.php(1154): Updater->writeStep('start', 3)
#1 /var/www/nextcloud/updater/index.php(1358): Updater->startStep(3)
#2 {main}
File:/var/www/nextcloud/updater/index.php
Line:1144

2022-01-05T10:43:37+0100 HlmswSZLqQ [info] rollbackChanges("3")
2022-01-05T10:43:37+0100 HlmswSZLqQ [info] unlink .step
2022-01-05T10:43:37+0100 HlmswSZLqQ [info] end of  rollbackChanges()

I was able to solve the problem by overwriting /var/www/nextcloud by the latest backup in /var/www/nextcloud/data/updater-oc28wb5l14lu/backups/nextcloud-20.0.9.1-1641375782.

After that, I could perform the usual upgrade via the web updater.