Page MenuHomePhabricator

1.29.0-alpha / Template failed integrity check on "EnhancedChangesListGroup.mustache" in TemplateParser.php
Closed, ResolvedPublic

Description

MediaWiki 1.29.0-alpha (9526073)
PHP 7.1.1 (apache2handler)
MariaDB 10.1.21-MariaDB
ICU 57.1

Accessing the Special:RecentChanges outputs a Template failed integrity check: ...\includes/templates/EnhancedChangesListGroup.mustache in <b>...\includes\TemplateParser.php on line 116.

Line 112-116:

$keyedHash = substr( $code, 0, 64 );
$code = substr( $code, 64 );
if ( $keyedHash !== hash_hmac( 'sha256', $code, $secretKey ) ) {
	// Generate a notice if integrity check fails
	trigger_error( "Template failed integrity check: {$filename}" );
}

Event Timeline

This might be expected, if the file or the version of LightNCandy changes… I don't really know how this works.

Assuming you recently upgraded, can you run update.php and see if the issue persists? That should clear caches and stuff.

Assuming you recently upgraded, can you run update.php

I did so and just run it again but the result is the same.

This might be expected, if the file or the version of LightNCandy changes… I don't really know how this works.

Neither do I but it is super annoying as one can see in [0].

[0] https://cloud.githubusercontent.com/assets/1245473/25131034/46ba64c2-247f-11e7-94bd-8e28f422b444.png

jmatazzoni added a subscriber: jmatazzoni.

@Catrope, just pining you in case this is something we need to jump on.

Given the following message [0], are we going to address (which implicitly means solve) this with 1.29?

[0] https://lists.wikimedia.org/pipermail/wikitech-l/2017-April/088019.html

Krinkle triaged this task as High priority.Apr 26 2017, 9:49 PM
Krinkle added a project: MW-1.29-release.
Legoktm added a subscriber: Legoktm.

The bug appears to be that even if the cache is corrupt, we don't invalidate the cache so the error gets triggered over and over again. The cache failing integrity checks could happen if the cache is truncating or secret key changes. Showing an error doesn't seem that useful IMO. Working on a patch.

Also there's another problem that because a new TemplateParser instance is created every time EnhancedChangesList processes a group, the instance caching is broken.

Change 354065 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/core@master] TemplateParser: Improve cache integrity check failure scenario

https://gerrit.wikimedia.org/r/354065

Change 354065 merged by jenkins-bot:
[mediawiki/core@master] TemplateParser: Improve cache integrity check failure scenario

https://gerrit.wikimedia.org/r/354065

Change 354437 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/core@REL1_29] TemplateParser: Improve cache integrity check failure scenario

https://gerrit.wikimedia.org/r/354437

Change 354437 merged by jenkins-bot:
[mediawiki/core@REL1_29] TemplateParser: Improve cache integrity check failure scenario

https://gerrit.wikimedia.org/r/354437