CraftConomy

154k Downloads

java.sql.SQLException: Subquery returns more than 1 row

ErdemUyanik opened this issue ยท 2 comments

commented

When someone uses the /money command or buys something in the Shop this happens
( Uses somehting that needes Money ):

http://pastebin.com/ZTdPGH9Q

Here is a list of Plugins installed:

http://pastebin.com/1RRqH4wB

Thanks :)

Btw;
I'm most likely online on this Teamspeak: Ts.IMT-Gaming.eu
named Erroru61 and beeing the [Server-Manager] else on the
minecraft Server. mc.NexusCity.de as Erroru61 [Admin]

commented

That error usually happens when the name of the player got changed but a money action happened before I did the change in the database (Think of a plugin that does a money action very early on login by example). That cause the issue to have 2 accounts in the database. I just need to find the proper fix.

commented

I just had the same issue and the cause for it was simple: I had two players that have the same username (due to one not being logged in for a while, changing his name and then someone else taking the name)

A potential fix would be to just use one of them, the question is which one? Ideally the one that is online with the name but if both are offline you would want to use the one that used the name last. Unfortunately that's not tracked in the plugin directly so maybe just use the higher ID? (which isn't necessarily the last online one but it's better than having the plugin error or having to check the last-login via the OfflinePlayer data)

A different solution would be to change the name of the previous user when one with the same logs in. (maybe to an invalid/duplicate marked one? That way this should also be prevent)