Last modified: 2012-12-01 09:14:09 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35414, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33414 - Unable to merge/delete blocked user
Unable to merge/delete blocked user
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
UserMerge (Other open bugs)
unspecified
All All
: Normal normal with 1 vote (vote)
: MW 1.20 version
Assigned To: Krinkle
:
: 35239 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-29 16:18 UTC by Eric Siegel
Modified: 2012-12-01 09:14 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Eric Siegel 2011-12-29 16:18:10 UTC
I was trying to delete users who were in the block list and I got this error:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
   (SQL query hidden)
 from within function "Database::update". Database returned error "1062: Duplicate entry '0' for key 'PRIMARY' (localhost)".

It seems it's trying to re-block the 'Anonymous' user, and it can't.
Comment 1 Platonides 2011-12-29 16:22:55 UTC
What db are you using? Postgres?
Comment 2 Eric Siegel 2011-12-29 16:27:11 UTC
It's MySQL.
Comment 3 T. Gries 2011-12-29 18:44:55 UTC
@Eric:

please can you indicate why you have filed this bug as bug of the Component UserMerge ?
Comment 4 Eric Siegel 2011-12-29 18:53:56 UTC
(In reply to comment #3)
> @Eric:
> 
> please can you indicate why you have filed this bug as bug of the Component
> UserMerge ?

Because it's about this extension => http://www.mediawiki.org/wiki/Extension:User_Merge_and_Delete

The issue was discussed here => http://www.mediawiki.org/wiki/Extension_talk:User_Merge_and_Delete#Database_Error

I figured I should report this as a bug.  I was trying to delete users that were in the block list.  When I try to delete a user (without merging), it merges it with "Anonymous" first.  So when I delete a user in the block list, it blocks "Anonymous", so when I try to delete another user in the block list, I get an error because "Anonymous" is already in the block list (Duplicate entry '0' for key 'PRIMARY').
Comment 5 T. Gries 2011-12-29 18:57:27 UTC
Ok. When I have time I will investigate, and perhaps repair this.
Comment 6 Eric Siegel 2011-12-29 19:03:27 UTC
This is MediaWiki 1.16.4, if that matters.  When I get time, I'll update to 1.18.0.

As a workaround, I deleted the row with PRIMARY KEY (ipb_id) 0 in wiki_ipblocks.  This is the row, it's complaining about.
Comment 7 Andrea Petrucci 2012-02-06 20:28:39 UTC
same problem for me

MediaWiki 	1.18.1
PHP 	        5.2.6-1+lenny9 (cgi-fcgi)
MySQL 	        5.0.51a-24+lenny4

UserMerge 1.6.31
Comment 8 Shawn Reeves 2012-02-28 23:49:45 UTC
I think I've found the/a cause of this bug:
I found the item in UserMerge_body.php: line 227 inserts ipb_id into the array of places where userid may be found in the database, even though ipb_id is not a user id but a primary key for its table. It should be changed to ipb_user. The original code, in context:
 $idUpdateFields = array(
  array('archive','ar_user'),
  array('revision','rev_user'),
  array('filearchive','fa_user'),
  array('image','img_user'),
  array('oldimage','oi_user'),
  array('recentchanges','rc_user'),
  array('logging','log_user'),
  array('ipblocks', 'ipb_id'),
  array('ipblocks', 'ipb_by'),
  array('watchlist', 'wl_user'),
 );

What the code should be:

 $idUpdateFields = array(
  array('archive','ar_user'),
  array('revision','rev_user'),
  array('filearchive','fa_user'),
  array('image','img_user'),
  array('oldimage','oi_user'),
  array('recentchanges','rc_user'),
  array('logging','log_user'),
  array('ipblocks', 'ipb_user'),
  array('ipblocks', 'ipb_by'),
  array('watchlist', 'wl_user'),
 );
Comment 9 Krinkle 2012-12-01 09:09:09 UTC
*** Bug 35239 has been marked as a duplicate of this bug. ***
Comment 10 Krinkle 2012-12-01 09:13:52 UTC
Change-Id: I166f0042b2445a06a63c6e3f70a28feae3603f13

Landed and backported to REL1_20 branch of the extension.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links