Page MenuHomePhabricator

PHP Deprecated: Deprecated cross-wiki access to MediaWiki\User\UserIdentityValue. Expected: the local wiki, Actual: 'enwiki'. Pass expected $wikiId. [Called from MediaWiki\User\UserIdentityValue::getId]
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Deprecated: Deprecated cross-wiki access to MediaWiki\User\UserIdentityValue. Expected: the local wiki, Actual: 'enwiki'. Pass expected $wikiId. [Called from MediaWiki\User\UserIdentityValue::getId]
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.12/includes/user/UserIdentityValue.php(146)
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, string, array)
#1 /srv/mediawiki/php-1.37.0-wmf.12/includes/debug/MWDebug.php(376): trigger_error(string, integer)
#2 /srv/mediawiki/php-1.37.0-wmf.12/includes/debug/MWDebug.php(352): MWDebug::sendRawDeprecated(string, boolean, string)
#3 /srv/mediawiki/php-1.37.0-wmf.12/includes/GlobalFunctions.php(1030): MWDebug::deprecatedMsg(string, string, string, integer)
#4 /srv/mediawiki/php-1.37.0-wmf.12/includes/dao/WikiAwareEntityTrait.php(78): wfDeprecatedMsg(string, string)
#5 /srv/mediawiki/php-1.37.0-wmf.12/includes/user/UserIdentityValue.php(146): MediaWiki\User\UserIdentityValue->deprecateInvalidCrossWiki(boolean, string)
#6 /srv/mediawiki/php-1.37.0-wmf.12/includes/user/UserFactory.php(177): MediaWiki\User\UserIdentityValue->getId()
#7 /srv/mediawiki/php-1.37.0-wmf.12/includes/block/BlockUtils.php(86): MediaWiki\User\UserFactory->newFromUserIdentity(MediaWiki\User\UserIdentityValue)
#8 /srv/mediawiki/php-1.37.0-wmf.12/includes/block/AbstractBlock.php(446): MediaWiki\Block\BlockUtils->parseBlockTarget(MediaWiki\User\UserIdentityValue)
#9 /srv/mediawiki/php-1.37.0-wmf.12/includes/block/AbstractBlock.php(103): MediaWiki\Block\AbstractBlock->setTarget(MediaWiki\User\UserIdentityValue)
#10 /srv/mediawiki/php-1.37.0-wmf.12/includes/block/DatabaseBlock.php(103): MediaWiki\Block\AbstractBlock->__construct(array)
#11 /srv/mediawiki/php-1.37.0-wmf.12/extensions/CentralAuth/includes/CentralAuthUser.php(1947): MediaWiki\Block\DatabaseBlock->__construct(array)
#12 /srv/mediawiki/php-1.37.0-wmf.12/extensions/CentralAuth/includes/CentralAuthUser.php(1881): CentralAuthUser->doLocalSuppression(boolean, string, string, string)
#13 /srv/mediawiki/php-1.37.0-wmf.12/extensions/CentralAuth/includes/CentralAuthUser.php(1859): CentralAuthUser->doCrosswikiSuppression(boolean, string, string)
#14 /srv/mediawiki/php-1.37.0-wmf.12/extensions/CentralAuth/includes/CentralAuthUser.php(1810): CentralAuthUser->suppress(string, string)
#15 /srv/mediawiki/php-1.37.0-wmf.12/extensions/CentralAuth/includes/specials/SpecialCentralAuth.php(245): CentralAuthUser->adminLockHide(boolean, string, string, RequestContext)
#16 /srv/mediawiki/php-1.37.0-wmf.12/extensions/CentralAuth/includes/specials/SpecialCentralAuth.php(143): SpecialCentralAuth->doSubmit()
#17 /srv/mediawiki/php-1.37.0-wmf.12/includes/specialpage/SpecialPage.php(646): SpecialCentralAuth->execute(NULL)
#18 /srv/mediawiki/php-1.37.0-wmf.12/includes/specialpage/SpecialPageFactory.php(1362): SpecialPage->run(NULL)
#19 /srv/mediawiki/php-1.37.0-wmf.12/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#20 /srv/mediawiki/php-1.37.0-wmf.12/includes/MediaWiki.php(917): MediaWiki->performRequest()
#21 /srv/mediawiki/php-1.37.0-wmf.12/includes/MediaWiki.php(551): MediaWiki->main()
#22 /srv/mediawiki/php-1.37.0-wmf.12/index.php(53): MediaWiki->run()
#23 /srv/mediawiki/php-1.37.0-wmf.12/index.php(46): wfIndexMain()
#24 /srv/mediawiki/w/index.php(3): require(string)
#25 {main}
Impact

Unclear.

Notes

Low volume but persistent. Happening since at least 1.37.0-wmf.9

Event Timeline

This looks very similar to T277687 and T281972.

Krinkle subscribed.

Per policy, unexpected hard deprecations in production block the next train by default.

DannyS712 triaged this task as Unbreak Now! priority.Jul 13 2021, 2:25 AM
DannyS712 subscribed.

Train blocker

Pchelolo lowered the priority of this task from Unbreak Now! to Medium.Jul 13 2021, 2:26 AM
Pchelolo subscribed.

It's a next train blocker. So, 'Unbreak in a week' is a proper priority :)

This is yet another instance of cross-wiki blocking having issues, but in this case BlockUtils::parseBlockTarget returns User even though it doesn't need the result to be User, UserIdentity is enough. Since it's a cross-wiki block and we now emit deprecation warnings when cross-wiki User objects are created - this happens.

Need to make BlockUtils::parseBlockTarget just return UserIdentity - a few places where this class is used are all in core and most of them are totally satisfied with UserIdentity.

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

[mediawiki/core@master] Convert BlockUtils::parseBlockTarget to UserIdentity

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

dancy raised the priority of this task from Medium to Unbreak Now!.Jul 20 2021, 7:31 PM

Status changed to UBN since this is blocking this week's train now.

The patch is under review for this, and it is pretty close to being done - needs last round of updates by @Zabe However, this is a deprecation warning with a fix that is more risky then the problem. Definitely too risky to backport.

I propose to bump this one more train and make it a blocker for the next train - that will be safer. There's no user impact, and back porting can actually break things for real. Sorry we didn't manage to merge it in time.

Change 704868 merged by jenkins-bot:

[mediawiki/core@master] Convert BlockUtils::parseBlockTarget to UserIdentity

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

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

[mediawiki/core@wmf/1.37.0-wmf.15] Convert BlockUtils::parseBlockTarget to UserIdentity

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

Change 705758 abandoned by Hashar:

[mediawiki/core@wmf/1.37.0-wmf.15] Convert BlockUtils::parseBlockTarget to UserIdentity

Reason:

Thanks !

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

I was clueless and proposed a backport. I had missed Piotr comment:

However, this is a deprecation warning with a fix that is more risky then the problem. Definitely too risky to backport.

Pchelolo lowered the priority of this task from Unbreak Now! to Medium.Jul 22 2021, 2:15 AM

I don't think this is a blocker anymore, as the patch was merged to master last week?

This should be fixed. Could someone with logstash access check?

This specific one was fixed. There's a new one, but it was also already fixed by https://gerrit.wikimedia.org/r/c/mediawiki/core/+/705769