Page MenuHomePhabricator

Internal error when creating a new user
Open, MediumPublic

Description

Author: silmano

Description:
Steps to reproduce the issue are the following:

  1. Click on create new accout.
  2. Fill all the required fields.
  3. Click on submit/create account.
  4. Mediawiki reports the error: Fatal exception of type MWException

Enabling $wgShowExceptionDetails, I get the following instead:

User::addToDatabase: hit a key conflict attempting to insert a user row, but then it doesn't exist when we select it!
Backtrace:
#0 /var/www/localhost/htdocs/mediawiki/includes/specials/SpecialUserlogin.php(468): User->addToDatabase()
#1 /var/www/localhost/htdocs/mediawiki/includes/specials/SpecialUserlogin.php(453): LoginForm->initUser(Object(User), false)
#2 /var/www/localhost/htdocs/mediawiki/includes/specials/SpecialUserlogin.php(236): LoginForm->addNewAccountInternal()
#3 /var/www/localhost/htdocs/mediawiki/includes/specials/SpecialUserlogin.php(178): LoginForm->addNewAccount()
#4 /var/www/localhost/htdocs/mediawiki/includes/SpecialPage.php(613): LoginForm->execute(NULL)
#5 /var/www/localhost/htdocs/mediawiki/includes/SpecialPageFactory.php(487): SpecialPage->run(NULL)
#6 /var/www/localhost/htdocs/mediawiki/includes/Wiki.php(291): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#7 /var/www/localhost/htdocs/mediawiki/includes/Wiki.php(565): MediaWiki->performRequest()
#8 /var/www/localhost/htdocs/mediawiki/includes/Wiki.php(458): MediaWiki->main()
#9 /var/www/localhost/htdocs/mediawiki/index.php(59): MediaWiki->run()
#10 {main}

This is my actual configuration:
Mediawiki - 1.21.2
SQLite - 3.7.17
PHP - 5.5.4


Version: unspecified
Severity: normal
OS: Linux
Platform: PC
URL: https://www.mediawiki.org/wiki/Thread:Project:Support_desk/Internal_error_when_creating_a_new_user

Details

Reference
bz55552

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:22 AM
bzimport set Reference to bz55552.
bzimport added a subscriber: Unknown Object (MLST).

Thanks for the great bug report!

This looks a lot like bug 41609.
Which version (git revision, date, etc) of CentralAuth is this about?

Is the patch in https://gerrit.wikimedia.org/r/#/c/69587/ included / applied to your codebase?

silmano wrote:

The wiki is installed in Gentoo using their ebuild. It seems the file used for the installation is http://download.wikimedia.org/mediawiki/1.21/mediawiki-1.21.2.tar.gz dated 2013-Sep-03

The Gentoo ebuild doesn't seem to be making use of either mediawiki-1.21.2.patch.gz nor the gerrit patch mentioned. I'm gonna retest later with the includes/User.php patch applied.

silmano wrote:

I get the same error with https://gerrit.wikimedia.org/r/#/c/69587/ patch applied. I'm unable to create any user account.

silmano: Is this still a problem? Still not sure what might be the issue here; maybe also post this to https://www.mediawiki.org/wiki/Project:Support_desk

mike wrote:

I have a similar bug:

Product Version
MediaWiki 1.21.3
PHP 5.3.3 (apache2handler)
PostgreSQL 8.4.9

no extensions used (I was using casauth before).

When creating an account I get:

User::addToDatabase: hit a key conflict attempting to insert a user row, but then it doesn't exist when we select it!

Backtrace:

#0 <path to wiki>/includes/specials/SpecialUserlogin.php(468): User->addToDatabase()
#1 <path to wiki>/includes/specials/SpecialUserlogin.php(453): LoginForm->initUser(Object(User), false)
#2 <path to wiki>/includes/specials/SpecialUserlogin.php(200): LoginForm->addNewAccountInternal()
#3 <path to wiki>/includes/specials/SpecialUserlogin.php(181): LoginForm->addNewAccountMailPassword()
#4 <path to wiki>/includes/SpecialPage.php(613): LoginForm->execute(NULL)
#5 <path to wiki>/includes/SpecialPageFactory.php(487): SpecialPage->run(NULL)
#6 <path to wiki>/includes/Wiki.php(291): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#7 <path to wiki>/includes/Wiki.php(565): MediaWiki->performRequest()
#8 <path to wiki>/includes/Wiki.php(458): MediaWiki->main()
#9 <path to wiki>/index.php(59): MediaWiki->run()
#10 {main}

This setup was working with MediaWiki 1.18 (before a upgrade to 1.21).

mike wrote:

I think this bug is not specific for CentralAuth ("MediaWiki extensions"). I think it's a MediaWiki bug (e.g. SpecialUserlogin.php).