EchoPet

EchoPet

882k Downloads

Server crash on Loading entity NBT.

mibby opened this issue ยท 19 comments

commented

Server crashes as soon as a pet is spawned in when a player loads in with a saved pet. Removing EchoPets, no more server crashes, but instead a skipping entity.

EchoPets dev build 244.

[09:10:38] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraft.server.v1_7_R1.ReportedException: Loading entity NBT
    at net.minecraft.server.v1_7_R1.Entity.f(Entity.java:1260) ~[spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.EntityTypes.a(SourceFile:155) ~[spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.ChunkRegionLoader.loadEntities(ChunkRegionLoader.java:352) ~[spigot.jar:git-Spigot-1299]
    at org.bukkit.craftbukkit.v1_7_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:47) ~[spigot.jar:git-Spigot-1299]
    at org.bukkit.craftbukkit.v1_7_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:13) ~[spigot.jar:git-Spigot-1299]
    at org.bukkit.craftbukkit.v1_7_R1.util.AsynchronousExecutor$Task.finish(AsynchronousExecutor.java:179) ~[spigot.jar:git-Spigot-1299]
    at org.bukkit.craftbukkit.v1_7_R1.util.AsynchronousExecutor.finishActive(AsynchronousExecutor.java:287) ~[spigot.jar:git-Spigot-1299]
    at org.bukkit.craftbukkit.v1_7_R1.chunkio.ChunkIOExecutor.tick(ChunkIOExecutor.java:30) ~[spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:621) ~[spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:273) ~[spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:560) ~[spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:467) [spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [spigot.jar:git-Spigot-1299]
Caused by: java.lang.NullPointerException
    at io.github.dsh105.echopet.entity.living.EntityLivingPet.getBukkitEntity(EntityLivingPet.java:30) ~[?:?]
    at io.github.dsh105.echopet.entity.living.EntityLivingPet.getBukkitEntity(EntityLivingPet.java:8) ~[?:?]
    at net.minecraft.server.v1_7_R1.Entity.f(Entity.java:1217) ~[spigot.jar:git-Spigot-1299]
    ... 12 more
[09:10:38] [Server thread/ERROR]:   Cause of unexpected exception was
java.lang.NullPointerException
    at io.github.dsh105.echopet.entity.living.EntityLivingPet.getBukkitEntity(EntityLivingPet.java:30) ~[?:?]
    at io.github.dsh105.echopet.entity.living.EntityLivingPet.getBukkitEntity(EntityLivingPet.java:8) ~[?:?]
    at net.minecraft.server.v1_7_R1.Entity.f(Entity.java:1217) ~[spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.EntityTypes.a(SourceFile:155) ~[spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.ChunkRegionLoader.loadEntities(ChunkRegionLoader.java:352) ~[spigot.jar:git-Spigot-1299]
    at org.bukkit.craftbukkit.v1_7_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:47) ~[spigot.jar:git-Spigot-1299]
    at org.bukkit.craftbukkit.v1_7_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:13) ~[spigot.jar:git-Spigot-1299]
    at org.bukkit.craftbukkit.v1_7_R1.util.AsynchronousExecutor$Task.finish(AsynchronousExecutor.java:179) ~[spigot.jar:git-Spigot-1299]
    at org.bukkit.craftbukkit.v1_7_R1.util.AsynchronousExecutor.finishActive(AsynchronousExecutor.java:287) ~[spigot.jar:git-Spigot-1299]
    at org.bukkit.craftbukkit.v1_7_R1.chunkio.ChunkIOExecutor.tick(ChunkIOExecutor.java:30) ~[spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:621) ~[spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:273) ~[spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:560) ~[spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:467) [spigot.jar:git-Spigot-1299]
    at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [spigot.jar:git-Spigot-1299]

http://paste.ubuntu.com/6855881/

commented

@DSH105

Using dev build 253, server thread froze / crashed when restarting server.

http://paste.ubuntu.com/6881135/

Edit: Two more crashes using build 253. Downgraded to 245 in the meantime until fixed.
http://paste.ubuntu.com/6881172/
http://paste.ubuntu.com/6881174/

commented

@mibby Shouldn't have that issue now :).

commented

@DSH105

Updated to build 255, crash still occurs. Loading entity NBT.
http://paste.ubuntu.com/6892560/

I have 20 more crash logs if needed. :(

Potentially related. Someone has informed me that at least 3 chunks have regenerated destroying everything that was previously on it. Possibly related to this NBT error loading in the chunk?

commented

Uh, my bad. That one was a coding error by me :\

commented
commented

Also relevant: 3bf4396

commented

Uptime 4 hours with the latest dev build, starting to see these warnings in console.

[14:03:15] [Server thread/WARN]: Wrong location for EntitySpiderPet['Pet Spider'/874476, l='world', x=12.06, y=90.60, z=11904.09] in world 'world'!
[14:03:15] [Server thread/WARN]: Entity is at 12.060563799601475,11904.092675303595 (chunk 0,744) but was stored in chunk -6,750
[14:14:46] [Server thread/WARN]: Wrong location for EntitySpiderPet['Pet Spider'/940445, l='world', x=-67.26, y=84.00, z=11923.58] in world 'world'!
[14:14:46] [Server thread/WARN]: Entity is at -67.25912000821546,11923.578823166441 (chunk -5,745) but was stored in chunk 2,742
[14:14:55] [Server thread/WARN]: Wrong location for EntitySpiderPet['Pet Spider'/941004, l='world', x=-63.70, y=84.00, z=11920.64] in world 'world'!
[14:14:55] [Server thread/WARN]: Entity is at -63.699999988079064,11920.638740948722 (chunk -4,745) but was stored in chunk 2,742
[14:15:41] [Server thread/WARN]: Wrong location for EntitySpiderPet['Pet Spider'/945034, l='world', x=42.50, y=74.00, z=11881.70] in world 'world'!
[14:15:41] [Server thread/WARN]: Entity is at 42.49957178470554,11881.704690686078 (chunk 2,742) but was stored in chunk -4,745
[14:38:04] [Server thread/WARN]: Wrong location for EntitySpiderPet['Pet Spider'/1102886, l='world', x=-63.70, y=84.00, z=11920.75] in world 'world'!
[14:38:04] [Server thread/WARN]: Entity is at -63.69999998807904,11920.752479677834 (chunk -4,745) but was stored in chunk 2,743
[14:42:08] [Server thread/WARN]: Wrong location for EntitySpiderPet['Pet Spider'/1128520, l='world', x=11.27, y=77.66, z=11901.69] in world 'world'!
[14:42:08] [Server thread/WARN]: Entity is at 11.274868108535145,11901.687579105661 (chunk 0,743) but was stored in chunk 1,744
[14:47:01] [Server thread/WARN]: Wrong location for EntitySquidPet['Pet Squid'/1147907, l='world', x=-8308.52, y=75.02, z=-6910.31] in world 'world'!
[14:47:01] [Server thread/WARN]: Entity is at -8308.522545095915,-6910.307036821772 (chunk -520,-432) but was stored in chunk -526,-431
[14:56:41] [Server thread/WARN]: Wrong location for EntitySquidPet['Pet Squid'/1192644, l='world', x=-8432.95, y=19.00, z=-6753.17] in world 'world'!
[14:56:41] [Server thread/WARN]: Entity is at -8432.947881735336,-6753.169979938646 (chunk -528,-423) but was stored in chunk -523,-429
commented

Just downgrade to before I started fixing this NBT stuff. I'm lost for what to do now.

commented

@DSH105

Updated to dev 264. Will let you know if the server crashes. In the meantime, two new errors.

#181
#182

commented

Committed some stuff tonight. Let's see what it can do.

commented

So how is this looking so far? :)

commented

No crash on latest dev build since updating. Closing this ticket for now. :)

commented

\o/

commented

What build were you running before you updated (so I can figure out exactly which commit caused this)?

I have a pretty good idea what's doing it, meaning I'll have to implement some way of storing Pets using normal NBT data.

EDIT: Is it just Spigot that is causing this?

commented

I updated from build 238 to 244.
http://echopet.hawkfalcon.com/job/EchoPet/changes

I have not tested CraftBukkit yet, but build 238 was working just fine in Spigot. During the same update, I updated spigot build 1292 (was working with echopets 238) to build 1299.
http://ci.md-5.net/job/Spigot/changes

commented

And does build 244 work with CB?

commented

Updated to 244 again to see how long I can get without crashing. Also for reference, updated spigot to 1301.

First crash didn't occur until twenty minutes after startup. Crashed immediately after a player logged in.

Console Error. http://paste.ubuntu.com/6859930/
Crash log. http://paste.ubuntu.com/6859937/
This is his pet saved in the pets.yml. http://paste.ubuntu.com/6859931/

Second crash occurred much sooner after startup, within a minute as players were logging in.

First console error. http://paste.ubuntu.com/6859949/
Pet of person (different person) who logged in right before the error. http://paste.ubuntu.com/6859952/
Second console error. http://paste.ubuntu.com/6859953/
Caused by the same player who logged in and crashed the server the first time. Again, his pet for reference. http://paste.ubuntu.com/6859931/
Thread dump in console log. http://paste.ubuntu.com/6859963/
Crash log 2. http://paste.ubuntu.com/6859964/

It seems some people can login and have their pet spawn in just fine, while others end up crashing the server. The whole NMS event / process of spawning and saving seems to be unsafe. :(

Rolled back to EchoPet 238, no more crashes. But in console near the beginning after startup, skipping messages occurred.

    Line 220: [00:32:06] [Server thread/WARN]: Skipping Entity with id EndermanPet
    Line 240: [00:33:16] [Server thread/WARN]: Skipping Entity with id ChickenPet
commented

Yeah, looks like I need to do a rewrite on the entities so that they can be externally created without creating problems.