EssentialsX

EssentialsX

2M Downloads

RuntimeException: null

mibby opened this issue ยท 25 comments

commented

Type of bug

Error in console

/ess version output

EssentialsX dev 1112 (2.19.0-dev+70-34fdcf8)

Server startup log

--

EssentialsX config files

https://paste.gg/p/anonymous/f9dee1b1496e40a598073d6fd16e3668/files/5934dec06493419a855a44e98956054b/raw

Error log (if applicable)

https://paste.gg/p/anonymous/c91d995181bb4b9b87b2f47009794dc0/files/40922ecedf7c43f2bd32cbb9f4439e8a/raw

Bug description

Essentials blows up with exceptions when someone types /baltop.

Steps to reproduce

  1. Run /baltop.
  2. Errors.

Expected behaviour

No errors.

Actual behaviour

Errors.

Caused by commit 34fdcf8. Downgrading to dev 1111, no more exceptions when checking baltop.

RE: #3969

commented

Cannot replicate:

Server version: 1.16.5-R0.1-SNAPSHOT git-Paper-466 (MC: 1.16.5)
EssentialsX version: 2.19.0-dev+70-34fdcf8
LuckPerms version: 5.1.63
Vault version: 1.7.2-b107

Server logs (tested both online mode and offline mode): https://paste.gg/p/anonymous/5ecbb79ce5e54b8e84f7c71015b53db2


It appears your usermap contains offline-mode UUIDs for online-mode players. This can happen for a number of reasons (ranging from server configs to third-party plugins and broken server software), but we need more information about the server setup to determine what the possible cause is. Please provide the full output of /ess version and the full server startup log as requested in the template.

Note that 34fdcf8 did not cause this issue. Your usermap was already damaged at some point in the past, and the commit and messages in question exists to highlight existing broken usermaps and bring them to our attention, so that we can investigate these before they lead to further data loss problems.

commented

I run the server behind a BungeeCord proxy (Travertine) with newly added Bedrock support (via Geyser & Floodgate). The server runs in offline-mode but players can't connect to it directly; they must go through the proxy for online-mode UUID forwarding. Citizens may have generated some UUIDs for various NPCs created and deleted over the years. There also may be a handful of UUIDs from Geyser (<10 in total).

I have 12,747 user ymls in the userdata folder.

/ess version

[08:02:50] [Server thread/INFO]: Server version: 1.16.5-R0.1-SNAPSHOT git-Paper-466 (MC: 1.16.5)
[08:02:50] [Server thread/INFO]: EssentialsX version: 2.19.0-dev+70-34fdcf8
[08:02:50] [Server thread/INFO]: PlaceholderAPI version: 2.10.10-DEV-122
[08:02:50] [Server thread/INFO]: LuckPerms version: 5.2.104
[08:02:50] [Server thread/INFO]: Vault version: 1.7.3-b${env.TRAVIS_BUILD_NUMBER}
[08:02:50] [Server thread/INFO]: EssentialsXAntiBuild version: 2.19.0-dev+70-34fdcf8
[08:02:50] [Server thread/INFO]: EssentialsXSpawn version: 2.19.0-dev+70-34fdcf8
[08:02:50] [Server thread/INFO]: Citizens version: 2.0.27-SNAPSHOT (build 2260)

Server start-up log, but I doubt you'll obtain anything helpful from it.
https://paste.gg/p/anonymous/42d1a006bada40d6b298fecb74631240/files/a6a7a478af8345979e81fb4a825108be/raw

If the usermap is corrupt, is it safe to delete the usermap.csv (Essentials Folder) / usercache.json (main server directory) and let it regenerate over time? No one has complained about any loss of EssentialsX data (homes / money).

commented

I moved the usermap.csv out to re-create it and Essentials generated 10,000 new UUID ymls at start-up.
https://paste.gg/p/anonymous/8475c8fea271406ab913a2d1e650e35c/files/d77f7d91b0b940f39fe522ad5e911d59/raw

I checked ~10 of them and they are all NPC flagged with account names of players who never joined my server.

i.e.

npc: true
lastAccountName: surhan6149
money: '250'

I have 17 NPCs total from Citizens.

Comparing the old usermap.csv with the newly created one, I see many of these "NPC" accounts exist in both. However I am also seeing some players who are legitimate in the old usermap.csv getting an incorrect UUID in the new usermap. Online UUID being correct in old, incorrect UUID in new.

Doing the same with usercache, the usercache.json generated itself new with correct online UUIDs, so Essentials is what's broken?

commented

usercache.json is a Mojang/Bukkit thing

commented

Right, but why would Essentials be generating the incorrect UUID when the Mojang/Bukkit one doesn't?

commented

No clue, this isn't the part of the code I generally touch, we're discussing this in internal channels but I'd like to point out again the most recent commit is not causing the problem, it's just adding proper logging so we can see when the problem occurs so we can debug it.

commented

Sure. Let me know if you need me to do any special testing or if there is a way to log specifically what plugin / event is requesting the creation of the new files to figure out where it is coming from. Generating the usermap with online UUIDs like usercache seems fairly important.

commented

I have a same problem. What is the fix for this?

commented

@andris155 Can open a new issue while making sure to fill out the entire issue template with your error in it?

commented
commented

@mibby quick question, have you used any other server software other than Paper on your server (with the same userdata) If yes, which one(s)?

commented

@JRoy I've tested Paper, Tuinity, Purpur, Origami, & Yatopia over the last couple months or so, depending on what needed testing (upstream fixes, changes, performance benching). All should be Paper derivative and I don't believe had any patches affecting offline mode (Bungee online).

I haven't had any usercache issues being incorrect or Waterfall (BungeeCord) not forwarding an online UUID correctly. Nor have I had anyone complain about their Essentials file or player.dat not loading / resetting due to a UUID changing. Just the Essential's usermap.csv being wrong and for some reason generating thousands of new UUIDs / invalid UUID for legitimate users / NPCs.

commented

Ah Yatopia, that's what I feared. Yatopia had a patch for the longest time that was corrupting users' UUIDs with offline mode UUIDs which is probably how this "bug" exists in the first place.

commented

Where does the bug persist if the main usercache is regenerated fine? User.dats in the world folder also seem fine. Is it the Essential player files that are permanently destroyed?

commented

Where does the bug persist if the main usercache is regenerated fine? User.dats in the world folder also seem fine. Is it the Essential player files that are permanently destroyed?

Vanilla's user cache merely maps looked-up UUIDs to the a user's name. That will generate fine 100% of the time (as long as you didn't use Yatopia). It's my understanding that Essentials could have generated userdata when you were using Yatopia and caused some UUID mismatches and EssX tries not to merge any of that data due to it possibly conficting.

commented

Also @mibby what did you use Citizens for? Did NPCs have the same names of your players by any chance?

commented

I presume some form of UUID validation or sanity checking (clean-up command?) would need to be added to help restore or rename the userdata files with a last account name attached to a different UUID it is suppose to be on? Which could be problematic if someone changed their name...

Or a command to move invalid Essential UUIDs from players that don't have a matching world uuid player.dat to an invalid folder?

Currently Citizens is used in my main spawn area with various commands attached to them. I do not name them after players but do occasionally re-use the skin of some active players. Prior to that, I used Citizens extensively in an adventure / questing world (~300 NPCs).

commented

Thanks for answering! The rest of the team and I will be looking into an adequate solution to this problem as soon as possible!

commented

Let me know if you need me to send you a zip of my essentials userdata / world player data for testing!

commented

Should I create another bug report if we have the same issue and we've never used anything other than Paper, or do you have enough information already?

commented

Should I create another bug report if we have the same issue and we've never used anything other than Paper, or do you have enough information already?

New issue

commented

@JRoy Follow-up. The bug with fake / incorrect players might be caused by PlaceholderAPI?

For reference;
PlaceholderAPI 2.10.10-DEV 122
PAPI-Expansion-DeluxeTags
PAPI-Expansion-Essentials
PAPI-Expansion-Javascript
PAPI-Expansion-Player
PAPI-Expansion-Server
PAPI-Expansion-Vault

[09:25:43] [Craft Scheduler Thread - 0 - PlaceholderAPI/ERROR]: [Essentials] Account creation was requested for NPC user felicia98520, but an account file with UUID 803513dd-6d7f-3ced-a1d6-550465175470 already exists.
java.lang.RuntimeException: null
	at com.earth2me.essentials.api.Economy.createNPCFile(Economy.java:57) ~[?:?]
	at com.earth2me.essentials.api.Economy.createNPC(Economy.java:890) ~[?:?]
	at net.milkbowl.vault.economy.plugins.Economy_Essentials.createPlayerAccount(Economy_Essentials.java:93) ~[?:?]
	at net.milkbowl.vault.economy.plugins.Economy_Essentials.getBalance(Economy_Essentials.java:81) ~[?:?]
	at net.milkbowl.vault.economy.AbstractEconomy.getBalance(AbstractEconomy.java:22) ~[?:?]
	at com.extendedclip.papi.expansion.vault.VaultEcoHook.getBalance(VaultEcoHook.java:220) ~[?:?]
	at com.extendedclip.papi.expansion.vault.BalTopTask.run(BalTopTask.java:48) ~[?:?]
	at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[1.16.5-patched.jar"]
	at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:58) ~[1.16.5-patched.jar"]
	at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[1.16.5-patched.jar"]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
	at java.lang.Thread.run(Thread.java:832) [?:?]
[09:25:43] [Craft Scheduler Thread - 0 - PlaceholderAPI/ERROR]: [Essentials] Essentials will create a new account as requested by the other plugin, but this is almost certainly a bug and should be reported.
[09:25:43] [Craft Scheduler Thread - 0 - PlaceholderAPI/INFO]: [Essentials] Found UUID 803513dd-6d7f-3ced-a1d6-550465175470 for player felicia98520, but player already has a UUID (546adf86-7eb8-4b61-9625-1faf4dd9ed44). Not replacing UUID in usermap.
java.lang.RuntimeException: null
	at com.earth2me.essentials.UserMap.trackUUID(UserMap.java:139) ~[?:?]
	at com.earth2me.essentials.api.Economy.createNPCFile(Economy.java:66) ~[?:?]
	at com.earth2me.essentials.api.Economy.createNPC(Economy.java:890) ~[?:?]
	at net.milkbowl.vault.economy.plugins.Economy_Essentials.createPlayerAccount(Economy_Essentials.java:93) ~[?:?]
	at net.milkbowl.vault.economy.plugins.Economy_Essentials.getBalance(Economy_Essentials.java:81) ~[?:?]
	at net.milkbowl.vault.economy.AbstractEconomy.getBalance(AbstractEconomy.java:22) ~[?:?]
	at com.extendedclip.papi.expansion.vault.VaultEcoHook.getBalance(VaultEcoHook.java:220) ~[?:?]
	at com.extendedclip.papi.expansion.vault.BalTopTask.run(BalTopTask.java:48) ~[?:?]
	at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[1.16.5-patched.jar"]
	at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:58) ~[1.16.5-patched.jar"]
	at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[1.16.5-patched.jar"]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
	at java.lang.Thread.run(Thread.java:832) [?:?]
[09:26:06] [Craft Scheduler Thread - 4 - PlaceholderAPI/ERROR]: [Essentials] Account creation was requested for NPC user felicia98520, but an account file with UUID 803513dd-6d7f-3ced-a1d6-550465175470 already exists.
java.lang.RuntimeException: null
	at com.earth2me.essentials.api.Economy.createNPCFile(Economy.java:57) ~[?:?]
	at com.earth2me.essentials.api.Economy.createNPC(Economy.java:890) ~[?:?]
	at net.milkbowl.vault.economy.plugins.Economy_Essentials.createPlayerAccount(Economy_Essentials.java:93) ~[?:?]
	at net.milkbowl.vault.economy.plugins.Economy_Essentials.getBalance(Economy_Essentials.java:81) ~[?:?]
	at net.milkbowl.vault.economy.AbstractEconomy.getBalance(AbstractEconomy.java:22) ~[?:?]
	at com.extendedclip.papi.expansion.vault.VaultEcoHook.getBalance(VaultEcoHook.java:220) ~[?:?]
	at com.extendedclip.papi.expansion.vault.BalTopTask.run(BalTopTask.java:48) ~[?:?]
	at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[1.16.5-patched.jar"]
	at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:58) ~[1.16.5-patched.jar"]
	at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[1.16.5-patched.jar"]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
	at java.lang.Thread.run(Thread.java:832) [?:?]
[09:26:06] [Craft Scheduler Thread - 4 - PlaceholderAPI/ERROR]: [Essentials] Essentials will create a new account as requested by the other plugin, but this is almost certainly a bug and should be reported.
[09:26:06] [Craft Scheduler Thread - 4 - PlaceholderAPI/INFO]: [Essentials] Found UUID 803513dd-6d7f-3ced-a1d6-550465175470 for player felicia98520, but player already has a UUID (546adf86-7eb8-4b61-9625-1faf4dd9ed44). Not replacing UUID in usermap.
java.lang.RuntimeException: null
	at com.earth2me.essentials.UserMap.trackUUID(UserMap.java:139) ~[?:?]
	at com.earth2me.essentials.api.Economy.createNPCFile(Economy.java:66) ~[?:?]
	at com.earth2me.essentials.api.Economy.createNPC(Economy.java:890) ~[?:?]
	at net.milkbowl.vault.economy.plugins.Economy_Essentials.createPlayerAccount(Economy_Essentials.java:93) ~[?:?]
	at net.milkbowl.vault.economy.plugins.Economy_Essentials.getBalance(Economy_Essentials.java:81) ~[?:?]
	at net.milkbowl.vault.economy.AbstractEconomy.getBalance(AbstractEconomy.java:22) ~[?:?]
	at com.extendedclip.papi.expansion.vault.VaultEcoHook.getBalance(VaultEcoHook.java:220) ~[?:?]
	at com.extendedclip.papi.expansion.vault.BalTopTask.run(BalTopTask.java:48) ~[?:?]
	at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[1.16.5-patched.jar"]
	at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:58) ~[1.16.5-patched.jar"]
	at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[1.16.5-patched.jar"]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
	at java.lang.Thread.run(Thread.java:832) [?:?]

Edit: Removing the Essentials & Vault expansions, there is no more error from PAPI when it is reloaded. However I do rely on the Vault placeholders. :(

Edit2: Partially worked around the dependence of those expansions by using the LuckPerms extension instead.

commented

Looking up an IP with /seen also seems to cause the initial reported error explosion. Partial paste since the error occurred 11,623 times.
https://paste.gg/p/anonymous/f954950a2b804866badf93640fefd3ee/files/b01001715a924a09901b7dfe68ca3ea6/raw

commented

I am having the exact same issues. Removing PlaceholderAPI fixed the issue.

commented

Hello, this issue has been mitigated in recent EssentialsX dev builds!

If you currently have damaged data, you can read more about the steps you can take to fix this and prevent further issues of this sort here.

Download the latest dev build here.