Page MenuHomePhabricator

'Attaching' two mediawiki accounts results in AphrontCountQueryException
Closed, ResolvedPublic

Description

Reported upstream: https://secure.phabricator.com/T6707

I can't seem to visit /u/fbstj could this be something to do with me 'attaching' two mediawiki accounts to my account?

I get the following errors when I try to visit my page:

Unhandled Exception ("AphrontCountQueryException")
More than 1 result from loadOneWhere()!

Event Timeline

fbstj raised the priority of this task from to Needs Triage.
fbstj updated the task description. (Show Details)
fbstj added a project: Phabricator.
fbstj changed Security from none to None.
fbstj updated the task description. (Show Details)
fbstj subscribed.
Qgil triaged this task as Medium priority.Nov 24 2014, 10:49 AM

Indeed, I can reproduce.

I guess users are not supposed to add more than one Wikimedia account in a single Phabricator username. Then again, I don't think we have discussed this anywhere, leave alone documented anything. In fact, I was not aware that you could "attach" more than one account. How have you done it?

I was just trying to change the user I was attached to (I accidentally somehow have to mediawiki accounts, and had signed up with the wrong one) so I signed in to phabricator then signed out on mediawiki before pressing the refresh button on the /settings/panel/external/ page (which no longer works, probably because two accounts).

I just tried removing the second account to see if it would 'fix' this, but it does exactly the same thing.

What we can do is to delete this account, I guess. Let's wait until @mmodell is back, he might be interested in more details before deleting your account, in order to prevent this problem.

Aklapper renamed this task from my account page doesn't seem to work? to 'Attaching' two mediawiki accounts results in AphrontCountQueryException.Nov 24 2014, 7:10 PM

Revoking the permissions from the mediawiki side doesn't seem to fix things. I can still log in and do everything but look at my profile I think.

I guess the solution is that the plugin shouldn't allow users to add a second Wikimedia username? One Phabricator account for one Wikimedia SUL account.

@fbstj can you access https://phabricator.wikimedia.org/settings/panel/external/ and remove one of the two Wikimedia accounts?

Yeah I can access that page, in T75720#777867 I both tried to remove or refresh either of the connections and they both respond with the same error:

Unhandled Exception ("AphrontCountQueryException")
More than 1 result from loadOneWhere()!

The refresh button loads a new page where that's the only content, where the remove button brings up an error dialogue.

Qgil edited projects, added Phabricator (Upstream); removed Phabricator.
Qgil moved this task from Backlog to Wikimedia requests on the Phabricator (Upstream) board.

@fbstj, there is a discussion upstream. Basically, they cannot reproduce the steps to attach two accounts.

@fbstj you're really popular here! :)

I wonder whether we can clean our database to fix this specific case here, while waiting for the upstream path to prevent users running into this situation again.

That would be great, it'd be nice to have a profile I can visit/configure XD

Any news on cleaning the database record?

@mmodell would probably know best since he wrote the majority of the oauth extension (or all of it?)

Sorry this flew under my radar somehow.

It looks like it's a phab bug, not specific to any code that I wrote, however, I might be able to figure out a solution. I'll poke at it.

mmodell changed the task status from Open to Stalled.Apr 14 2015, 6:07 PM

Any news on cleaning the database record?

For the specific case of @fbstj, I guess someone needs to delete one row in the user_externalaccount table in the phabricator_user DB?
Imaginary SQL to find that data: USE phabricator_user; SELECT * FROM user_externalaccount JOIN user WHERE user_externalaccount.userPHID = user.phid AND user.userName = "fbstj";
(And I'm not sure if user_externalaccount.userPHID needs to be user_externalaccount.accountID instead here, still trying to understand that scheme more.)

@mmodell: Could you take a look at that if you find 5 minutes and if things don't seem too risky?

Thanks for taking a look :) apologies for taking peoples time from the more interesting tasks

so which external account is the valid one? I don't want to delete the wrong one.

Fbstj or Fbstjoe ?

fbstj is the good one, fbstjoe is one I'd like delete/merging tbh

Done.

delete from user_externalaccount where accountURI='https://www.mediawiki.org:/w/index.php?title=User%3AFbstjoe';
Query OK, 1 row affected (0.01 sec)

The specific issue for the user @fbstj was fixed by @mmodell (thanks a lot!).
For the general problem we rely on / wait for upstream code...

What about other affected users? They should wait or they should ask it to be fixed?

I am another affected user :D

@Teles: if you tell me which account to remove then I can remove it for you, but I don't want to remove the one you use to log in so I won't take any action until I know for sure.

This comment was removed by Teles.

@Teles: if you tell me which account to remove then I can remove it for you, but I don't want to remove the one you use to log in so I won't take any action until I know for sure.

@mmodel, thanks!
The one that should be removed is "Telles" (with two "L")

mmodell claimed this task.

This should be fixed now.