ericgrandt / TotalEconomy

All in one economy plugin for Minecraft.
https://ericgrandt.github.io/TotalEconomy/
MIT License
32 stars 33 forks source link

Total Economy DB Connection #279

Closed tmoflash closed 5 years ago

tmoflash commented 6 years ago

Sponge Version: spongevanilla-1.12.2-7.1.0-BETA-59 Forge Version: N/A Total Economy Version: TotalEconomy-1.8.1

Description of issue

I need a little guidance connecting to the database. To give a little more information here is the background of the issue.

I am using a panel that runs inside of a docker. Now I have set up mariadb/mysql and bind-address: 0.0.0.0. I also set up a user to allow “%” access from any ip. I know my docker ip. Now I have other plugins that are connecting fine. I am running into issues with total economy. TE runs fine not connected to database but I would like to use it across bungee network.

database { enable=true password=“mypassword” url=“mysql://[172.18.0.1]:[3306]/[totaleconomy]” user=“minecraft” }

Any suggestions on how to get this to work?

Console errors

[17:19:43 ERROR] [Sponge]: Could not pass GamePreInitializationEvent$Impl to Plugin{id=totaleconomy, name=Total Economy, version=1.8.1, description=All in one economy plugin for Minecraft/Sponge, source=mods/TotalEconomy-1.8.1.jar}

Steps to reproduce

I can remove db connection and TE loads fine. Cannot when trying to connect.

Related Configuration Files

Create a Gist (https://gist.github.com/) for each configuration file related to this issue

MarkL4YG commented 6 years ago

You're using Pterodactyl? ;)

The square brackets are meant to be replaced too.

tmoflash commented 6 years ago

Yes I am using Pterodactyl - guess the ip gave it away..hehe

I removed the brackets but still getting error:

``[15:44:36 ERROR] [Sponge]: Could not pass GamePreInitializationEvent$Impl to Plugin{id=totaleconomy, name=Total Economy, version=1.8.1, description=All in one economy plugin for Minecraft/Sponge, source=mods/TotalEconomy-1.8.1.jar} java.lang.NullPointerException: null at com.erigitic.main.TotalEconomy.loadCurrencies(TotalEconomy.java:374) ~[TotalEconomy.class:?] at com.erigitic.main.TotalEconomy.preInit(TotalEconomy.java:156) ~[TotalEconomy.class:?] at org.spongepowered.common.event.listener.GamePreInitializationEventListener_TotalEconomy_preInit42.handle(Unknown Source) ~[?:?] at org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:95) ~[RegisteredListener.class:1.12.2-7.1.0-BETA-59] at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:423) [SpongeEventManager.class:1.12.2-7.1.0-BETA-59] at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:459) [SpongeEventManager.class:1.12.2-7.1.0-BETA-59] at org.spongepowered.common.SpongeImpl.postEvent(SpongeImpl.java:223) [SpongeImpl.class:1.12.2-7.1.0-BETA-59] at org.spongepowered.common.SpongeImpl.postState(SpongeImpl.java:231) [SpongeImpl.class:1.12.2-7.1.0-BETA-59] at org.spongepowered.server.SpongeVanilla.preInitialize(SpongeVanilla.java:121) [SpongeVanilla.class:1.12.2-7.1.0-BETA-59] at net.minecraft.server.dedicated.DedicatedServer.handler$onServerLoad$bab000(SourceFile:1234) [nz.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(SourceFile:117) [nz.class:?] at net.minecraft.server.MinecraftServer.run(SourceFile:434) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]

tmoflash commented 6 years ago

One question I have. I am using maria db and that is how I am connecting to the other plugin. Does it matter if I use mysql but use the user

User Host Password minecraft % *encryptedPassword

What I am saying is. I know I can "use mysql" but I want to make sure that the user minecraft which has the wild card has access to mysql/mariadb or should I create a separate user for each?

MarkL4YG commented 6 years ago

I don't see anything preventing you from doing that.

Would you mind creating a gist with you server logs and your main TE configuration (password redacted of course)?

MarkL4YG commented 6 years ago

And what gave it away was more the concept of a panel dockerizing the game servers as there's few competition to Pterodactyl out there using that concept.

tmoflash commented 6 years ago

I was out of town for a few days, I'll take a look and post shortly

tmoflash commented 6 years ago

I have been out working on other things. What logs do you need? I am still having same issue.

enable=true password=somepass url=“mysql://172.18.0.1:3306/totaleconomy” user=“minecraft”

tmoflash commented 6 years ago

Here is the gist - https://gist.github.com/tmoflash/f56f62141d4bf3ca1785659b9245ccd2

tmoflash commented 6 years ago

Any insight on anything I can check?

MarkL4YG commented 6 years ago

Caught up on work for university. But be assured - I won't forget about the issue ^^`

MarkL4YG commented 6 years ago

You've got an issue with your configuration files.
The NullPointerException raised in this line will cause TotalEconomy to not initialize correctly.

Correct the issue with the config and see if it works.

At the moment TE isn't really that good at dealing with misconfiguration (especially syntax errors) to be honest but I'm sure this will improve in the future.

Here is the Exception thrown by the parser for your config by the way:

java.io.IOException: com.typesafe.config.ConfigException$Parse: Reader: 15: Expecting close brace } or a comma, got ':' (if you intended ':' to be part of a key or string value, try enclosing the key or value in double quotes, or you may be able to rename the file .properties rather than .conf)
    at ninja.leaping.configurate.loader.AbstractConfigurationLoader.load(AbstractConfigurationLoader.java:145) ~[configurate-core-3.5.jar:?]
    at ninja.leaping.configurate.loader.ConfigurationLoader.load(ConfigurationLoader.java:58) ~[configurate-core-3.5.jar:?]
    at com.erigitic.main.TotalEconomy.loadConfig(TotalEconomy.java:261) [TotalEconomy.class:?]
    at com.erigitic.main.TotalEconomy.preInit(TotalEconomy.java:154) [TotalEconomy.class:?]
    at org.spongepowered.common.event.listener.GamePreInitializationEventListener_TotalEconomy_preInit20.handle(Unknown Source) [?:?]
    at org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:95) [RegisteredListener.class:?]
    at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:423) [SpongeEventManager.class:?]
    at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:459) [SpongeEventManager.class:?]
    at org.spongepowered.common.SpongeImpl.postEvent(SpongeImpl.java:233) [SpongeImpl.class:?]
    at org.spongepowered.common.SpongeImpl.postState(SpongeImpl.java:241) [SpongeImpl.class:?]
    at org.spongepowered.server.SpongeVanilla.preInitialize(SpongeVanilla.java:121) [SpongeVanilla.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.handler$onServerLoad$zpn000(DedicatedServer.java:1371) [DedicatedServer.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:123) [DedicatedServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:515) [MinecraftServer.class:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
Caused by: com.typesafe.config.ConfigException$Parse: Reader: 15: Expecting close brace } or a comma, got ':' (if you intended ':' to be part of a key or string value, try enclosing the key or value in double quotes, or you may be able to rename the file .properties rather than .conf)
    at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parseError(ConfigDocumentParser.java:201) ~[config-1.3.1.jar:?]
    at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parseError(ConfigDocumentParser.java:197) ~[config-1.3.1.jar:?]
    at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parseObject(ConfigDocumentParser.java:526) ~[config-1.3.1.jar:?]
    at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parseValue(ConfigDocumentParser.java:247) ~[config-1.3.1.jar:?]
    at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parseObject(ConfigDocumentParser.java:456) ~[config-1.3.1.jar:?]
    at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parse(ConfigDocumentParser.java:646) ~[config-1.3.1.jar:?]
    at com.typesafe.config.impl.ConfigDocumentParser.parse(ConfigDocumentParser.java:14) ~[config-1.3.1.jar:?]
    at com.typesafe.config.impl.Parseable.rawParseValue(Parseable.java:260) ~[config-1.3.1.jar:?]
    at com.typesafe.config.impl.Parseable.rawParseValue(Parseable.java:248) ~[config-1.3.1.jar:?]
    at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:180) ~[config-1.3.1.jar:?]
    at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:174) ~[config-1.3.1.jar:?]
    at com.typesafe.config.impl.Parseable.parse(Parseable.java:299) ~[config-1.3.1.jar:?]
    at com.typesafe.config.ConfigFactory.parseReader(ConfigFactory.java:622) ~[config-1.3.1.jar:?]
    at ninja.leaping.configurate.hocon.HoconConfigurationLoader.loadInternal(HoconConfigurationLoader.java:174) ~[configurate-hocon-3.5.jar:?]
    at ninja.leaping.configurate.hocon.HoconConfigurationLoader.loadInternal(HoconConfigurationLoader.java:55) ~[configurate-hocon-3.5.jar:?]
    at ninja.leaping.configurate.loader.AbstractConfigurationLoader.load(AbstractConfigurationLoader.java:136) ~[configurate-core-3.5.jar:?]
    ... 14 more
ericgrandt commented 5 years ago

Is it safe to close this issue? I think a separate issue should be made regarding proper handling of config issues.

wittyphantom333 commented 5 years ago

Yes. I was able to find out it was the driver it was using to connect to MySQL was old.

Think it was resolved.

Sent from my iPhone

On Dec 11, 2018, at 9:57 AM, Eric notifications@github.com<mailto:notifications@github.com> wrote:

Is it safe to close this issue? I think a separate issue should be made regarding proper handling of config issues.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Erigitic/TotalEconomy/issues/279#issuecomment-446254702, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMWFKiegeqxDunzO-x1naXApJ4UN8UIlks5u39X-gaJpZM4UsoKH.

ghost commented 5 years ago

Same here...

java.lang.NullPointerException: null at com.erigitic.main.TotalEconomy.loadCurrencies(TotalEconomy.java:374) ~[TotalEconomy.class:?] at com.erigitic.main.TotalEconomy.preInit(TotalEconomy.java:156) ~[TotalEconomy.class:?] at org.spongepowered.common.event.listener.GamePreInitializationEventListener_TotalEconomy_preInit48.handle(Unknown Source) ~[?:?]

MarkL4YG commented 5 years ago

Please do not bump resolved issues. Rather check whether or not the solution applies to you issue and if it doesn't, you can always open a new issue and discuss your situation with us.