UTRS / utrs

Unblock Ticket Request System
https://utrs.wmflabs.org/
14 stars 13 forks source link

Excess accounts with OAuth #131

Closed TParis closed 7 years ago

TParis commented 7 years ago

This happens every time I login. It appears to be an issue because UTRS is trying to create a new UTRS user account for me each time. If that is required for OAuth, it should reassign all of the old tickets to the new account, copy settings, and then delete the old account.

Fatal error: Uncaught exception 'UTRSDatabaseException' with message 'A database error occured when attempting to process your request:
array ( 0 => '23000', 1 => 1062, 2 => 'Duplicate entry \'\' for key \'email\'', )' in /usr/UTRSgit/utrs/public_html/login.php:253 Stack trace: #0 {main} thrown in /usr/UTRSgit/utrs/public_html/login.php on line 253

Salvidrim commented 7 years ago

We've had a similar issue recently that was caused by a mismatch between the Wikipedia account associated to an existing UTRS account and the Wikipedia account the user was trying to OAuth from.

May sound like a stupid question, but have you double-checked that you're trying to login to UTRS and OAuth from your "User:TParis" English Wikipedia account?

TParis commented 7 years ago

I have confirmed that my username is User:TParis and I am using the En Wikipedia OAuth.

Salvidrim commented 7 years ago

Then Amanda will have to look 'cause I have no idea

Weird thing tho, in UTRS user management when I look at your account:

image

So for some reason OAuth tried creating a "new" TParis UTRS account but failed because there was already one but still overwrote at least the date.created field with blank data?

dqwiki commented 7 years ago

119 Was supposed to solve the issue. There will be no need to destroy or merge accounts, they are just integrated with the existing account. It seems one of my if statements is failing.

The blank registration date will appear for TParis and I, cause when we first started we needed accounts that had to be DB created, as there were no tool admins at the time.

dqwiki commented 7 years ago

Looking through the web error logs, I see that $is_admin is undefined at line 176. The only reason I could see it is if you tried to login with meta wiki instead of English Wikipedia as there is no catch if you are not WMF SuSa/steward. The other possibility is you logged in with no wiki selected, which is possible I guess if you use an invalid url key.

dqwiki commented 7 years ago

$is_admin is actually a different issue, as I can reproduce that doing exactly what I said.

dqwiki commented 7 years ago

I have found the issue. There are two different UTRS accounts for you. You have TParis and TParis-alt2 (unapproved, no access), with two different emails, I suspect they are switched around in the DB for the one you are trying to use with your main account. It doesn't help that the second one was marked for "oversight" with the rest of the false accounts we used to get, which means only a dev in the interface or db could find them.

Drop me a message offline and we'll sort which email you wish.