Integrity test failure during auto update to 2.3.0

Having trouble installing serendipity?
User avatar
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Integrity test failure during auto update to 2.3.0

Post by wesley » Tue Aug 13, 2019 12:39 am

When updating from 2.1.5 to 2.3.0 via auto update, everything seems to go well until the following errors occur and the process stops:

Code: Select all

Updating failed, because the integrity-test for the following files failed:
* /Library/WebServer/Documents/blog/templates_c/serendipity-2.3.0/serendipity/templates/next/font/fontello.svg
* /Library/WebServer/Documents/blog/templates_c/serendipity-2.3.0/serendipity/templates/2k11/admin/font/fontello.svg
* /Library/WebServer/Documents/blog/templates_c/serendipity-2.3.0/serendipity/bundled-libs/zendframework/zend-db/phpcs.xml
* /Library/WebServer/Documents/blog/templates_c/serendipity-2.3.0/serendipity/bundled-libs/simplepie/simplepie.inc
* /Library/WebServer/Documents/blog/templates_c/serendipity-2.3.0/serendipity/bundled-libs/katzgrau/klogger/phpunit.xml
I went to the templates_c folder and deleted the serendipity-2.3.0 folder and the zip file to force re-download, but the same errors occur even after doing that.

I wonder what's causing this problem.
I make s9y plugins, too.
My s9y blog depends on them. :)

thh
Regular
Posts: 352
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

Re: Integrity test failure during auto update to 2.3.0

Post by thh » Tue Aug 13, 2019 8:24 pm

wesley wrote:
Tue Aug 13, 2019 12:39 am

Code: Select all

Updating failed, because the integrity-test for the following files failed:
* /Library/WebServer/Documents/blog/templates_c/serendipity-2.3.0/serendipity/templates/next/font/fontello.svg
* /Library/WebServer/Documents/blog/templates_c/serendipity-2.3.0/serendipity/templates/2k11/admin/font/fontello.svg
* /Library/WebServer/Documents/blog/templates_c/serendipity-2.3.0/serendipity/bundled-libs/zendframework/zend-db/phpcs.xml
* /Library/WebServer/Documents/blog/templates_c/serendipity-2.3.0/serendipity/bundled-libs/simplepie/simplepie.inc
* /Library/WebServer/Documents/blog/templates_c/serendipity-2.3.0/serendipity/bundled-libs/katzgrau/klogger/phpunit.xml
I had the same problem, but didn't investigate (but installed 2.3.0 manually).
wesley wrote:
Tue Aug 13, 2019 12:39 am
I wonder what's causing this problem.
Obviously, the checksums don't match - I'm not sure why that could be (and only when trying to update using auto-update, but not when uploading the files by hand).

mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany
Contact:

Re: Integrity test failure during auto update to 2.3.0

Post by mattsches » Mon Aug 19, 2019 11:27 pm

I get the same error and have investigated a bit.

The problem seems to be in the file `include/functions_installer.inc.php` lines 1138-1140 (see GitHub).

These three lines have been added two years ago, but seem not to be present in 2.1.* releases.

As a result, .svg, .xml, and .inc files are treated as binary files in 2.1.*, and the md5sum() is created in binary mode, not from the text contents (as in 2.3.0).

But because the checksums are probably created in 2.3.0 using the newest version of the file, thus treating those files as text files, the checksums don't match.

Right now, I can't think of any other solution than manually patching `include/functions_installer.inc.php` before upgrading. Any ideas?

User avatar
erAck
Regular
Posts: 111
Joined: Mon Feb 16, 2015 2:20 am

Re: Integrity test failure during auto update to 2.3.0

Post by erAck » Tue Aug 20, 2019 2:12 am

So the old already installed code seems to be used to verify the checksums of the new files, for which checksums have been correctly created by the new code (just verified for templates/next/font/fontello.svg as a sample). Unfortunate..
Right now, I can't think of any other solution than manually patching `include/functions_installer.inc.php` before upgrading.
Seems best. Just to make sure for whoever comes across this, patch the already installed include/functions_installer.inc.php before upgrading, i.e. add the three lines of the patch or apply it in your Serendipity directory, e.g. with

Code: Select all

curl -f 'https://github.com/s9y/Serendipity/commit/be3df87b975ac843dbbc8d413e6ab82cc2128093.patch' | patch -p1

User avatar
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Re: Integrity test failure during auto update to 2.3.0

Post by wesley » Tue Aug 20, 2019 2:13 am

So one way to go about is that I should try overwriting the ‘include/functions_installer.inc.php’ with the one in 2.3.0 and then attempt automatic upgrade, then?
I make s9y plugins, too.
My s9y blog depends on them. :)

User avatar
erAck
Regular
Posts: 111
Joined: Mon Feb 16, 2015 2:20 am

Re: Integrity test failure during auto update to 2.3.0

Post by erAck » Tue Aug 20, 2019 2:22 am

I wouldn't overwrite the file with the new version, just patch it. The new version may contain other changes as well. (In fact it does, but only one change which probably does not harm, but don't take my word..)

mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany
Contact:

Re: Integrity test failure during auto update to 2.3.0

Post by mattsches » Tue Aug 20, 2019 9:45 am

erAck wrote:
Tue Aug 20, 2019 2:22 am
but only one change which probably does not harm, but don't take my word..)
Someone should probably test and confirm this before anyone runs into trouble (I'm going to give it a try later today, if I can find the time). :wink:

Perhaps another solution might be to first release a version 2.1.6, which would include the corresponding fix to the checksum verification function. But I'm guessing the autoupdate plugin does not work this way? Will have to check the code.

thh
Regular
Posts: 352
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

Re: Integrity test failure during auto update to 2.3.0

Post by thh » Tue Aug 20, 2019 12:05 pm

mattsches wrote:
Tue Aug 20, 2019 9:45 am
Perhaps another solution might be to first release a version 2.1.6, which would include the corresponding fix to the checksum verification function.
2.1.7 that would be, but I don't think that would help as the changed checksum calculation would be used in the release script, too.

The only way to go would be to manually change the checksum in checksums.inc.php after running the release script, but before packaging the release, I think.

User avatar
erAck
Regular
Posts: 111
Joined: Mon Feb 16, 2015 2:20 am

Re: Integrity test failure during auto update to 2.3.0

Post by erAck » Tue Aug 20, 2019 1:09 pm

thh wrote:
Tue Aug 20, 2019 12:05 pm
The only way to go would be to manually change the checksum in checksums.inc.php after running the release script, but before packaging the release, I think.
If the checksums were altered to match the old code then a check after the upgrade using the new code would fail.

mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany
Contact:

Re: Integrity test failure during auto update to 2.3.0

Post by mattsches » Tue Aug 20, 2019 1:27 pm

erAck wrote:
Tue Aug 20, 2019 1:09 pm
thh wrote:
Tue Aug 20, 2019 12:05 pm
The only way to go would be to manually change the checksum in checksums.inc.php after running the release script, but before packaging the release, I think.
If the checksums were altered to match the old code then a check after the upgrade using the new code would fail.
Yes, I think the checksums contained within a release should be consistent.

Another thought: We could patch the `serendipity_event_autoupdate` plugin so that it skips integrity checks when upgrading from 2.1.x to 2.3.x. Or at least give the user the option (e.g. a checkbox) to temporarily disable integrity checks if an upgrade fails for a given reason.

In this case, no manual editing of any files would be required.

thh
Regular
Posts: 352
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

Re: Integrity test failure during auto update to 2.3.0

Post by thh » Tue Aug 20, 2019 5:35 pm

erAck wrote:
Tue Aug 20, 2019 1:09 pm
If the checksums were altered to match the old code then a check after the upgrade using the new code would fail.
Yes, but that would only lead to annoying messages when someone uses the integrity check in the maintenance section and not break the automatic upgrade.

User avatar
erAck
Regular
Posts: 111
Joined: Mon Feb 16, 2015 2:20 am

Re: Integrity test failure during auto update to 2.3.0

Post by erAck » Tue Aug 20, 2019 9:40 pm

True, better fail than fail hard ;-)

mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany
Contact:

Re: Integrity test failure during auto update to 2.3.0

Post by mattsches » Tue Aug 20, 2019 10:14 pm

I've just committed and pushed a patch for `serendipity_event_autoupdate` to my fork on GitHub:

https://github.com/mattsches/additional ... c981faa430

With this, you can skip the integrity checks for one run of the auto updater. The option gets immediately reset after the run. The next time you run the auto updater, everything should work just as before.

What do you think?

User avatar
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Re: Integrity test failure during auto update to 2.3.0

Post by wesley » Thu Aug 22, 2019 2:44 am

The new version of the autoupdater let me skip the integrity check once and the s9y installation was upgraded from 2.1.5 to 2.3.1 without a hitch. Thank you for everyone’s help!
I make s9y plugins, too.
My s9y blog depends on them. :)

mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 10:35 pm
Location: Wiesbaden, Germany
Contact:

Re: Integrity test failure during auto update to 2.3.0

Post by mattsches » Thu Aug 22, 2019 10:20 am

wesley wrote:
Thu Aug 22, 2019 2:44 am
The new version of the autoupdater let me skip the integrity check once and the s9y installation was upgraded from 2.1.5 to 2.3.1 without a hitch. Thank you for everyone’s help!
Thank you for reporting the issue in the first place, wesley!

And thanks to everyone who contributed ideas and input. Great to hear it works.

(We're currently discussing further improvement of the autoupdater which will hopefully remove the need to skip the checks in the future.)

Post Reply