https://bugzilla.wikimedia.org/show_bug.cgi?id=47385

--- Comment #2 from [email protected] ---
Possibly I am barking up the wrong tree, as I can reproduce the
problem only locally and not on the wmf gerrit.

And although I am lacking admin access to our gerrit installation, it
might be that the account_external_ids table in MySQL does not match
what is entered by the user in the 'Username' field in gerrit's login
screen.

For the user otter, there should by two rows in the
account_external_ids table:

 
+------------+----------------------------+----------+-------------------------------------------+
  | account_id | email_address              | password | external_id           
                   |
 
+------------+----------------------------+----------+-------------------------------------------+
  |       4711 | otters email address       | NULL     | gerrit:otter          
                   |
  |       4711 | NULL                       | NULL     | username:otter        
                   |
 
+------------+----------------------------+----------+-------------------------------------------+

Which acount_id is used does not matter, but the two rows should come
with the same account_id.

Also the casing of otter in 'gerrit:otter' and 'username:otter' may
differ.

I could reproduce the 'Cannot assign user name' error message locally
if either
* the first line (i.e.: the line with 'gerrit:...' in external_id
  column) is missing (I cannot reliable reproduce a way to make that
  line missing), or
* the casing of the part after 'gerrit:' does not match what is
  entered for the 'Username' field in gerrit's login screen.
  So for the above 'gerrit:...' row, 'otter' would work, while 'Otter'
  or 'oTTer' would give the 'Cannot assign user name' error message.

To solve the issue, someone with SQL access (Chad?) could have a look
at the otter's 'gerrit:...' row in the account_external_ids table, and
  * if the row does not exist, create it, or
  * if the row exists, tell otter about the correct casing of the
    part after 'gerrit:' (It's the one used when logging in for the
    first time)


If it turns out that this did not help, for me the relevant part in
gerrit was
 
./gerrit-server/src/main/java/com/google/gerrit/server/account/AccountManager.java:63
That line fetches the external_id (gerrit:... line). If that cannot be
found, it is assumed the user does not exist yet, and it is tried to
add it to the database. So another 'username:...' row is added, which
throws the OrmException that leads to the 'Cannot assign user name'
error message. The exception the above problem throws for me locally is:

[2013-04-19 00:44:27,011] ERROR com.google.gerrit.server.account.AccountManager
: Cannot assign user name
com.google.gwtorm.server.OrmException: insert failure on account_external_ids
    at
com.google.gwtorm.schema.sql.SqlDialect.convertError(SqlDialect.java:151)
    at com.google.gwtorm.jdbc.JdbcAccess.convertError(JdbcAccess.java:448)
    at com.google.gwtorm.jdbc.JdbcAccess.insert(JdbcAccess.java:160)
    at
com.google.gerrit.server.account.ChangeUserName.call(ChangeUserName.java:115)
    at
com.google.gerrit.server.account.AccountManager.create(AccountManager.java:308)
    at
com.google.gerrit.server.account.AccountManager.authenticate(AccountManager.java:115)
    at
com.google.gerrit.httpd.auth.ldap.LdapLoginServlet.doPost(LdapLoginServlet.java:175)
[...]

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to