Page MenuHomePhabricator

Fatal exception when changing user rights if space at the end of username
Closed, ResolvedPublic

Description

I was going to change userrights at https://meta.wikimedia.org/wiki/Special:UserRights but then got an error [V9VPrwpAAD4AAfdZcqUAAABH] 2016-09-11 12:35:59: Fatal exception of type "Wikimedia\Assert\ParameterAssertionException".

Later I think I found a reason for this error. There was a space at the end of "Username@wiki ".
Problem was I didn't notice the space, and anyway it should not give errors even if there is a space.

Event Timeline

Stryn created this task.Sep 11 2016, 12:51 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 11 2016, 12:51 PM
Stryn updated the task description. (Show Details)Sep 11 2016, 12:52 PM

I can reproduce this locally. Stacktrace:

[e8944a7c7567e062cf45253b] /wiki/index.php/Special:UserRights Wikimedia\Assert\ParameterAssertionException from line 63 of /var/www/html/wiki/vendor/wikimedia/assert/src/Assert.php: Bad value for parameter $dbkey: invalid DB key
Backtrace:
#0 /var/www/html/wiki/includes/title/TitleValue.php(81): Wikimedia\Assert\Assert::parameter(boolean, string, string)
#1 /var/www/html/wiki/includes/specialpage/SpecialPage.php(100): TitleValue->__construct(integer, string, string)
#2 /var/www/html/wiki/includes/specialpage/SpecialPage.php(84): SpecialPage::getTitleValueFor(string, string, string)
#3 /var/www/html/wiki/includes/specialpage/SpecialPage.php(629): SpecialPage::getTitleFor(string, string)
#4 /var/www/html/wiki/includes/specials/SpecialUserrights.php(224): SpecialPage->getPageTitle(string)
#5 /var/www/html/wiki/includes/specials/SpecialUserrights.php(211): UserrightsPage->getSuccessURL()
#6 /var/www/html/wiki/includes/specialpage/SpecialPage.php(522): UserrightsPage->execute(NULL)
#7 /var/www/html/wiki/includes/specialpage/SpecialPageFactory.php(583): SpecialPage->run(NULL)
#8 /var/www/html/wiki/includes/MediaWiki.php(283): SpecialPageFactory::executePath(Title, RequestContext)
#9 /var/www/html/wiki/includes/MediaWiki.php(750): MediaWiki->performRequest()
#10 /var/www/html/wiki/includes/MediaWiki.php(521): MediaWiki->main()
#11 /var/www/html/wiki/index.php(43): MediaWiki->run()
#12 {main}

This also caused the log entry to be sent to IRC several times even when the DB was rollbacked. I thought that had been fixed..

Change 309833 had a related patch set uploaded (by Glaisher):
Special:UserRights: Trim value of $mTarget if it's a string

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

Aklapper renamed this task from Fatal exception when changing user rights to Fatal exception when changing user rights if space at the end of username.Sep 11 2016, 2:59 PM

Change 309833 merged by jenkins-bot:
Special:UserRights: Trim value of $mTarget if it's a string

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

Umherirrender closed this task as Resolved.Sep 16 2016, 5:38 PM
Umherirrender assigned this task to Glaisher.
Umherirrender triaged this task as Normal priority.