Page MenuHomePhabricator

Creating users causes exception
Closed, ResolvedPublic

Description

Came to my attention from @Jalexander

2015-11-19 00:00:30 mw1086 votewiki exception ERROR: [51c30b46] /w/index.php?title=Special:UserLogin&action=submitlogin&type=signup LogicException from line 2428 of /srv/mediawiki/php-1.27.0-wmf.7/includes/User.php: Cannot set a password for a user that is not in the database. {"exception_id":"51c30b46"}
[Exception LogicException] (/srv/mediawiki/php-1.27.0-wmf.7/includes/User.php:2428) Cannot set a password for a user that is not in the database.

#0 /srv/mediawiki/php-1.27.0-wmf.7/includes/User.php(2395): User->setPasswordInternal(NULL)
#1 /srv/mediawiki/php-1.27.0-wmf.7/includes/specials/SpecialUserlogin.php(675): User->setPassword(NULL)
#2 /srv/mediawiki/php-1.27.0-wmf.7/includes/specials/SpecialUserlogin.php(654): LoginForm->initUser(User, boolean)
#3 /srv/mediawiki/php-1.27.0-wmf.7/includes/specials/SpecialUserlogin.php(363): LoginForm->addNewAccountInternal()
#4 /srv/mediawiki/php-1.27.0-wmf.7/includes/specials/SpecialUserlogin.php(341): LoginForm->addNewAccountMailPassword()
#5 /srv/mediawiki/php-1.27.0-wmf.7/includes/specialpage/SpecialPage.php(384): LoginForm->execute(NULL)
#6 /srv/mediawiki/php-1.27.0-wmf.7/includes/specialpage/SpecialPageFactory.php(553): SpecialPage->run(NULL)
#7 /srv/mediawiki/php-1.27.0-wmf.7/includes/MediaWiki.php(280): SpecialPageFactory::executePath(Title, RequestContext)
#8 /srv/mediawiki/php-1.27.0-wmf.7/includes/MediaWiki.php(704): MediaWiki->performRequest()
#9 /srv/mediawiki/php-1.27.0-wmf.7/includes/MediaWiki.php(506): MediaWiki->main()
#10 /srv/mediawiki/php-1.27.0-wmf.7/index.php(43): MediaWiki->run()
#11 /srv/mediawiki/w/index.php(3): include(string)
#12 {main}

Event Timeline

csteipp raised the priority of this task from to Needs Triage.
csteipp updated the task description. (Show Details)
csteipp added subscribers: csteipp, Jalexander.

I think this is caused by https://gerrit.wikimedia.org/r/#/c/250020/, but reverting just that patch on my dev machine still gives an exception in other places, so not sure how far this goes.

In theory this should never happen. [[ https://github.com/wikimedia/mediawiki/blob/wmf/1.27.0-wmf.7/includes/specials/SpecialUserlogin.php#L669 | Line 669 of initUser ]] adds the user to the database, and then the call which throws this exception is made in line 675. So looks like the idFromName check on line 2426 of User does not work as expected. Some kind of caching problem?

Change 254080 had a related patch set uploaded (by Gergő Tisza):
Invalidate cached user ID after user is added to the database

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

csteipp triaged this task as Unbreak Now! priority.Nov 19 2015, 1:30 AM

This is preventing James from creating users on votewiki, which is needed for the Arbcom elections.

Hey guys, doesn't look like this got merged for SWAT and I know that we don't usually do any deployments on Friday but I really need to get this together for tomorrow :-/ the election starts Monday and we need to get some users created. Is this going to be possible? Or is there another alternative we can use to create those users?

I think we can. @greg, I'll ping you about this once it's merged.

Change 254080 merged by jenkins-bot:
Update cached user ID after user is added to the database

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

Change 254480 had a related patch set uploaded (by CSteipp):
Update cached user ID after user is added to the database

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

Change 254480 merged by jenkins-bot:
Update cached user ID after user is added to the database

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

csteipp claimed this task.

Confirmed fixed by @Jalexander