Page MenuHomePhabricator

userrights-interwiki fails with server error
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
  • service.version: 1.47.0-wmf.3
  • timestamp: 2026-05-20T10:02:15.379Z
  • labels.phpversion: 8.3.30
  • trace.id: c7eb9a12-2bcb-43b5-bb0c-f4d01f72c4ac
  • Find trace.id in Logstash
labels.normalized_message
[{reqId}] {exception_url}   Wikimedia\Assert\PreconditionException: Expected MediaWiki\User\UserIdentityValue to belong to the local wiki, but it belongs to 'testwiki'
FrameLocationCall
from/srv/mediawiki/php-1.47.0-wmf.3/includes/DAO/WikiAwareEntityTrait.php(45)
#0/srv/mediawiki/php-1.47.0-wmf.3/includes/User/UserIdentityValue.php(99)MediaWiki\User\UserIdentityValue->assertWiki(bool)
#1/srv/mediawiki/php-1.47.0-wmf.3/includes/User/UserFactory.php(174)MediaWiki\User\UserIdentityValue->getId()
#2/srv/mediawiki/php-1.47.0-wmf.3/includes/User/User.php(695)MediaWiki\User\UserFactory->newFromUserIdentity(MediaWiki\User\UserIdentityValue)
#3/srv/mediawiki/php-1.47.0-wmf.3/includes/User/UserGroupManager.php(417)MediaWiki\User\User::newFromIdentity(MediaWiki\User\UserIdentityValue)
#4/srv/mediawiki/php-1.47.0-wmf.3/includes/User/UserGroupManager.php(247)MediaWiki\User\UserGroupManager->getUserAutopromoteGroups(MediaWiki\User\UserIdentityValue)
#5/srv/mediawiki/php-1.47.0-wmf.3/includes/User/UserGroupManager.php(297)MediaWiki\User\UserGroupManager->getUserImplicitGroups(MediaWiki\User\UserIdentityValue, int, bool)
#6/srv/mediawiki/php-1.47.0-wmf.3/extensions/EventBus/includes/HookHandlers/MediaWiki/UserChangeHooks.php(302)MediaWiki\User\UserGroupManager->getUserEffectiveGroups(MediaWiki\User\UserIdentityValue)
#7/srv/mediawiki/php-1.47.0-wmf.3/extensions/EventBus/includes/HookHandlers/MediaWiki/UserChangeHooks.php(260)MediaWiki\Extension\EventBus\HookHandlers\MediaWiki\UserChangeHooks->calculateUserEffectiveGroups(MediaWiki\User\UserIdentityValue, array)
#8/srv/mediawiki/php-1.47.0-wmf.3/includes/HookContainer/HookContainer.php(127)MediaWiki\Extension\EventBus\HookHandlers\MediaWiki\UserChangeHooks->onUserGroupsChanged(MediaWiki\User\UserIdentityValue, array, array, MediaWiki\User\User, string, array, array)
#9/srv/mediawiki/php-1.47.0-wmf.3/includes/HookContainer/HookRunner.php(4876)MediaWiki\HookContainer\HookContainer->run(string, array)
#10/srv/mediawiki/php-1.47.0-wmf.3/includes/User/UserGroupAssignmentService.php(250)MediaWiki\HookContainer\HookRunner->onUserGroupsChanged(MediaWiki\User\UserIdentityValue, array, array, MediaWiki\User\User, string, array, array)
#11/srv/mediawiki/php-1.47.0-wmf.3/includes/Specials/SpecialUserRights.php(285)MediaWiki\User\UserGroupAssignmentService->saveChangesToUserGroups(MediaWiki\User\User, MediaWiki\User\UserIdentityValue, array, array, array, string)
#12/srv/mediawiki/php-1.47.0-wmf.3/includes/Specials/SpecialUserRights.php(147)MediaWiki\Specials\SpecialUserRights->saveUserGroups(string, MediaWiki\User\UserIdentityValue)
#13/srv/mediawiki/php-1.47.0-wmf.3/includes/SpecialPage/SpecialPage.php(727)MediaWiki\Specials\SpecialUserRights->execute(null)
#14/srv/mediawiki/php-1.47.0-wmf.3/includes/SpecialPage/SpecialPageFactory.php(1730)MediaWiki\SpecialPage\SpecialPage->run(null)
#15/srv/mediawiki/php-1.47.0-wmf.3/includes/Actions/ActionEntryPoint.php(505)MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#16/srv/mediawiki/php-1.47.0-wmf.3/includes/Actions/ActionEntryPoint.php(145)MediaWiki\Actions\ActionEntryPoint->performRequest()
#17/srv/mediawiki/php-1.47.0-wmf.3/includes/MediaWikiEntryPoint.php(180)MediaWiki\Actions\ActionEntryPoint->execute()
#18/srv/mediawiki/php-1.47.0-wmf.3/index.php(44)MediaWiki\MediaWikiEntryPoint->run()
#19/srv/mediawiki/w/index.php(3)require(string)
#20{main}
Impact
Notes

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

What happens?:
Immediate failure with error:
[c7eb9a12-2bcb-43b5-bb0c-f4d01f72c4ac] 2026-05-20 10:02:15: Fatal exception of type "Wikimedia\Assert\PreconditionException"

What should have happened instead?:
Change should work. Any actual errors should be caught and presented usefully.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
WMF Production

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

Event Timeline

Restricted Application changed the subtype of this task from "Bug Report" to "Production Error". · View Herald TranscriptWed, May 20, 10:04 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
taavi set Request URL to https://meta.wikimedia.org/wiki/Special:UserRights.Wed, May 20, 10:07 AM
taavi updated the task description. (Show Details)
taavi added a project: Event-Platform.
Urbanecm_WMF raised the priority of this task from High to Unbreak Now!.Wed, May 20, 10:10 AM
Urbanecm_WMF added subscribers: hashar, Urbanecm_WMF.

This is a critical bug, as it means the Stewards cannot hide personally identifying information from the wikis.

@hashar @Aklapper IMO, this warrants rolling train back to group0.

Not limited to webui, api same fail:

{

"error": {
    "code": "internal_api_error_Wikimedia\\Assert\\PreconditionException",
    "info": "[12d6c3ae-9ba9-4be0-82b5-3e3af84798ee] Caught exception of type Wikimedia\\Assert\\PreconditionException",
    "errorclass": "Wikimedia\\Assert\\PreconditionException"
},
"servedby": "mw-api-ext.eqiad.main-859698f88f-bwwlk"

}

Change #1289918 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/core@master] Fix UserGroupManager::getUserAutopromoteGroups with interwiki users

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

Change #1289928 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/core@wmf/1.47.0-wmf.3] Fix UserGroupManager::getUserAutopromoteGroups with interwiki users

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

Change #1289918 merged by jenkins-bot:

[mediawiki/core@master] Fix UserGroupManager::getUserAutopromoteGroups with interwiki users

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

It is probably unrelated, this morning I have filed a task about group permissions T426820.

Change #1289928 merged by jenkins-bot:

[mediawiki/core@wmf/1.47.0-wmf.3] Fix UserGroupManager::getUserAutopromoteGroups with interwiki users

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

Mentioned in SAL (#wikimedia-operations) [2026-05-20T11:51:34Z] <mszwarc@deploy1003> Started scap sync-world: Backport for [[gerrit:1289928|Fix UserGroupManager::getUserAutopromoteGroups with interwiki users (T426832)]]

Mentioned in SAL (#wikimedia-operations) [2026-05-20T11:53:32Z] <mszwarc@deploy1003> mszwarc: Backport for [[gerrit:1289928|Fix UserGroupManager::getUserAutopromoteGroups with interwiki users (T426832)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-05-20T11:58:38Z] <mszwarc@deploy1003> Finished scap sync-world: Backport for [[gerrit:1289928|Fix UserGroupManager::getUserAutopromoteGroups with interwiki users (T426832)]] (duration: 07m 04s)

Fix deployed. Let's wait for confirmation that the issue is gone in prod

This issue is still occurring in production

[b247c032-6181-4a96-851f-5fb39a961c8f] 2026-05-20 12:02:25: Fatal exception of type "Wikimedia\Assert\PreconditionException"

This issue is still occurring in production

[b247c032-6181-4a96-851f-5fb39a961c8f] 2026-05-20 12:02:25: Fatal exception of type "Wikimedia\Assert\PreconditionException"

Thanks for confirmation. Apparently, there are more places in UserGroupManager where UserIdentity is converted to User without checking if it makes sense

Change #1289941 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/core@master] Fix newFromUserIdentity calls with interwiki users

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

Change #1289980 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/core@wmf/1.47.0-wmf.3] Fix newFromUserIdentity calls with interwiki users

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

Change #1289941 merged by jenkins-bot:

[mediawiki/core@master] Fix newFromUserIdentity calls with interwiki users

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

This is a critical bug, as it means the Stewards cannot hide personally identifying information from the wikis.

@hashar @Aklapper IMO, this warrants rolling train back to group0.

Not sure if I get it right: Because we cannot change local userrights (in case I understood the bug report correctly), we couldn't assign ourselves local oversighter rights, for example? Couldn't we just add (temporarily) suppressrevision to the global stewards group? Case by case, or as a temporary default. — Or is this broken, too?

Not sure if I get it right: Because we cannot change local userrights (in case I understood the bug report correctly), we couldn't assign ourselves local oversighter rights, for example? Couldn't we just add (temporarily) suppressrevision to the global stewards group? Case by case, or as a temporary default. — Or is this broken, too?

Technically, that would be a solution. However, it would result in hard-to-read logs (so far, the fact a suppression happened is public at Special:Log/rights at meta, and that is a deliberate feature). What I meant here is basically "it blocks the regular suppression workflow". In my opinion, that is sufficient for considering this a blocker. Hope this clarifies.

Change #1289980 merged by jenkins-bot:

[mediawiki/core@wmf/1.47.0-wmf.3] Fix newFromUserIdentity calls with interwiki users

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

Mentioned in SAL (#wikimedia-operations) [2026-05-20T16:00:49Z] <urbanecm@deploy1003> Started scap sync-world: Backport for [[gerrit:1289980|Fix newFromUserIdentity calls with interwiki users (T426832)]]

Mentioned in SAL (#wikimedia-operations) [2026-05-20T16:02:54Z] <urbanecm@deploy1003> urbanecm, mszwarc: Backport for [[gerrit:1289980|Fix newFromUserIdentity calls with interwiki users (T426832)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-05-20T16:10:02Z] <urbanecm@deploy1003> Finished scap sync-world: Backport for [[gerrit:1289980|Fix newFromUserIdentity calls with interwiki users (T426832)]] (duration: 09m 12s)

FYI: Just tried and PASSED against the original user story in production.

FYI: Just tried and PASSED against the original user story in production.

Thanks for confirming!