Page MenuHomePhabricator

Checkuser throws exception if looking up user with invalid name
Open, MediumPublic

Description

See XH7ukQpAICsAAK@78zcAAADX (not pasting fully due to sort of sensitive data). Note the Title ends in an underscore, which is illegal for a title.

Bad value for parameter $dbkey: invalid DB key 'REDACTED_'
#0 /srv/mediawiki/php-1.33.0-wmf.19/includes/title/TitleValue.php(105): Wikimedia\Assert\Assert::parameter(boolean, string, string)
#1 /srv/mediawiki/php-1.33.0-wmf.19/includes/cache/LinkBatch.php(179): TitleValue->__construct(integer, string)
#2 /srv/mediawiki/php-1.33.0-wmf.19/includes/cache/LinkBatch.php(143): LinkBatch->addResultToCache(LinkCache, Wikimedia\Rdbms\ResultWrapper)
#3 /srv/mediawiki/php-1.33.0-wmf.19/includes/cache/LinkBatch.php(130): LinkBatch->executeInto(LinkCache)
#4 /srv/mediawiki/php-1.33.0-wmf.19/extensions/CheckUser/includes/CheckUserLogPager.php(116): LinkBatch->execute()
#5 /srv/mediawiki/php-1.33.0-wmf.19/includes/pager/IndexPager.php(231): CheckUserLogPager->preprocessResults(Wikimedia\Rdbms\ResultWrapper)
#6 /srv/mediawiki/php-1.33.0-wmf.19/includes/pager/IndexPager.php(609): IndexPager->doQuery()
#7 /srv/mediawiki/php-1.33.0-wmf.19/includes/pager/ReverseChronologicalPager.php(35): IndexPager->isNavigationBarShown()
#8 /srv/mediawiki/php-1.33.0-wmf.19/extensions/CheckUser/includes/specials/SpecialCheckUserLog.php(70): ReverseChronologicalPager->getNavigationBar()
#9 /srv/mediawiki/php-1.33.0-wmf.19/includes/specialpage/SpecialPage.php(569): SpecialCheckUserLog->execute(NULL)
#10 /srv/mediawiki/php-1.33.0-wmf.19/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#11 /srv/mediawiki/php-1.33.0-wmf.19/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#12 /srv/mediawiki/php-1.33.0-wmf.19/includes/MediaWiki.php(867): MediaWiki->performRequest()
#13 /srv/mediawiki/php-1.33.0-wmf.19/includes/MediaWiki.php(517): MediaWiki->main()
#14 /srv/mediawiki/php-1.33.0-wmf.19/index.php(42): MediaWiki->run()
#15 /srv/mediawiki/w/index.php(3): include(string)
#16 {main}

Details

Related Gerrit Patches:
mediawiki/extensions/CheckUser : masterUse getSafeTitleFor instead of getTitleFor to make links

Event Timeline

Bawolff created this task.Mar 5 2019, 10:06 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 5 2019, 10:06 PM
Huji claimed this task.Mar 6 2019, 12:35 AM
Huji triaged this task as Medium priority.
Huji added a subscriber: Huji.

I can confirm that ending the username with _ will cause an exception. Looking for the root cause now.

Change 494638 had a related patch set uploaded (by Huji; owner: Huji):
[mediawiki/extensions/CheckUser@master] Use getSafeTitleFor instead of getTitleFor to make links

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

Huji added a comment.Mar 6 2019, 3:27 AM

Guess what, it was a regression that I had introduced in https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/CheckUser/+/374851/ more than year ago!

Change 494638 had a related patch set uploaded (by Huji; owner: Huji):
[mediawiki/extensions/CheckUser@master] Use getSafeTitleFor instead of getTitleFor to make links

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

Meno25 added a subscriber: Meno25.May 31 2019, 11:36 AM

Not seen in Logstash for over 30 days. Keeping open because I'm unable to verify it myself given the restricted input. Is this still reproducible?

Huji added a comment.EditedJun 25 2019, 12:49 AM

It is. I just created a log for you on fawiki :)

I haven't been able to find the time to resubmit 494638, which will eventually fix this.

PS: That was the right nudge at the right time, @Krinkle :) I submitted a new patchset.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:07 PM