Page MenuHomePhabricator

MCR broke Undelete action (and made Cognate tests fail) "The given Title does not belong to page ID"
Closed, ResolvedPublicPRODUCTION ERROR

Description

Running the Cognate tests I get:

1) Cognate\Tests\CognateIntegrationTest::testCreateDeleteAndRestorePageResultsInEntry
InvalidArgumentException: The given Title does not belong to page ID 2 but actually belongs to 4

includes/Storage/RevisionStoreRecord.php:99
includes/Storage/RevisionStore.php:586
includes/Storage/RevisionStore.php:476
includes/libs/rdbms/database/Database.php:3731
includes/Storage/RevisionStore.php:478
includes/page/PageArchive.php:776
includes/page/PageArchive.php:506
extensions/Cognate/tests/phpunit/CognateIntegrationTest.php:97
tests/phpunit/MediaWikiTestCase.php:469
maintenance/doMaintenance.php:94

Found locally with SQLite as a backend and the experimental CI job quibble-vendor-mysql-php70-docker fails similarly (eg on https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Cognate/+/447052/ ).

Reproducible on a dummy change https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Cognate/+/442292/

Event Timeline

Might have been a change in mediawiki/core
hashar renamed this task from Cognate integration test fails: The given Title does not belong to page ID 2 but actually belongs to 4 to MCR causes Cognate integration test fails: The given Title does not belong to page ID 2 but actually belongs to 4.Jul 20 2018, 11:03 AM

git bisect points at mediawiki/core commit 4943c74ac42f5019a6d567fa31513f8422769dd7

Author: daniel <daniel.kinzler@wikimedia.de>
Date:   Fri Apr 13 14:01:18 2018 +0200

    [MCR] Make PageArchive aware of MCR
    
    Bug: T194015
    Change-Id: I92afda87961860983f080d96fa0616a6fcca64e4

That is https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/426009/ for T194015

So I guess Cognate needs to support the MCR aware PageArchive, or maybe that highlight an issue in PageArchive itself.

Change 447405 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] PageArchive: Pass correct overrides to newRevisionFromArchiveRow()

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

Change 447453 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/extensions/Cognate@master] (DO NOT SUBMIT) Test change for T200072

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

Change 447636 had a related patch set uploaded (by Ladsgroup; owner: Anomie):
[mediawiki/core@wmf/1.32.0-wmf.13] PageArchive: Pass correct overrides to newRevisionFromArchiveRow()

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

Change 447637 had a related patch set uploaded (by Ladsgroup; owner: Anomie):
[mediawiki/core@wmf/1.32.0-wmf.14] PageArchive: Pass correct overrides to newRevisionFromArchiveRow()

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

Change 447405 merged by jenkins-bot:
[mediawiki/core@master] PageArchive: Pass correct overrides to newRevisionFromArchiveRow()

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

Change 447636 merged by jenkins-bot:
[mediawiki/core@wmf/1.32.0-wmf.13] PageArchive: Pass correct overrides to newRevisionFromArchiveRow()

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

Mentioned in SAL (#wikimedia-operations) [2018-07-24T16:42:45Z] <ladsgroup@deploy1001> Synchronized php-1.32.0-wmf.13/includes/page/PageArchive.php: [[gerrit:447636|PageArchive: Pass correct overrides to newRevisionFromArchiveRow() (T200072)]] (duration: 01m 03s)

Change 447637 merged by jenkins-bot:
[mediawiki/core@wmf/1.32.0-wmf.14] PageArchive: Pass correct overrides to newRevisionFromArchiveRow()

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

According to conversation with @Anomie in #mediawiki-core, this is no longer blocking the train.

Mentioned in SAL (#wikimedia-operations) [2018-07-24T17:06:55Z] <ladsgroup@deploy1001> Synchronized php-1.32.0-wmf.14/includes/page/PageArchive.php: [[gerrit:447636|PageArchive: Pass correct overrides to newRevisionFromArchiveRow() (T200072)]] (duration: 01m 01s)

greg lowered the priority of this task from Unbreak Now! to High.Jul 24 2018, 6:15 PM

Letting others close this task but I'm reducing priority as it's no longer blocking.

Anomie claimed this task.
Krinkle renamed this task from MCR causes Cognate integration test fails: The given Title does not belong to page ID 2 but actually belongs to 4 to MCR broke Undelete action (and made Cognate tests fail) "The given Title does not belong to page ID".Jul 24 2018, 9:26 PM
Krinkle awarded a token.

Change 447453 abandoned by Hashar:
(DO NOT SUBMIT) Test change for T200072

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

Hi, it is the same problem? It was really solved?

[362c56c77e9ab3f7765f21f1] /index.php?title=Especial:Busca&profile=all&search=namespace&fulltext=1 InvalidArgumentException from line 100 of /var/www/dev-quali/html/includes/Revision/RevisionStoreRecord.php: The given Title does not belong to page ID 130 but actually belongs to 16

Backtrace:

#0 /var/www/dev-quali/html/includes/Revision/RevisionStore.php(1823): MediaWiki\Revision\RevisionStoreRecord->__construct(Title, User, CommentStoreComment, stdClass, MediaWiki\Revision\RevisionSlots, boolean)
#mw1.34.0-wmf.17 
....

@Krauss can you post the rest of the backtrace? As it is, I can't tell whether it's the same problem or not.

Also, the link you posted doesn't seem to have anything to do with undeletion. Did the error occur immediately after undeletion? Then it might be the same issue.

Hi @daniel , thanks the fast reply (!). Explain context and copy/paste complete dump:

Context: It is a "closed" corporative Mediawiki (no way to use URL here). I changed my LocalSettings.php adding some namespaces, editing, and changing namespaces again, and editing again... So perhaps I generated a "bug data", but after run php maintenance/update.php; php maintenance/rebuildall.php no bug-fix.

Dump: The error is produced only when I do a search by word that is into a article of the problematic namespace, using "search all". Complete DUMP:

[de46e97d75b91e37d7ff6d45] /index.php?title=Especial:Busca&profile=all&search=namespace&fulltext=1 InvalidArgumentException from line 100 of /var/www/dev-quali/html/includes/Revision/RevisionStoreRecord.php: The given Title does not belong to page ID 130 but actually belongs to 16

Backtrace:

#0 /var/www/dev-quali/html/includes/Revision/RevisionStore.php(1823): MediaWiki\Revision\RevisionStoreRecord->__construct(Title, User, CommentStoreComment, stdClass, MediaWiki\Revision\RevisionSlots, boolean)
#1 /var/www/dev-quali/html/includes/Revision/RevisionStore.php(2156): MediaWiki\Revision\RevisionStore->newRevisionFromRow(stdClass, integer, Title)
#2 /var/www/dev-quali/html/includes/Revision/RevisionStore.php(1534): MediaWiki\Revision\RevisionStore->loadRevisionFromConds(Wikimedia\Rdbms\DBConnRef, array, integer, Title)
#3 /var/www/dev-quali/html/includes/Revision.php(138): MediaWiki\Revision\RevisionStore->getRevisionByTitle(Title, boolean, integer)
#4 /var/www/dev-quali/html/includes/search/SearchResult.php(93): Revision::newFromTitle(Title, boolean, integer)
#5 /var/www/dev-quali/html/includes/search/SearchResult.php(74): SearchResult->initFromTitle(Title)
#6 /var/www/dev-quali/html/includes/search/SqlSearchResultSet.php(45): SearchResult::newFromTitle(Title, SqlSearchResultSet)
#7 /var/www/dev-quali/html/includes/search/SearchResultSet.php(110): SqlSearchResultSet->extractResults()
#8 /var/www/dev-quali/html/includes/search/SearchResultSet.php(264): SearchResultSet->count()
#9 /var/www/dev-quali/html/includes/search/SearchEngine.php(183): SearchResultSet->shrink(integer)
#10 /var/www/dev-quali/html/includes/search/SearchEngine.php(84): SearchEngine->maybePaginate(Closure)
#11 /var/www/dev-quali/html/includes/specials/SpecialSearch.php(348): SearchEngine->searchText(string)
#12 /var/www/dev-quali/html/includes/specials/SpecialSearch.php(173): SpecialSearch->showResults(string)
#13 /var/www/dev-quali/html/includes/specialpage/SpecialPage.php(569): SpecialSearch->execute(NULL)
#14 /var/www/dev-quali/html/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#15 /var/www/dev-quali/html/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#16 /var/www/dev-quali/html/includes/MediaWiki.php(865): MediaWiki->performRequest()
#17 /var/www/dev-quali/html/includes/MediaWiki.php(515): MediaWiki->main()
#18 /var/www/dev-quali/html/index.php(42): MediaWiki->run()
#19 {main}

Context: It is a "closed" corporative Mediawiki (no way to use URL here). I changed my LocalSettings.php adding some namespaces, editing, and changing namespaces again, and editing again... So perhaps I generated a "bug data", but after run php maintenance/update.php; php maintenance/rebuildall.php no bug-fix.

At a glance, this does seem to be a bug, but not the one described in this ticket, which specifically happened while undeleting a page. Please file a new ticket, and tag the Platform Engineering. That should get it lined up for review. Please copy the info you gave here to the new ticket.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:09 PM