owncloud / updater

GNU Affero General Public License v3.0
27 stars 20 forks source link

Using web updater to update from 10.14 to 10.15 breaks the integrity check #749

Open janmz opened 3 months ago

janmz commented 3 months ago

After doing an automatic update through the admin panel in owncloud the integrity check fails on the updater folder (see below). Please fix the reason and provide a new update of owncloud with the corrected updater. Thanx in advance.

Technical information

The following list covers which files have failed the integrity check. Please read the previous linked documentation to learn more about the errors and how to fix them.

Results

Raw output

Array ( [core] => Array ( [INVALID_HASH] => Array ( [updater/CHANGELOG.md] => Array ( [expected] => 8c02ccafe8a447d606d0afc665fa44afe4714eb1e55e213c94732a501fdb4daf8625756cd2707064151df7dd29e99a52c6284377be21cf88b879dc6a6f830e4a [current] => ec6bc1fbea93c62366109c056cce06bb4755e886a215cd1ad3acafbc0024b3d96a3820bf1f355ff28c9f12a18978e751b727c8bedaaa0f1164bdcbbb9d9b1c12

phil-davis commented 3 months ago

@jnweiger is there something about the way the latest updater app was included in the 10.15 release that would cause this?

jnweiger commented 3 months ago

@janmz thanks for opening this issue. I wasn't aware that this could happen.

It is atually a problem with the web udater. It can update core, and then looks into all apps, and checks for updates. The updater itself is also an app, but it is special. It does not have an appinfo/info.xml so it does not show up when listing apps. The web updater cannot update the updater app!

ec6bc1fbea93c62366109c056cce06bb4755e886a215cd1ad3acafbc0024b3d96a3820bf1f355ff28c9f12a18978e751b727c8bedaaa0f1164bdcbbb9d9b1c12 is the correct checksum of the updater/CHANGELOG.md as bundled with 10.14.0

8c02ccafe8a447d606d0afc665fa44afe4714eb1e55e213c94732a501fdb4daf8625756cd2707064151df7dd29e99a52c6284377be21cf88b879dc6a6f830e4a is the correct checksum of the updater/CHANGELOG.md as bundled with 10.15.0

The situation you have, is that the update via web updater went fine as far as core itself (and most apps) is concerned, but the updater app remained as is. Now occ integrity:check-core also covers the updater app (maybe it should not...? ) and complains.

You can fix the situation in multiple ways. E.g. by manually updating the updater app, e.g. like this:

cd /var/www/owncloud
rm -rf updater
curl -L https://github.com/owncloud/updater/releases/download/v1.1.1/updater-v1.1.1.tar.gz | tar zxvf -
chown -R www-data. updater
occ integrity:check-core

Documentation at e.g. https://doc.owncloud.com/server/10.14/admin_manual/maintenance/upgrading/upgrade.html#upgrade-options explains that the web updater button in the admin UI only works for simple cases.

jnweiger commented 3 months ago

All of

curl -L 'http://updates.owncloud.com/server/?version=10x10x1x0x5x6xstablexxd' returns the first one of the above. The zip gets downloaded and unpacked in https://github.com/owncloud/updater/blob/master/src/Command/ExecuteCoreUpgradeScriptsCommand.php#137

            foreach ($rootDirContent as $dir) {
                if ($dir === 'updater') {
                    continue;
                }
                /* @phan-suppress-next-line PhanUndeclaredMethod */
                $this->getApplication()->getLogger()->debug('Replacing ' . $dir);
                $fsHelper->tripleMove($oldSourcesDir, $newSourcesDir, $tmpDir, $dir);
            }

Which obviously excludes the updater itself. This may help to not disturb the running updater code, but then, there is nothing that would "later" update the updater, or ask the user to manually update the updater.

I'd assume we just never implemented that case.

janmz commented 3 months ago

Thank You for the quick identification of the problem and the proposed workaround. But it would be great, if the web updater would be able to update itself or at give an indication, that a manual update step has to be taken...

DefCon-CC commented 3 months ago

Workaround from @jnweiger did the Job for me.