Issue 826: Duplicate accounts when using LDAP
Status:  WontFix
Owner: ----
Closed:  Mar 2013
Reported by russell....@gmail.com, Jan 17, 2011
Affected Version: 2.1.5

Symptom: 
Reviews can't be assigned to the user.  They show up in the autocomplete list twice, but neither entry works. 

What steps will reproduce the problem?
It's not clear exactly what causes this, but I've seen it happen with two users now.  I suspect that it's triggered by trying to login using some case mixture that the ldap server accepts for authentication that's different from the one the user logged in with the first time.  


Looking at the database, I can see duplicate entries in the accounts and account_external_ids table.  Here's some example data from a duplicated user:

accounts table:

 REGISTERED_ON           | FULL_NAME    | PREFERRED_EMAIL      | DOWNLOAD_COMMAND | ACCOUNT_ID 
 ------------------------+--------------+----------------------+------------------+------------
 2010-03-04 10:47:28.681 | Joe User     | joe.user@company.com | CHERRY_PICK      | 1000001    
 2011-01-05 10:24:38.034 | Joe User     | joe.user@company.com | NULL             | 1000254    

account_external_ids table :
1000254    | joe.user@company.com | NULL     | gerrit:JOE.USER@COMPANY.COM
1000001    | joe.user@company.com | NULL     | gerrit:joe.user@company.com


Workaround:
Deleting the newer of the duplicated entries from these two tables seems to fix the problem. 
Jan 18, 2011
Project Member #1 edwin.ke...@gmail.com
In Gerrit 2.1.6 [1] there was a bug-fix [2] that may be related to this problem. For details about this bug-fix please have a look at the commit message [2].

[1] http://gerrit.googlecode.com/svn-history/r5209/ReleaseNotes/ReleaseNotes-2.1.6.html
[2] https://review.source.android.com/#change,17446
May 20, 2011
Project Member #2 nas...@grainawi.org
I think that was the likely problem. @russell, if you've seen this since upgrading to 2.1.6 please reply and let us know.
Status: AwaitingInformation
Mar 28, 2013
#3 sop@google.com
(No comment was entered for this change.)
Status: WontFix