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 created this task.Nov 19 2015, 12:25 AM
csteipp updated the task description. (Show Details)
csteipp raised the priority of this task from to Needs Triage.
csteipp added subscribers: csteipp, Jalexander.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptNov 19 2015, 12:25 AM

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.

Tgr added a comment.Nov 19 2015, 12:39 AM

In theory this should never happen. 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.

csteipp merged a task: Restricted Task.Nov 19 2015, 1:35 AM

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?

csteipp added a subscriber: greg.Nov 20 2015, 1:43 PM

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 closed this task as Resolved.Nov 20 2015, 10:54 PM
csteipp claimed this task.

Confirmed fixed by @Jalexander