Page MenuHomePhabricator

Special:Investigate: Wikimedia\Assert\PreconditionException: Expected MediaWiki\User\UserIdentityValue to belong to 'afwiki', but it belongs to the local wiki
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Get CU rights on test.wikipedia.org
  • Load Special:Investigate
  • Run a check
  • Switch to the "Account information" tab

What happens?:
An internal error is raised and no data is displayed.

exception.trace
from /srv/mediawiki/php-1.41.0-wmf.19/includes/dao/WikiAwareEntityTrait.php(59)
#0 /srv/mediawiki/php-1.41.0-wmf.19/includes/user/UserGroupManager.php(718): MediaWiki\User\UserIdentityValue->assertWiki(string)
#1 /srv/mediawiki/php-1.41.0-wmf.19/includes/user/UserGroupManager.php(703): MediaWiki\User\UserGroupManager->getUserGroupMemberships(MediaWiki\User\UserIdentityValue, integer)
#2 /srv/mediawiki/php-1.41.0-wmf.19/extensions/CheckUser/src/Investigate/Services/PreliminaryCheckService.php(179): MediaWiki\User\UserGroupManager->getUserGroups(MediaWiki\User\UserIdentityValue)
#3 /srv/mediawiki/php-1.41.0-wmf.19/extensions/CheckUser/src/Investigate/Services/PreliminaryCheckService.php(133): MediaWiki\CheckUser\Investigate\Services\PreliminaryCheckService->getAdditionalLocalData(stdClass, string)
#4 /srv/mediawiki/php-1.41.0-wmf.19/extensions/CheckUser/src/Investigate/Pagers/PreliminaryCheckPager.php(258): MediaWiki\CheckUser\Investigate\Services\PreliminaryCheckService->preprocessResults(Wikimedia\Rdbms\MysqliResultWrapper)
#5 /srv/mediawiki/php-1.41.0-wmf.19/includes/pager/IndexPager.php(291): MediaWiki\CheckUser\Investigate\Pagers\PreliminaryCheckPager->preprocessResults(Wikimedia\Rdbms\MysqliResultWrapper)
#6 /srv/mediawiki/php-1.41.0-wmf.19/includes/pager/IndexPager.php(733): IndexPager->doQuery()
#7 /srv/mediawiki/php-1.41.0-wmf.19/extensions/CheckUser/src/Investigate/SpecialInvestigate.php(342): IndexPager->getNumRows()
#8 /srv/mediawiki/php-1.41.0-wmf.19/extensions/CheckUser/src/Investigate/SpecialInvestigate.php(205): MediaWiki\CheckUser\Investigate\SpecialInvestigate->addTabContent(string)
#9 /srv/mediawiki/php-1.41.0-wmf.19/includes/specialpage/SpecialPage.php(701): MediaWiki\CheckUser\Investigate\SpecialInvestigate->execute(string)
#10 /srv/mediawiki/php-1.41.0-wmf.19/includes/specialpage/SpecialPageFactory.php(1565): SpecialPage->run(string)
#11 /srv/mediawiki/php-1.41.0-wmf.19/includes/MediaWiki.php(344): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#12 /srv/mediawiki/php-1.41.0-wmf.19/includes/MediaWiki.php(948): MediaWiki->performRequest()
#13 /srv/mediawiki/php-1.41.0-wmf.19/includes/MediaWiki.php(597): MediaWiki->main()
#14 /srv/mediawiki/php-1.41.0-wmf.19/index.php(50): MediaWiki->run()
#15 /srv/mediawiki/php-1.41.0-wmf.19/index.php(46): wfIndexMain()
#16 /srv/mediawiki/w/index.php(3): require(string)
#17 {main}
normalized_message
	[{reqId}] {exception_url}   Wikimedia\Assert\PreconditionException: Expected MediaWiki\User\UserIdentityValue to belong to 'afwiki', but it belongs to the local wiki

What should have happened instead?:
The account information tab should have shown as expected.

Software version (skip for WMF-hosted wikis like Wikipedia):
1.41.0-wmf.19

Other information (browser name/version, screenshots, etc.):

Screenshot 2023-07-25 at 15-01-03 Internal error - Test Wikipedia.png (1×1 px, 285 KB)

Event Timeline

Change 941430 had a related patch set uploaded (by Zabe; author: Zabe):

[mediawiki/extensions/CheckUser@master] Create UserIdentityValue with correct wiki

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

To test this you would need a multi-wiki instance. Therefore, I would suggest this not be tested on local instances and a test to ensure this is properly fixed occur using the same steps I followed to get this issue on https://test.wikipedia.org.

Change 941430 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Create UserIdentityValue with correct wiki

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

Change 941498 had a related patch set uploaded (by Zabe; author: Zabe):

[mediawiki/extensions/CheckUser@wmf/1.41.0-wmf.19] Create UserIdentityValue with correct wiki

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

Change 941499 had a related patch set uploaded (by Zabe; author: Zabe):

[mediawiki/extensions/CheckUser@wmf/1.41.0-wmf.18] Create UserIdentityValue with correct wiki

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

Change 941499 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@wmf/1.41.0-wmf.18] Create UserIdentityValue with correct wiki

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

Change 941498 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@wmf/1.41.0-wmf.19] Create UserIdentityValue with correct wiki

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

Mentioned in SAL (#wikimedia-operations) [2023-07-25T21:08:19Z] <zabe@deploy1002> Started scap: Backport for [[gerrit:941498|Create UserIdentityValue with correct wiki (T342655)]], [[gerrit:941499|Create UserIdentityValue with correct wiki (T342655)]]

Mentioned in SAL (#wikimedia-operations) [2023-07-25T21:10:01Z] <zabe@deploy1002> zabe: Backport for [[gerrit:941498|Create UserIdentityValue with correct wiki (T342655)]], [[gerrit:941499|Create UserIdentityValue with correct wiki (T342655)]] synced to the testservers mwdebug2001.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug1002.eqiad.wmnet, mwdebug2002.codfw.wmnet, and mw-debug kubernetes deployment (accessible via k8s-experimental XWD option)

Mentioned in SAL (#wikimedia-operations) [2023-07-25T21:18:26Z] <zabe@deploy1002> Finished scap: Backport for [[gerrit:941498|Create UserIdentityValue with correct wiki (T342655)]], [[gerrit:941499|Create UserIdentityValue with correct wiki (T342655)]] (duration: 10m 06s)

The error is no longer reproducible in production with the patch applied.

Bildschirmfoto vom 2023-07-25 23-12-25.png (820×1 px, 130 KB)