Page MenuHomePhabricator

Trying to connect Phabricator Account results in Server Error (500)
Closed, ResolvedPublic

Description

Trying to connect my Phabricator Account (Jogo.obb) to Striker (LDAP Account also Jogo.obb) via 'Settings' -> 'Phabricator' -> 'Connect Phabricator account' results in a Server Error (500) on URL https://toolsadmin.wikimedia.org/profile/settings/phabricator/attach

There is no additional Information provided on that error page, html source is just:

<h1>Server Error (500)</h1>

Details

Related Gerrit Patches:

Event Timeline

Jogo.obb created this task.Aug 27 2016, 7:54 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 27 2016, 7:54 AM

I can't find any error logs that made it to the Logstash server, but I have found some related data in Striker's local database:

+----+------------------+--------------------+----------------+
| id | ldapname         | sulname            | phabname       |
+----+------------------+--------------------+----------------+
| 22 | JogoBot          | NULL               | Jogo.obb       |
| 23 | Jogo.obb         | Jogo.obb           | NULL           |
+----+------------------+--------------------+----------------+

The attachment of the ldapname JogoBot to the phabricator name Jogo.obb doesn't match with the data displayed on @Jogo.obb's profile page which shows the ldapname Jogo.obb. It also doesn't match with my manual queries to https://phabricator.wikimedia.org/conduit/method/user.ldapquery/

The 500 error is likely an uncaught SQL error for a duplicate key insert. The labsauth_labsuser table has a UNIQUE constraint on the phabname field. The conduit lookup for ldapname Jogo.obb is returning Jogo.obb, but that value is already associated with the ldapname JogoBot.

I can fix the duplicate key problem by removing the association of phabname Jogo.obb and ldapname JoboBot in labsauth_labsuser. That won't solve the mystery of how the attachment was created originally, but it should allow the proper attachment to be created.

{{done}}

+----+------------------+--------------------+----------------+
| id | ldapname         | sulname            | phabname       |
+----+------------------+--------------------+----------------+
| 22 | JogoBot          | NULL               | NULL           |
| 23 | Jogo.obb         | Jogo.obb           | NULL           |
+----+------------------+--------------------+----------------+
bd808 moved this task from Backlog to Doing on the Striker board.Aug 27 2016, 4:13 PM

That won't solve the mystery of how the attachment was created originally, but it should allow the proper attachment to be created.

I think I can clarify this mystery, both accounts are mine. It looks like I had allready connected the JogoBot account before I created the new one Jogo.obb.

The 500 error is likely an uncaught SQL error for a duplicate key insert. The labsauth_labsuser table has a UNIQUE constraint on the phabname field. The conduit lookup for ldapname Jogo.obb is returning Jogo.obb, but that value is already associated with the ldapname JogoBot.

That sounds possible, therefore it should be catched. Also it would be nice to have the possibility to remove the connection to Phabricator on a certain way.

Change 307110 had a related patch set uploaded (by BryanDavis):
Catch and log database errors while saving models

https://gerrit.wikimedia.org/r/307110

Change 307110 merged by jenkins-bot:
Catch and log database errors while saving models

https://gerrit.wikimedia.org/r/307110

bd808 closed this task as Resolved.Aug 29 2016, 8:13 PM
bd808 claimed this task.
Restricted Application added a project: User-bd808. · View Herald TranscriptAug 29 2016, 8:13 PM
bd808 moved this task from To Do to Archive on the User-bd808 board.Sep 1 2016, 5:13 PM
bd808 moved this task from Archive to Done on the User-bd808 board.
bd808 moved this task from Done to Archive on the User-bd808 board.Oct 17 2016, 3:25 PM
bd808 moved this task from Doing to Done on the Striker board.Mar 4 2017, 3:57 AM