EssentialsX

EssentialsX

2M Downloads

Compatibility with Towny

Opened this issue · 26 comments

commented

Information

Full output of /ess version:

[16:42:44 INFO]: Server версия: 1.15.1-R0.1-SNAPSHOT git-Paper-32 (MC: 1.15.1)
[16:42:44 INFO]: EssentialsX версия: 2.17.1.47
[16:42:44 INFO]: LuckPerms версия: 5.0.23
[16:42:44 INFO]: PlaceholderAPI версия: 2.10.4
[16:42:44 INFO]: Vault версия: 1.7.2-b107
[16:42:44 INFO]: EssentialsXProtect версия: 2.17.1.47
[16:42:44 INFO]: Towny версия: 0.95.2.4
[16:42:44 INFO]: EssentialsXSpawn версия: 2.17.1.47

Server log:

EssentialsX config
standart

Help request

Problem

Hello. The Towny plugin has been working incorrectly with EssEco for a long time. The plugin developer refers to bugs in Essentials. Can you fix compatibility with Towny, if your plugin really works incorrectly?

commented

For example, when using Essentials, money disappears from the treasures of towns and nations with random intervals. And it does not depend on the actions of the players.

commented

This is very easy to reproduce and when I have users come to me with the issue I can pretty much immediately guess that they are using essentialseco, because no other eco does it with just ease or frequency.

To reproduce the resetting of town and nation banks all that has to be done is to use /reload. It also apparently happens at random like @luckybl0ck said.

Also this is a bit rude:
Screenshot_20200102-093623_Discord

commented

Haha, sorry, my bad. I just know there's been some drama in the past.

I suppose the only thing one can really do right now is to use another economy plugin until EssX can fix the flaws in how NPC accounts are handled.

commented

That's the advice I give to users. In the past I was told by members of the Ess team to have them report their issue to you, which I continue to do. I also removed (quite a while ago) the warning message Towny used to show users of EssEco at the Ess team's request.

commented

Recommending another Economy plugin sounds like a very fair thing to do while these incompatibilities exist. Although, hopefully this can be resolved sooner than later.

As for the issue, is it possible to provide steps that reproduce the problem reliably? A sequence of commands to run (Assuming a fresh default install of Essentials & Towny) would be a great help, especially since not all of us are highly familiar with Towny.

commented

To reproduce the resetting of town and nation banks all that has to be done is to use /reload. It also apparently happens at random like @luckybl0ck said.

commented

I took note of that, but is there really no other prerequisite other than installing Towny and using /reload? Is there a global bank account for the plugin? Forgive me if I'm misunderstanding.

commented

Towns and Nations that are made by players have banks. /town deposit $ or /nation deposit $ is used to put money in those banks and the banks are where the towns and nations pay their taxes/upkeep from, pay for claiming land, etc. When the closed-economy setting is true there is also a bank account for any money that is 'disappeared' by Towny. There is also a war-spoils account which populates money for an eventual war's reward.

commented
[17:59:56 INFO]: CONSOLE issued server command: /ess version
[17:59:56 INFO]: Server version: 1.15.1-R0.1-SNAPSHOT git-Paper-29 (MC: 1.15.1)
[17:59:56 INFO]: EssentialsX version: 2.17.1.50
[17:59:56 INFO]: LuckPerms version: 5.0.56
[17:59:56 INFO]: Vault version: 1.7.2-b107
[17:59:56 INFO]: Towny version: 0.95.2.0

Without any concrete steps, this is what I attempted:

  • Install EssentialsX, LuckPerms, Vault and Towny on a Paper 1.15.1 server
  • /eco set MD678685 1000
  • As MD678685: /town create BobTown
  • As MD678685: /town deposit 10
  • /town BobTown - shows a balance of $10
  • /ess reload
  • /town BobTown - still shows a balance of $10
  • /reload confirm
  • /town BobTown - still shows a balance of $10
  • /stop and restart the server
  • /town BobTown - still shows a balance of $10

Can you provide concrete steps to reproduce this behaviour reliably? Considering EssentialsX is one of the most widely used economy backends and we have had zero reports of issues with other plugins, I'm inclined to believe there's something up with Towny's Vault economy code.

commented

Unfortunately the day it happened I was restarting the server pretty often so I'm not exactly sure when it happened. I also don't have trade logs enabled, but I'll go ahead and attach a list of my plugins.

Plugins (73): AntiVPN, AsyncWorldEdit, AuctionHouse, BetterRTP*, BlockLocker, ChestShop, Chunkmaster, Citizens, CitizensCMD, ClueScrolls, ConditionalCommands*, CoreProtect, DeluxeMenus, DeluxeTags*, DiscordSRV, DisplayItem, DoKeepInventory*, DonatorJoinPlus, Essentials, EssentialsSpawn, FishinRoulette, GadgetsMenu, Harbor, HolographicDisplays, IllegalStack, Jobs, KixsChatAnnouncer, LibsDisguises, LiteBans, LuckPerms, MarriageMaster, Matrix, mcMMO, MoneyNote*, NerfPhantoms, OreAnnouncer, PacketListenerApi*, PlaceholderAPI, Plan, PlayTime*, PluginManager*, ProtocolLib, ProtocolSupport, PunishmentGUI*, PureTickets*, Quests, ServerListPlus*, ShopGUIPlus, SimpleFreeze*, SkyStats, SpawnRangeEditor, SpecializedCrates, SuperVanish, TAB, TempFly*, TimeIsMoney*, Towny, TownyFlight, TownyNameUpdater, TradeSystem, UltimateTimber, Vault, VentureChat, Votifier, VotingPlugin, Vouchers, WildStacker, WildTools, WorldEdit, WorldGuard, WorldGuard-Towny*, XPBoost

Sorry I was so unhelpful, hope my plugin list at least helps a bit.

commented

No need to apologise, you're helping tremendously just by responding. This is certainly an elusive issue. However, the best possible thing that can happen right now is if you or someone else does figure out what causes this. It's difficult to fix a bug (or test if it's been fixed) until we know how it occurs.

commented

[08:11:01 INFO]: Server version: 1.15.1-R0.1-SNAPSHOT git-Paper-43 (MC: 1.15.1)

[08:11:01 INFO]: EssentialsX version: 2.17.1.48

[08:11:01 INFO]: PlaceholderAPI version: 2.10.4

[08:11:01 INFO]: LuckPerms version: 5.0.49

[08:11:01 INFO]: Vault version: 1.7.2-b107

[08:11:01 INFO]: Citizens version: 2.0.26-SNAPSHOT (build 1793)

[08:11:01 INFO]: ChestShop version: 3.10 (build 165)

[08:11:01 INFO]: EssentialsXSpawn version: 2.17.1.48

[08:11:01 INFO]: Towny version: 0.95.2.7

Just had the town banks get reset at seemingly random on my server, I attached all the plugin versions above. If there is any other information you need from me let me know, sorry I couldn't be of more help but I can't seem to reproduce it either.

commented
  1. Did it happen after a server restart, or after the end of a Towny day?
  2. Do you have EssentialsX's trade log enabled?

Additionally, could you post a full startup log (from Starting minecraft server version... up until Done! excluding any private information like IP addresses) on Gist? I'm curious to see if any other common plugins might introduce issues.

commented

No worries, didn't mean to come across as I did earlier.

It might be worth turning on the trade log in the EssentialsX config, as that will give us a bit more info to work with when this next happens. Set economy-log-enabled to true, and underneath add the line economy-log-update-enabled: true.

I'll see if I can replicate this by repeatedly restarting the test server. It could be a conflict with another plugin, but it's hard to tell.

Let us know if you encounter this again.

commented

Any news/ways to reproduce been uncovered?

commented

No, but from the last time we attempted to investigate this, Towny appears to be the only plugin that encounters NPC data loss with EssentialsX. Towny still hasn't provided clear steps on scenarios that can cause this and generally shoots down issue reports from EssentialsX users instead of investigating (as seen above), so we have very little information to work with.

commented

I've been using EssentialsX + Towny with paper 1.16 for a bit now and never had this issue. I've also used Essentials & EssentialsX with towny for many years and no issue.

commented

@winnipeg21 Can you send us your Essentials and Towny configs? The problem doesn't seem to occur often for anyone who's had it (as far as I can tell), however not having this issue for several years might mean that you have yours set up in a way that doesn't trigger the problem, which is potentially useful to know.

commented

Over the years I changed the configs slightly, but that shouldn't effect anything. These are the config I've used since I started working with Essentials and Towny.

EssentialsX - https://pastebin.com/2Gd6ePt8 - Ver: 2.18.0.0
Towny - https://pastebin.com/1ntB1mbB - Ver: 0.96.2.9

*I'll be gone out for a bit so sorry for the long replies if you do ask another question.

commented

Thank you! Again, the fact that you're a long standing user that has not encountered these issues is very useful information in and of itself. Hopefully the config will help. Actually, it would be really great if @luckybl0ck or @introvertism could provide their configs as well (I'm not sure why this hasn't been asked yet, but I suppose the assumption was that this happens even for standard config on both plugins).

commented

My Towny config: https://pastebin.com/kpewSkGG
My Essentials config: https://pastebin.com/6xaJEJVA

commented

@Momshroom As noted in this comment, I did test this several times with both /ess reload and /reload as well as server reboots and could not reproduce the issue at all. This includes various sporadic variations in the order of those commands which I did not document in that comment at the time.

As stated before, other plugins do not run into this issue with non-player economy accounts when EssentialsX is used as the economy backend. Unless someone can actively reproduce this and provide steps and logs to do so (either with Towny or with a test case plugin), there's not much we can do.

commented

Actually reading through this for the first time— I’m noting that it is /reload players consistently say breaks this and that Llmdl reported to use to reproduce and /ess reload that md tested with and was unable to reproduce with. Yes, I am aware that people should never use /reload, but they do, and that is the consistent way to cause this issue (as witnessed over and over in the towny discord: I’ve never used either esseco or /reload). People do report it happening occasionally without /reload.

commented

Sorry- I've never used /reload (prior to today) and honestly didn't recognize /reload confirm as /reload.

I installed essentials on a test server that had all my regular plugins and data, removed iconomy (what I've been using for economy) gave some of my existing towns and a new one all money so essentials would know they had some and did at least 15 /reloads as well as a couple of proper restarts (shut down and started). I was unable to make this break.

Completely default essentials config, version info for the test server:
[18:49:09 INFO]: CONSOLE issued server command: /essentials version
[18:49:09 INFO]: Server version: 1.16.1-R0.1-SNAPSHOT git-Paper-128 (MC: 1.16.1)
[18:49:09 INFO]: EssentialsX version: 2.18.0.0
[18:49:09 INFO]: PlaceholderAPI version: 2.10.7
[18:49:09 INFO]: LuckPerms version: 5.1.75
[18:49:09 INFO]: Vault version: 1.7.3-b131
[18:49:09 INFO]: Citizens version: 2.0.27-SNAPSHOT (build 2056)
[18:49:09 INFO]: Towny version: 0.96.2.11
[18:49:09 INFO]: CMI version: 8.7.4.1
[18:49:09 INFO]: ChestShop version: 3.11.1-SNAPSHOT (build 226)

Please note the jar running on this test server isn't quite towny 0.96.2.11, it's an early test build of it.

towny config: https://paste.gg/p/Momshroom/108a02f3c91945ac83bcd0a7bd31aec6

I don't know if this is helpful or not, but figured I would try.

commented

After a bit of discussion with someone who is MD (but not that MD) on the Towny discord it was pointed out that the code which actually creates an NPC file in Essentials is never actually called by Essentials. Instead it is decided whether to make an NPC file entirely by Vault. I do not know why an economy plugin would be letting Vault decide if an NPC file would be made.

To clear up the actual issue at hand:

  • The bank accounts reset when Essentials (or I guess Vault) decides to re-make all of the essentials files for fake player accounts with new UUIDs.

  • Players who have had the issue strike there servers find that all of the Towns/Nations original UUIDs still have files containing all of their original balances. All of the towns/nations also have new files under their new UUIDs with starting balance amounts.

  • There is no consistent way to make it happen using /reload, but sometimes it would appear that /reload is the cause, other times it just happens spontaneously (likely because Vault cannot access the essentials playermap.)

  • The argument that "no other plugin using fakeplayeraccounts has issues with Ess Eco" is reverse-able, no other economy plugin has issues with town/nation banks resetting.

After finding out today that it is Vault who decides when Essentials makes an NPC file, and not Essentials I do believe it would be worth taking that part of the workload off of Vault and having Essentials decide for itself when an NPC file should be made.

commented

Should be fixed as of 071f995