Page MenuHomePhabricator

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


Reported upstream:

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 created this task.Nov 24 2014, 10:31 AM
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 added a subscriber: fbstj.
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?

fbstj added a comment.EditedNov 24 2014, 10:55 AM

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.

Qgil added a comment.Nov 24 2014, 11:09 AM

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
fbstj added a comment.Nov 26 2014, 2:00 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.

Qgil added a comment.Nov 27 2014, 8:54 AM

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 and remove one of the two Wikimedia accounts?

Qgil moved this task from To Triage to Need discussion on the Phabricator board.Nov 27 2014, 8:54 AM
fbstj added a comment.Nov 27 2014, 9:40 AM

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 updated the task description. (Show Details)Dec 8 2014, 8:04 AM
Qgil edited projects, added Phabricator (Upstream); removed Phabricator.
Qgil moved this task from Backlog to Wikimedia requests on the Phabricator (Upstream) board.
Krenair added a subscriber: Krenair.Dec 8 2014, 8:43 PM
Qgil added a comment.Dec 9 2014, 10:13 PM

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

Qgil added a comment.Dec 12 2014, 10:48 AM

@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.

fbstj added a comment.Dec 12 2014, 2:50 PM

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

fbstj reopened this task as Open.Dec 16 2014, 8:04 AM
fbstj added subscribers: Teles, chasemp.
fbstj added a comment.Dec 16 2014, 3:26 PM

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?)

jayvdb added a subscriber: jayvdb.Jan 21 2015, 3:36 PM

@mmodell: Ping on the last two comments

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 claimed this task.Feb 26 2015, 9:37 AM
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?

fbstj added a comment.Jul 29 2015, 3:00 PM

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 added a comment.Jul 30 2015, 7:15 AM

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

mmodell added a comment.EditedJul 30 2015, 4:19 PM


delete from user_externalaccount where accountURI='';
Query OK, 1 row affected (0.01 sec)
Aklapper removed mmodell as the assignee of this task.Jul 30 2015, 9:33 PM

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...

fbstj added a comment.Jul 31 2015, 9:11 AM

Thank you so much :D

Teles added a comment.Aug 1 2015, 12:33 AM

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 added a comment.Aug 8 2015, 12:32 AM

@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 closed this task as Resolved.Nov 19 2015, 2:09 AM
mmodell claimed this task.

This should be fixed now.

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptMay 23 2016, 6:05 PM