Ban Management

Ban Management

193k Downloads

Duplicates found for player_name, was unable to contact Mojang for updated names

c0wg0d opened this issue ยท 3 comments

commented

Issue report

Tell us about your environment
Ubuntu, MySQL

  • Server Software:
    Paper

  • Server Version:
    Paper version git-Paper-146 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)

  • BanManager Version:
    6.0.2

  • Online/Offline mode:

  • Bungeecoord online/offline mode (if applicable):
    Online

I am getting the following error on many players:
[11:40:43 WARN]: [BanManager] Duplicates found for player_name, was unable to contact Mojang for updated names

I think there was some point where I accidentally forgot to turn online mode on and it generated duplicate UUIDs for a bunch of players. Is there any easy way to clean all these up? Or is that error not what I think it means?

commented

So on your current version you will need to resolve these manually if your server is hitting the Mojang API rate limit.

Run the following query to find all duplicates:

SELECT name, COUNT(name) FROM bm_players GROUP BY name HAVING COUNT(name) > 1 ORDER BY name ASC;

Next find each of these players and update the name, I'd suggest performing the lookup on https://mcuuid.net/

SELECT HEX(id), name FROM bm_players WHERE name = ?
UPDATE bm_players SET name = ? WHERE id = UNHEX(?)

Replace ? with the correct values.

In the latest developer build, a new command can help assist with this. It will display up to 10 duplicates and allows manually setting a name of a player, more info can be found at https://banmanagement.com/faq#duplicate-issues

commented

I think I have the reverse issue from what you're describing. For example, I have 2 entries in bm_players with my name. One with the correct UUID and one with an offline UUID probably from when I was testing a server or something. Don't I just want to delete any rows that have the incorrect/offline UUID?

commented

confuser
Run the duplicates query to list all affected player names (presuming you've already done this to know it's 20 records). You'll need to perform a WHERE query for each name to grab their UUIDs, compare it to https://mcuuid.net/ values to figure out which is offline and delete the player record

c0wg0d
So just delete the incorrect UUID record from bm_players?

confuser
Yes, but given you're on v6, you'll need to make sure you also delete any associated bans (both player_id and actor_id) for all punishments too
otherwise BM will fail to start up
On v7 it prints a warning and ignores them instead

c0wg0d
Okay, and I assume those keys are in every table?

confuser
actor_id is in every punishment table
player_id is only in player associated punishments, i.e. not ip bans

c0wg0d
Okay, and for the ones that are actually console IDs, if there happen to be values associated to both UUIDs, I can just update the actor_id to the correct/most current one?

confuser
Yes

c0wg0d
Perfect, thank you

WOOHOO

mysql> SELECT name, COUNT(name) FROM bm_players GROUP BY name HAVING COUNT(name) > 1 ORDER BY name ASC;
Empty set (0.01 sec)