Page MenuHomePhabricator

Special:Contributions for IP ranges fails with InvalidArgumentException , due to CentralAuth
Closed, ResolvedPublicBUG REPORT

Description

Special:Contributions can't be accessed for IP ranges, fails with InvalidArgumentException if the users accessing the special page has the block permission.

Compare https://www.mediawiki.org/wiki/Special:Contributions/::1/64 / https://www.mediawiki.org/wiki/Special:Contributions/127.0.0.1/24 to https://en.wikipedia.org/wiki/Special:Contributions/::1/64 / https://en.wikipedia.org/wiki/Special:Contributions/127.0.0.1/24

2024-02-21 15:22:33.853467 [4c4e4dc3-78be-4a3c-a527-b6c041d59c6b] mw-web.eqiad.main-58dcdb56f6-7d2sd mediawikiwiki 1.42.0-wmf.19 exception ERROR: [4c4e4dc3-78be-4a3c-a527-b6c041d59c6b] /wiki/Special:Contributions/::1/64   InvalidArgumentException: Invalid username: 0:0:0:0:0:0:0:0/64 {"exception_url":"/wiki/Special:Contributions/::1/64","reqId":"4c4e4dc3-78be-4a3c-a527-b6c041d59c6b","caught_by":"entrypoint"}
[Exception InvalidArgumentException] (/srv/mediawiki/php-1.42.0-wmf.19/extensions/CentralAuth/includes/User/CentralAuthUser.php:253) Invalid username: 0:0:0:0:0:0:0:0/64
  #0 /srv/mediawiki/php-1.42.0-wmf.19/extensions/CentralAuth/includes/User/CentralAuthUser.php(230): MediaWiki\Extension\CentralAuth\User\CentralAuthUser::getInstanceByName(string)
  #1 /srv/mediawiki/php-1.42.0-wmf.19/extensions/CentralAuth/includes/CentralAuthHooks.php(446): MediaWiki\Extension\CentralAuth\User\CentralAuthUser::getInstance(MediaWiki\User\User)
  #2 /srv/mediawiki/php-1.42.0-wmf.19/includes/HookContainer/HookContainer.php(159): MediaWiki\Extension\CentralAuth\CentralAuthHooks->onGetUserBlock(MediaWiki\User\User, NULL, NULL)
  #3 /srv/mediawiki/php-1.42.0-wmf.19/includes/HookContainer/HookRunner.php(1968): MediaWiki\HookContainer\HookContainer->run(string, array)
  #4 /srv/mediawiki/php-1.42.0-wmf.19/includes/block/BlockManager.php(247): MediaWiki\HookContainer\HookRunner->onGetUserBlock(MediaWiki\User\User, NULL, NULL)
  #5 /srv/mediawiki/php-1.42.0-wmf.19/includes/user/User.php(1461): MediaWiki\Block\BlockManager->getBlock(MediaWiki\User\User, NULL, boolean)
  #6 /srv/mediawiki/php-1.42.0-wmf.19/includes/specials/SpecialContributions.php(586): MediaWiki\User\User->getBlock()
  #7 /srv/mediawiki/php-1.42.0-wmf.19/includes/specials/SpecialContributions.php(444): MediaWiki\Specials\SpecialContributions::getUserLinks(MediaWiki\Specials\SpecialContributions, MediaWiki\User\User, MediaWiki\Permissions\PermissionManager, MediaWiki\HookContainer\HookRunner)
  #8 /srv/mediawiki/php-1.42.0-wmf.19/includes/specials/SpecialContributions.php(220): MediaWiki\Specials\SpecialContributions->contributionsSub(MediaWiki\User\User, string)
  #9 /srv/mediawiki/php-1.42.0-wmf.19/includes/specialpage/SpecialPage.php(720): MediaWiki\Specials\SpecialContributions->execute(string)
  #10 /srv/mediawiki/php-1.42.0-wmf.19/includes/specialpage/SpecialPageFactory.php(1653): MediaWiki\SpecialPage\SpecialPage->run(string)
  #11 /srv/mediawiki/php-1.42.0-wmf.19/includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
  #12 /srv/mediawiki/php-1.42.0-wmf.19/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
  #13 /srv/mediawiki/php-1.42.0-wmf.19/includes/MediaWikiEntryPoint.php(199): MediaWiki\Actions\ActionEntryPoint->execute()
  #14 /srv/mediawiki/php-1.42.0-wmf.19/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
  #15 /srv/mediawiki/w/index.php(3): require(string)
  #16 {main}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
hoo triaged this task as Unbreak Now! priority.Feb 21 2024, 3:27 PM
hoo renamed this task from Special:Contributions for IP ranges fails with InvalidArgumentException to Special:Contributions for IP ranges fails with InvalidArgumentException, due to CentralAuth.Feb 21 2024, 3:29 PM

Change 1005547 had a related patch set uploaded (by Hoo man; author: Hoo man):

[mediawiki/extensions/CentralAuth@master] CentralAuthHooks::onGetUserBlock: Only run for reg. users

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

hoo lowered the priority of this task from Unbreak Now! to High.Feb 21 2024, 3:44 PM

I just found out that this happens only if the viewer has advanced permission to see hidden accounts. Will update the description.

I just found out that this happens only if the viewer has advanced permission to see hidden accounts. Will update the description.

Is this still a blocker for the train?

I just found out that this happens only if the viewer has advanced permission to see hidden accounts. Will update the description.

Is this still a blocker for the train?

I'm inclined to say so, yes.

Even though I don't have any data backing this up, (global) administrators and stewards probably use this (= looking at contributions for a range) a lot. Also while there is a partial workaround (logged out/ private mode), I don't think it is immediately obvious.

thcipriani raised the priority of this task from High to Unbreak Now!.Feb 21 2024, 6:24 PM
thcipriani subscribed.

I just found out that this happens only if the viewer has advanced permission to see hidden accounts. Will update the description.

Is this still a blocker for the train?

I'm inclined to say so, yes.

Even though I don't have any data backing this up, (global) administrators and stewards probably use this (= looking at contributions for a range) a lot. Also while there is a partial workaround (logged out/ private mode), I don't think it is immediately obvious.

Leaving at UBN! then since that's the priority for blockers. Thanks for confirming.

Change 1005547 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] CentralAuthHooks::onGetUserBlock: Only run for reg. users

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

Change 1005481 had a related patch set uploaded (by Bartosz Dziewoński; author: Hoo man):

[mediawiki/extensions/CentralAuth@wmf/1.42.0-wmf.19] CentralAuthHooks::onGetUserBlock: Only run for reg. users

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

Change 1005481 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@wmf/1.42.0-wmf.19] CentralAuthHooks::onGetUserBlock: Only run for reg. users

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

Mentioned in SAL (#wikimedia-operations) [2024-02-21T19:57:14Z] <jhuneidi@deploy2002> Started scap: Backport for [[gerrit:1005481|CentralAuthHooks::onGetUserBlock: Only run for reg. users (T358112)]]

Mentioned in SAL (#wikimedia-operations) [2024-02-21T19:58:45Z] <jhuneidi@deploy2002> jhuneidi and matmarex: Backport for [[gerrit:1005481|CentralAuthHooks::onGetUserBlock: Only run for reg. users (T358112)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-02-21T20:11:23Z] <jhuneidi@deploy2002> Finished scap: Backport for [[gerrit:1005481|CentralAuthHooks::onGetUserBlock: Only run for reg. users (T358112)]] (duration: 14m 09s)

matmarex assigned this task to hoo.
VolkanUral89 renamed this task from Special:Contributions for IP ranges fails with InvalidArgumentException, due to CentralAuth to Special:Contributions for IP ranges fails with InvalidArgumentException , due to CentralAuth volkankaos .Feb 23 2024, 5:35 PM
VolkanUral89 reopened this task as Open.
taavi renamed this task from Special:Contributions for IP ranges fails with InvalidArgumentException , due to CentralAuth volkankaos to Special:Contributions for IP ranges fails with InvalidArgumentException , due to CentralAuth.Feb 23 2024, 5:38 PM
taavi closed this task as Resolved.
taavi updated Other Assignee, removed: Wlknurl89.