Page MenuHomePhabricator

PHP Deprecated: $wgUser reassignment detected [Called from MediaWiki\Extension\CentralAuth\Special\SpecialCentralLogin::execute]
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Deprecated: $wgUser reassignment detected [Called from MediaWiki\Extension\CentralAuth\Special\SpecialCentralLogin::execute]
exception.trace
from /srv/mediawiki/php-1.38.0-wmf.1/extensions/CentralAuth/includes/Special/SpecialCentralLogin.php(77)
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, string, array)
#1 /srv/mediawiki/php-1.38.0-wmf.1/includes/debug/MWDebug.php(375): trigger_error(string, integer)
#2 /srv/mediawiki/php-1.38.0-wmf.1/includes/debug/MWDebug.php(351): MWDebug::sendRawDeprecated(string, boolean, string)
#3 /srv/mediawiki/php-1.38.0-wmf.1/includes/GlobalFunctions.php(1030): MWDebug::deprecatedMsg(string, string, string, integer)
#4 /srv/mediawiki/php-1.38.0-wmf.1/includes/StubGlobalUser.php(145): wfDeprecatedMsg(string, string, boolean, integer)
#5 /srv/mediawiki/php-1.38.0-wmf.1/extensions/CentralAuth/includes/Special/SpecialCentralLogin.php(294): StubGlobalUser->__destruct()
#6 /srv/mediawiki/php-1.38.0-wmf.1/extensions/CentralAuth/includes/Special/SpecialCentralLogin.php(77): MediaWiki\Extension\CentralAuth\Special\SpecialCentralLogin->doLoginComplete(string)
#7 /srv/mediawiki/php-1.38.0-wmf.1/includes/specialpage/SpecialPage.php(647): MediaWiki\Extension\CentralAuth\Special\SpecialCentralLogin->execute(string)
#8 /srv/mediawiki/php-1.38.0-wmf.1/includes/specialpage/SpecialPageFactory.php(1367): SpecialPage->run(string)
#9 /srv/mediawiki/php-1.38.0-wmf.1/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#10 /srv/mediawiki/php-1.38.0-wmf.1/includes/MediaWiki.php(925): MediaWiki->performRequest()
#11 /srv/mediawiki/php-1.38.0-wmf.1/includes/MediaWiki.php(559): MediaWiki->main()
#12 /srv/mediawiki/php-1.38.0-wmf.1/index.php(53): MediaWiki->run()
#13 /srv/mediawiki/php-1.38.0-wmf.1/index.php(46): wfIndexMain()
#14 /srv/mediawiki/w/index.php(3): require(string)
#15 {main}
Impact

One instance of the error was spotted within minutes of 1.38.0-wmf.1 group0 promotion.

Notes

Possibly related to risky patch noted in T281165#7362605.

Event Timeline

Pchelolo lowered the priority of this task from Unbreak Now! to High.Sep 21 2021, 7:21 PM
Pchelolo added a subscriber: Pchelolo.

Deprecation === not a UBN, but still fairly high since we want to emit these deprecations in 1.37.

Not surprising we got some. This specific deprecation is interesting - if it was in core, we'd use StubGlobalUser::setUser here, but we want it to be @internal. Maybe we still can?

Deprecation === not a UBN, but still fairly high since we want to emit these deprecations in 1.37.

Not surprising we got some. This specific deprecation is interesting - if it was in core, we'd use StubGlobalUser::setUser here, but we want it to be @internal. Maybe we still can?

I forget - the reason I was planning to have StubGlobalUser::setUser() be available to extensions was in part because CentralAuth wants to change $wgUser and not change it back - lets use StubGlobalUser::setUser() for now, in a few weeks we'll be dropping $wgUser entirely so its just for a little bit. The fix should be backported to 1.37

Change 722464 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/extensions/CentralAuth@master] Use StubGlobalUser::setUser() to bypass deprecation warnings

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

DannyS712 changed the task status from Open to In Progress.Sep 21 2021, 8:42 PM
DannyS712 claimed this task.

Change 722713 had a related patch set uploaded (by Majavah; author: DannyS712):

[mediawiki/extensions/CentralAuth@REL1_37] Avoid $wgUser deprecation warnings

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

Change 722464 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] Avoid $wgUser deprecation warnings

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

Change 722713 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@REL1_37] Avoid $wgUser deprecation warnings

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

Change 722896 had a related patch set uploaded (by Dduvall; author: DannyS712):

[mediawiki/extensions/CentralAuth@wmf/1.38.0-wmf.1] Avoid $wgUser deprecation warnings

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

Change 722896 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@wmf/1.38.0-wmf.1] Avoid $wgUser deprecation warnings

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

Mentioned in SAL (#wikimedia-operations) [2021-09-22T19:11:00Z] <dduvall@deploy1002> Synchronized php-1.38.0-wmf.1/extensions/CentralAuth: Backport: [[gerrit:722896|Avoid $wgUser deprecation warnings (T291515)]] (duration: 01m 06s)

in a few weeks we'll be dropping $wgUser entirely so its just for a little bit. The fix should be backported to 1.37

I've backported/deployed the patch for 1.38.0-wmf.1 and haven't seen any deprecation warnings since. Can we close this task or would you like to retain it (move it to next week's train) to track the removal of the workaround?

in a few weeks we'll be dropping $wgUser entirely so its just for a little bit. The fix should be backported to 1.37

I've backported/deployed the patch for 1.38.0-wmf.1 and haven't seen any deprecation warnings since. Can we close this task or would you like to retain it (move it to next week's train) to track the removal of the workaround?

No need to keep open, removals will be done separately later - its not going to be removed this week. I'm planning on waiting to remove $wgUser until after 1.37 is fully released.

Thanks! I'll move it back to 1.38.0-wmf.1 for posterity.