Last modified: 2012-12-01 09:09: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 T37239, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35239 - Fatal error if to be merged users are blocked
Fatal error if to be merged users are blocked
Status: RESOLVED DUPLICATE of bug 33414
Product: MediaWiki extensions
Classification: Unclassified
UserMerge (Other open bugs)
unspecified
All All
: High major (vote)
: MW 1.20 version
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-15 03:53 UTC by Krinkle
Modified: 2012-12-01 09:09 UTC (History)
4 users (show)

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


Attachments

Description Krinkle 2012-03-15 03:53:37 UTC
I get an SQL error that results in a fatal error when merging one blocked user into another (2 vandals in this case, one is my "Vandal deposit" and the other has an offensive username).

The SQL error is generated because blocks table can't have 2 entries for the same user-id (conflicts with the unique pair requirement on the schema).

Not sure what the correct solution is, but it should atleast not crash the merge and throw an exception.

Suggesting to perhaps query the user with a question ("( ) Preserve the origin user block / ( ) Preserve the target user block"). Or don't allow such moves and require them one of them to be unblocked before hand (but that creates an extra log action that doesn't make sense (unblocking the vandal)).

I think dropping the block on the origin user makes the most sense (when both are blocked), if only one of them is blocked, then there is no problem. After the merge the target user is blocked either way.
Comment 1 Krinkle 2012-03-15 03:56:14 UTC
Possibly related:
* (bug 33414) Cannot delete users in block list
Comment 2 Krinkle 2012-03-15 03:58:18 UTC
I temporarily circumvented it (depending on the situation) by either
* removing the rows for the old user from the block table manually via MySQL
* or by commenting out the 2 block-table arrays in the php code that managest the query, leaving orphaned rows in the database, but at least the merge can continue.
Comment 3 steevithak 2012-07-25 13:43:08 UTC
I think I  may be experiencing this bug too. Since I upgrade to MediaWiki 1.18.3, I've been unable to merge users. Any attempt results in 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 "DatabaseBase::update". Database returned error "1062: Duplicate entry '2' for key 'PRIMARY' (db.camera-wiki.org)". 

Is there a fix in the works for this yet or is merge-and-delete just not compatible with 1.18+?
Comment 4 Krinkle 2012-07-25 21:03:51 UTC
(cc Roan)

Roan catched the likely cause of this in the code. The extension is trying to update the `ipb_id` column of the `ipblocks` table, which is wrong. Because that's the primary key as opposed to the user id.

It should instead update `ipb_user`.
Comment 6 steevithak 2012-07-26 18:05:11 UTC
I can tentatively confirm that workaround in Comment 4 works. What I did was edit line 227 of UserMerge_body.php from this:

	array('ipblocks', 'ipb_id'),

to this:

	array('ipblocks', 'ipb_user'),

After doing that I tried to merge a user with the "delete old user" option checked. No error message this time. It appears to have worked correctly.
Comment 7 T. Gries 2012-07-26 22:09:13 UTC
@ Steevithak

Thanks for reporting. I'll try to replicate the bug and solution and then apply a bug fix (commit via gerrit to our git repo. I hate the new workflow, but it's the only one we have at the moment).
Comment 8 Krinkle 2012-12-01 09:07:33 UTC
bump, still happening as of 1.20.1.

I confirm that replacing ipb_id with ipb_user fixes it.
Comment 9 Krinkle 2012-12-01 09:09:09 UTC

*** This bug has been marked as a duplicate of bug 33414 ***

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


Navigation
Links