tastybento / greenhouses

Bukkit or Spigot plugin that enables biome greenhouses
GNU General Public License v2.0
4 stars 4 forks source link

Greenhouse data being removed on server reboot/unable to retrieve from database on startup. #4

Open iRaiya opened 8 years ago

iRaiya commented 8 years ago

Hey bento!

We're currently experiencing an issue with greenhouseses being unable to load from the database that greenhouse data is stored in. Whenever the server reboots, players are required to re-set their greenhouses.

This issue was noticed following upgrading to aSkyblock, version; https://github.com/tastybento/askyblock/releases/tag/3.0.0.6

The matter could be something that was occuring prior to this update though that we simply missed.

We updated greenhouses to the latest version (from spigot) but the problem persists.

Any idea on what the cause/resolution might be? Do you require additional information?

You were superb in getting back to me previously in regards to the y 1-3 bedrock/grass generation issue for aSkyblock, sorry to continue bothering you.

Kindest regards, Rai

tastybento commented 8 years ago

Okay, I'll look into it.

tastybento commented 8 years ago

Try this https://github.com/tastybento/askyblock/releases/tag/3.0.0.7 I suspect it's due to the biomes being reset when the chunks are reloaded.

iRaiya commented 8 years ago

It seems as though they're still being reset, following updating to that version, rebooting, setting greenhouses again, then rebooting again. Greenhouses set between reboots have been removed again :(

tastybento commented 8 years ago

Well, there something else going on then because I cannot replicate this problem with the latest Greenhouses and ASkyBlock (actually, I didn't see it ever yet).

Questions:

  1. When you shutdown the server, are the greenhouses correctly saved in the greenhouses.yml file?
  2. When you start the server, does it say "Loaded X greenhouses." where X is the number in the file?
  3. When players go into or out of the greenhouse, do you see enter and exit messages? Or nothing?
  4. What do you mean by "re-set" above exactly?

Things you can try:

  1. Set the debug level in config.yml to 2 - you should see messages like DEBUG [2]:Biome seting to BEACHES in the startup console.
  2. Set the debug to 3 - you'll see a lot more messages.

Do you see the messages above?

Finally, if all else fails, please zip up and dropbox me your world and greenhouse and askyblock plugin folders so I can check what other issues there may be!

iRaiya commented 8 years ago

Hey Bento!

Questions/Answers.

1: When I shut down the server, it correctly saves all greenhouses in the greenhouses.yml file.

2: When I start the server, I get;

[Greenhouses] Problem loading greenhouse

WARN 
‎09‎/‎05‎/‎2016 ‎15‎:‎20‎:‎42:

‎15‎:‎20‎:‎42:

java.lang.NullPointerException
    at com.wasteofplastic.greenhouses.Greenhouse.(Greenhouse.java:58)
    at com.wasteofplastic.greenhouses.Greenhouses.loadGreenhouses(Greenhouses.java:757)
    at com.wasteofplastic.greenhouses.Greenhouses$1.run(Greenhouses.java:516)
    at java.util.ArrayList.get(ArrayList.java:431)

This showed up under debug level 2

3; When players go in/out of greenhouse, the enter/exit messages pop up correctly before the server reboots, but not afterwards.

4; While the server is online, greenhouses are correctly written/saved in the greenhouses.yml. When the server is turned off, greenhouses remain correctly written/saved in the greenhouses.yml When the server is turned back on again, the greenhouses.yml fails to load, and is wiped to greenhouses: {}

---Below is some potentially useless information---

I also have 'slimefun v4.04' on my server. I'm unsure if this would have any influence in the matter, but the error occurs within a bunch of console lines relating to craftbukkit and slimefun,

[Slimefun] Enabling Slimefun v4.0.4
[Slimefun] Loading Files...
[Slimefun] Loading Config...
[Slimefun] Loading Items...

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: org.bukkit.Server.getOnlinePlayers()[Lorg/bukkit/entity/Player;
    at org.mcstats.Metrics.postPlugin(Metrics.java:335)
    at org.mcstats.Metrics.access$400(Metrics.java:57)
    at org.mcstats.Metrics$1.run(Metrics.java:223)
    at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftTask.run(CraftTask.java:71)
    at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
    ... 3 more

Exception in thread "Craft Scheduler Thread - 0" 
org.apache.commons.lang.UnhandledException: Plugin DisableCommands v1.5 generated an exception while executing task 17

at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: org.bukkit.Server.getOnlinePlayers()[Lorg/bukkit/entity/Player;
    at io.github.lst96.DisableCommands.metrics.Metrics.postPlugin(Metrics.java:365)
    at io.github.lst96.DisableCommands.metrics.Metrics.access$4(Metrics.java:355)
    at io.github.lst96.DisableCommands.metrics.Metrics$1.run(Metrics.java:238)
    at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftTask.run(CraftTask.java:71)
    at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
    ... 3 more

Exception in thread "Craft Scheduler Thread - 9" 
org.apache.commons.lang.UnhandledException: Plugin CS-CoreLib v1.5.3 generated an exception while executing task 795

at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: org.bukkit.Server.getOnlinePlayers()[Lorg/bukkit/entity/Player;
    at org.mcstats.Metrics.postPlugin(Metrics.java:335)
    at org.mcstats.Metrics.access$400(Metrics.java:57)
    at org.mcstats.Metrics$1.run(Metrics.java:223)
    at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftTask.run(CraftTask.java:71)
    at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
    ... 3 more

ERROR 

[Greenhouses] Problem loading greenhouse file

java.lang.NullPointerException
    at com.wasteofplastic.greenhouses.Greenhouse.(Greenhouse.java:58)
    at com.wasteofplastic.greenhouses.Greenhouses.loadGreenhouses(Greenhouses.java:757)
    at com.wasteofplastic.greenhouses.Greenhouses$1.run(Greenhouses.java:516)
    at java.util.ArrayList.get(ArrayList.java:431)
    at me.mrCookieSlime.CSCoreLibPlugin.updater.Updater$UpdaterTask.connect(Updater.java:70)
    at me.mrCookieSlime.CSCoreLibPlugin.updater.Updater$UpdaterTask.run(Updater.java:58)
    at java.lang.Thread.run(Thread.java:745)

INFO 

-------- World Settings For [ASkyBlock] --------
Random Lighting Updates: false

Removed timestamps for easier reading (if it's at all relevant).

Sorry to throw this curve-ball at you. If there's a way to fix this you can be sure i'll be donating to support the development and yourself :)

iRaiya commented 8 years ago

Just to add, when I reload the plugin using 'plugman', it works 100% fine.

tastybento commented 8 years ago

The problem is clearly that the greenhouses are not loaded at start up. The error (line 58 in Greenhouses) is where the position of the greenhouse is sanity checked and it looks like the world for that greenhouse does not exist anymore maybe?

Set debug to 3.

Then look for this line just before the error: "File pos1: (some location)" - there will be two of them. Do these refer to a world that actually exists?

I think if you find the offending Greenhouse, you'll be able to have all the greenhouses load successfully. Maybe have a look through the greenhouses.yml file and look for any old worlds. Did you maybe delete a world?

iRaiya commented 8 years ago

The greenhouses.yml file resets to

greenhouses: {}

completely blank each start-up, I've tried setting different greenhouses whilst in game, using different players in different locations and it's blank each time.

Greenhouses haven't been created in other worlds either, just the one world is available.

I'll try debugging at value 3 and looking through console after work tomorrow :)