jusdino / BuildPortals

Mincreaft plugin for player-buildable teleportation portals
https://dev.bukkit.org/projects/buildportals
GNU General Public License v3.0
10 stars 5 forks source link

Null Pointer Exception on server startup #13

Closed RikuKawai closed 5 years ago

RikuKawai commented 5 years ago
[20:33:36] [Server thread/ERROR]: Error occurred while enabling BuildPortals v1.18.18 (Is it up to date?)
java.lang.NullPointerException: null
    at frahm.justin.mcplugins.buildportals.PortalFactory.loadFromConfig(PortalHandler.java:1078) ~[?:?]
    at frahm.justin.mcplugins.buildportals.PortalHandler.updatePortals(PortalHandler.java:453) ~[?:?]
    at frahm.justin.mcplugins.buildportals.Main.onEnable(Main.java:41) ~[?:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:316) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:395) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:344) ~[patched_1.12.2.jar:git-Paper-1618]
    at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:442) ~[patched_1.12.2.jar:git-Paper-1618]
    at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:403) ~[patched_1.12.2.jar:git-Paper-1618]
    at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:341) ~[patched_1.12.2.jar:git-Paper-1618]
    at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:289) ~[patched_1.12.2.jar:git-Paper-1618]
    at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:616) ~[patched_1.12.2.jar:git-Paper-1618]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
[20:33:36] [Server thread/INFO]: [BuildPortals] Disabling BuildPortals v1.18.18

Started getting this error on server startup, tried rolling back to PaperMC 1615 and still had the same error. Nothing changed on the server it just started happening.

jusdino commented 5 years ago

Can you post your BuildPortals/config.yml?

RikuKawai commented 5 years ago

config.zip

Zipped cause GitHub wouldn't take a YML file. I figured it might be a bad portal in the config, I think there's some in there still which point to worlds that don't exist anymore.

jusdino commented 5 years ago

Usually, I've seen missing worlds fail differently. What multi-world plugin are you using?

RikuKawai commented 5 years ago

The original Multiworld, which technically isn't supported anymore, but is supported for 1.12.2 which I'm running.

jusdino commented 5 years ago

Yeah, I'd be surprised if Multiworld was a problem for you on 1.12.2.

jusdino commented 5 years ago

Nothing is jumping out at me right away. I haven't played with PaperMC yet though. I'll have to dig into this some more. Would you mind packaging up all of your server files and sending them this way so I can try to figure it out?

RikuKawai commented 5 years ago

Zipping it up now, left out the worlds because it would be almost 60GB, but you should be able to reproduce the error without my worlds.

jusdino commented 5 years ago

Sounds good.

Are these all actual world names? DestinationHub Americant Sever map world ericsan Sever map_nether Sever map_the_end

One thing to try would be to remove any portals in the .yml file that reference one of the worlds above if it isn't there anymore just to see if it is actually erroring out in an unusual way with a missing world.

RikuKawai commented 5 years ago

Only DestinationHub, Americant, and ericsan still exist, I'll go through and try to remove references to the other ones which don't exist anymore.

Also here's the server stripped of worlds (and the coreprotect db) https://mega.nz/#!ad0jlSpJ!U1PoISWHaBtoO4SRfVQO2-hy6QD5_0JqYALXLxGLHsY

RikuKawai commented 5 years ago

I removed the unused portals and it still fails to load the plugin with the same error, so it's something else.

jusdino commented 5 years ago

Okay, mind trying this snapshot build to confirm if it fixes your issue? https://frahm.pw/BuildPortals-1.18.115-SNAPSHOT.jar

RikuKawai commented 5 years ago

The plugin loads and functions correctly now. What was the issue?

jusdino commented 5 years ago

Awesome. So, when loading sides A and B of a portal from config, I had a check that worldB was located by name properly but evidently forgot to do the same for worldA. If worldA didn't exist, it would throw that NullPointerException instead of failing gracefully.

RikuKawai commented 5 years ago

I think I understand what happened then. Sometimes the portals stop working and need to be forcefully updated by activating one of them, which normally happens before the next time the server is restarted. However in this case my server restarted itself due to an unrelated crash, leaving BuildPortals in this state which would then refuse to load.