Update fails after CLI Update

Nextcloud version: 19.0.3
Operating system and version: Ubuntu 18.04. (LXD Container)
Apache or nginx version: Apache/2.4.29
PHP version: 7.4.11

Hi!

A few weeks ago I updated my Nextcloud first time over CLI. (Started in Web and after the “Keep maintenance mode active?” question I proceeded further via CLI.)
Since then I can no longer update.

In the Webinterface every Bulletpoint has a Hook.
If I’m going to “Continue Update” it skipped direcetly to “Done”.

If I’m using the manual way I got the most time 500er.
Once Nextcloud was running but the new Dashboard wasn’t loading and was only white.

Do you have a idea what could be brooken?

If I need more details, logs, etc. I will pass them on.

You mean that you used the occ upgrade command to execute the upgrade? You can also run the complete upgrade routine from command line with the updater/updater.phar.

I’d first check with the occ-command if there is already new code and the upgrade process did perhaps not finish proplery. After that, if everything is ok and you can use your cloud, I’d try to upgrade further. And do a backup before in case something goes wrong.

1 Like

Hi,
thanks for the reply!

Did it:

root@nextcloud:~# sudo -u www-data php /var/www/nextcloud/occ upgrade
Nextcloud is already latest version
root@nextcloud:~# 
root@nextcloud:/var/www/nextcloud# sudo -u www-data php updater/updater.phar 
Nextcloud Updater - version: v18.0.6-11-g50bdca3 dirty

Current version is 19.0.3.

Update to Nextcloud 19.0.4 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-19.0.4.zip
Open changelog ↗

Steps that will be executed:
[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[✔] Extracting
[✔] Enable maintenance mode
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done

Continue 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
[✔] Enable maintenance mode
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done

Update of code successful.

Should the "occ upgrade" command be executed? [Y/n] Y
Nextcloud is already latest version

Keep maintenance mode active? [y/N] N
Maintenance mode already disabled

Maintenance mode is disabled
root@nextcloud:/var/www/nextcloud# 

Same effect like the Web Usage Updater.

No data Changed:

root@nextcloud:/var/www/nextcloud# find /home/data/ -mmin -10 
/home/data/appdata_oczg2te0zsft/text/documents
/home/data/appdata_oczg2te0zsft/text/documents/17283
/home/data/updater.log
root@nextcloud:/var/www/nextcloud# find /var/www/nextcloud/ -mmin -10 
root@nextcloud:/var/www/nextcloud# 

Logs:

updater.log:
2020-10-29T23:32:37+0000 2RCxh55XU6 [info] updater cli is executed
2020-10-29T23:32:37+0000 2RCxh55XU6 [info] currentStep()
2020-10-29T23:32:37+0000 2RCxh55XU6 [info] Step 12 is in state "end".
2020-10-29T23:32:37+0000 2RCxh55XU6 [info] current version: 19.0.3 build time: 2020-09-09T11:44:22+00:00 02a6cac39ddd619b2a0710e3fba703f3d72ee13d
2020-10-29T23:32:37+0000 2RCxh55XU6 [info] getUpdateServerResponse()
2020-10-29T23:32:37+0000 2RCxh55XU6 [info] updaterServer: https://updates.nextcloud.com/updater_server/
2020-10-29T23:32:37+0000 2RCxh55XU6 [info] releaseChannel: stable
2020-10-29T23:32:37+0000 2RCxh55XU6 [info] internal version: 19.0.3.1
2020-10-29T23:32:37+0000 2RCxh55XU6 [info] updateURL: https://updates.nextcloud.com/updater_server/?version=19x0x3x1xxxstablexx2020-09-09T11%3A44%3A22%2B00%3A00+02a6cac39ddd619b2a0710e3fba703f3d72ee13dx7x4x11
2020-10-29T23:32:37+0000 2RCxh55XU6 [info] getUpdateServerResponse response: Array
(
    [version] => 19.0.4.2
    [versionstring] => Nextcloud 19.0.4
    [url] => https://download.nextcloud.com/server/releases/nextcloud-19.0.4.zip
    [web] => https://docs.nextcloud.com/server/19/admin_manual/maintenance/upgrade.html
    [changes] => https://updates.nextcloud.com/changelog_server/?version=19.0.4
    [autoupdater] => 1
    [eol] => 0
    [signature] => rg3l/a/fYyVG36nM1Vraz+0tafxvHovk+KzkZ+9k2v3/EGg7zumk3e1vX84gA9Au
RlE/aDbwKPrhdVe/+xRTd/1sy7YFbCH65l+8xpR6eSFoD4UkvthhlqvAiJHd7aRO
5u5XvcheGrXhYKB/BrGG1GhwaAQO2yOj+VoJs+x/UpFoxpl0ASIfeAE3Ba976A17
5jSpP1elccbumj2tNvgTXHridsLru+d+xwk6li7uNkfg37CDAbZxiIRGfNZQpBhM
zqIvA2UAN28aKaAqc4Pq9DAwwchRl8PqX6+LvK2DiuMaMmYKSJOOBIpAMg6JEEeq
Ljf4wARZVM9Euc0jRwgGvg==
)

2020-10-29T23:32:37+0000 2RCxh55XU6 [info] checkForUpdate() Array
(
    [version] => 19.0.4.2
    [versionstring] => Nextcloud 19.0.4
    [url] => https://download.nextcloud.com/server/releases/nextcloud-19.0.4.zip
    [web] => https://docs.nextcloud.com/server/19/admin_manual/maintenance/upgrade.html
    [changes] => https://updates.nextcloud.com/changelog_server/?version=19.0.4
    [autoupdater] => 1
    [eol] => 0
    [signature] => rg3l/a/fYyVG36nM1Vraz+0tafxvHovk+KzkZ+9k2v3/EGg7zumk3e1vX84gA9Au
RlE/aDbwKPrhdVe/+xRTd/1sy7YFbCH65l+8xpR6eSFoD4UkvthhlqvAiJHd7aRO
5u5XvcheGrXhYKB/BrGG1GhwaAQO2yOj+VoJs+x/UpFoxpl0ASIfeAE3Ba976A17
5jSpP1elccbumj2tNvgTXHridsLru+d+xwk6li7uNkfg37CDAbZxiIRGfNZQpBhM
zqIvA2UAN28aKaAqc4Pq9DAwwchRl8PqX6+LvK2DiuMaMmYKSJOOBIpAMg6JEEeq
Ljf4wARZVM9Euc0jRwgGvg==
)

2020-10-29T23:32:37+0000 2RCxh55XU6 [info] getChangelogURL()
2020-10-29T23:32:37+0000 2RCxh55XU6 [info] end of checkForUpdate() Update to Nextcloud 19.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-19.0.4.zip</code><br /><a class="external_link" href="https://nextcloud.com/changelog/#19-0-4" target="_blank" rel="noreferrer noopener">Open changelog ↗</a>
2020-10-29T23:32:39+0000 2RCxh55XU6 [info] updater started
2020-10-29T23:32:39+0000 2RCxh55XU6 [info] update of code successful.
2020-10-29T23:32:43+0000 2RCxh55XU6 [info] maintenance mode is disabled - return code: 0

I suspect that the extraction preserves the changing dates of the files. And since the version was released, the files weren’t changed which is more than 10 minutes. The version in your config/config.php is 19.0.4, as well in the web-interface? And you don’t have file integrity errors, then you are on 19.0.4.

The Version:

root@nextcloud:~# grep 'version' /var/www/nextcloud/config/config.php 
  'version' => '19.0.3.1',
root@nextcloud:~# 

Integrity-Check:

root@nextcloud:~# sudo -u www-data php /var/www/nextcloud/occ integrity:check-core 
  - INVALID_HASH:
    - .htaccess:
      - expected: 49b882eed84d95bc41965468746c9183a665b02a0a7e4814dd2c74930f8da878aa9d845a3735c0cbe472c01ded4005c3d46cf83fb5bf80bb351d226c7fa78ffe
      - current: 0edf950f12229d73cf5a636862149a154aac387404e47a0f5965adc7e06406450027e3c26fe68d587fe70b493b1bfe4fea046b958e0d2b88ce01a1cb32403e8e
root@nextcloud:~# 

Currently I still assume that nothing has been changed. :confused:

And what is in your version.php?

root@nextcloud:~# cat /var/www/nextcloud/version.php 
<?php 
$OC_Version = array(19,0,3,1);
$OC_VersionString = '19.0.3';
$OC_Edition = '';
$OC_Channel = 'stable';
$OC_VersionCanBeUpgradedFrom = array (
  'nextcloud' => 
  array (
    '18.0' => true,
    '19.0' => true,
  ),
  'owncloud' => 
  array (
  ),
);
$OC_Build = '2020-09-09T11:44:22+00:00 02a6cac39ddd619b2a0710e3fba703f3d72ee13d';
$vendor = 'nextcloud';
root@nextcloud:~# 

That is strange, there was no error on the update. If you start the update script again, it says again to update to Version 19.0.4?

Yes:

root@nextcloud:/var/www/nextcloud# date
Sat Oct 31 14:20:26 CET 2020
root@nextcloud:/var/www/nextcloud# sudo -u www-data php updater/updater.phar
Nextcloud Updater - version: v18.0.6-11-g50bdca3 dirty

Current version is 19.0.3.

Update to Nextcloud 19.0.4 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-19.0.4.zip
Open changelog ↗

Steps that will be executed:
[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[✔] Extracting
[✔] Enable maintenance mode
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done

Continue 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
[✔] Enable maintenance mode
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done

Update of code successful.

Should the "occ upgrade" command be executed? [Y/n] Y
Nextcloud is already latest version

Keep maintenance mode active? [y/N] N
Maintenance mode already disabled

Maintenance mode is disabled
root@nextcloud:/var/www/nextcloud# sudo -u www-data php /var/www/nextcloud/occ upgrade
Nextcloud is already latest version
root@nextcloud:/var/www/nextcloud# 

Did nc has other places where the Version is saved?

In your datafolder, there is usually an updater-… folder where the new version is downloaded. Perhaps some paths wrong, so it is extracted to a different location?

There are no changes since over 40 Days:

root@nextcloud:/home/data# find updater-* -mtime -42 | head -2
updater-oczg2te0zsft
updater-oczg2te0zsft/backups
root@nextcloud:/home/data# find updater-* -mtime -41 | head -2
root@nextcloud:/home/data# 

At the 19. Sep was the last update.

The points after Steps that will be executed: are instantly through.
While script start and first question tcpdump captured only 50 packets.

After run the repair: maintenance:repair
I could sucessfully update over the Web-Updater and updater/updater.phar