micdoodle8 / Galacticraft

An advanced Space Dimension Mod for Minecraft
Other
615 stars 333 forks source link

[ComputerCraft] Server console exception message when the last player leaves the game #1377

Closed Arisina closed 9 years ago

Arisina commented 9 years ago

[Quick summary]

Forge version: 10.13.2.1258 Java version: 1.7 Severity: Non-CripplingUnknown; Error:

Exception caught during firing event net.minecraftforge.event.entity.EntityEvent$EntityConstructing@79534c76: java.lang.NoSuchMethodError: micdoodle8.mods.galacticraft.core.entities.player.GCPlayerHandler.onEntityConstructingClient(Lnet/minecraftforge/event/entity/EntityEvent$EntityConstructing;)V

[End of quick summary]

Hello I am not entirely sure this issue occurs solely due to a problem in GC (as I see some methods being called are that of other mods'), but since the error message first points to a supposedly missing method in GC, I am reporting the exception in here. To this date this error does not seem to stop the server at its time of occurrence, but may be related to a server-freeze that I am experiencing repeatedly.

The server is running on forge version 1.7.10-10.13.2.1258, using server JRE 1.7. It has many other mods (two of them do appear in the exception message - SGcraft and Computercraft. Since the problem seems to be invoked by the latter, maybe it's their issue and I should report to them.) I did try running the test-version server stripped of all the other mods to see if the issue persists, and so far it didn't, but obviously that's not the option for the main server.

The following error message occurs one to multiple times when the last player leaves the game (I presume this issue relates to chunk unloading; but using chunk loader does not prevent this error from happening, possibly due to limited coverage area). Obviously the number behind EntityConstructing@ changes each time the exception is caught (as well as the entity related to the error):

[06:32:12] [Thread-258891/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.entity.EntityEvent$EntityConstructing@79534c76: java.lang.NoSuchMethodError: micdoodle8.mods.galacticraft.core.entities.player.GCPlayerHandler.onEntityConstructingClient(Lnet/minecraftforge/event/entity/EntityEvent$EntityConstructing;)V at micdoodle8.mods.galacticraft.core.entities.player.GCPlayerHandler.onEntityConstructing(GCPlayerHandler.java:104) ~[GCPlayerHandler.class:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler_77_GCPlayerHandler_onEntityConstructing_EntityConstructing.invoke(.dynamic) ~[?:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54) ~[ASMEventHandler.class:?] at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138) [EventBus.class:?] at net.minecraft.entity.Entity.(Entity.java:179) [sa.class:?] at net.minecraft.entity.EntityLivingBase.(EntityLivingBase.java:119) [sv.class:?] at net.minecraft.entity.EntityLiving.(EntityLiving.java:68) [sw.class:?] at net.minecraft.entity.EntityCreature.(SourceFile:23) [td.class:?] at net.minecraft.entity.passive.EntityWaterMob.(SourceFile:19) [wu.class:?] at net.minecraft.entity.passive.EntitySquid.(SourceFile:25) [ws.class:?] at sun.reflect.GeneratedConstructorAccessor73.newInstance(Unknown Source) [?:1.7.0_21] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:1.7.0_21] at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [?:1.7.0_21] at net.minecraft.entity.EntityList.func_75615_a(EntityList.java:160) [sg.class:?] at net.minecraft.world.chunk.storage.AnvilChunkLoader.loadEntities(AnvilChunkLoader.java:465) [aqk.class:?] at net.minecraftforge.common.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:41) [ChunkIOProvider.class:?] at net.minecraftforge.common.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:12) [ChunkIOProvider.class:?] at net.minecraftforge.common.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:344) [AsynchronousExecutor.class:?] at net.minecraftforge.common.util.AsynchronousExecutor.getSkipQueue(AsynchronousExecutor.java:302) [AsynchronousExecutor.class:?] at net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:12) [ChunkIOExecutor.class:?] at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:126) [ms.class:?] at net.minecraft.world.gen.ChunkProviderServer.func_73158_c(ChunkProviderServer.java:101) [ms.class:?] at net.minecraft.world.gen.ChunkProviderServer.func_73154_d(ChunkProviderServer.java:199) [ms.class:?] at net.minecraft.world.World.func_72964_e(World.java:419) [ahb.class:?] at net.minecraft.world.World.func_147438_o(World.java:2536) [ahb.class:?] at gcewing.sg.cc.CCSGPeripheral.getInterfaceTE(CCSGPeripheral.java:115) [CCSGPeripheral.class:?] at gcewing.sg.cc.CCSGPeripheral.detach(CCSGPeripheral.java:151) [CCSGPeripheral.class:?] at dan200.computercraft.core.apis.PeripheralAPI$PeripheralWrapper.detach(PeripheralAPI.java:86) [PeripheralAPI$PeripheralWrapper.class:?] at dan200.computercraft.core.apis.PeripheralAPI.shutdown(PeripheralAPI.java:367) [PeripheralAPI.class:?] at dan200.computercraft.core.computer.Computer$2.execute(Computer.java:756) [Computer$2.class:?] at dan200.computercraft.core.computer.ComputerThread$1$1.run(ComputerThread.java:115) [ComputerThread$1$1.class:?] at java.lang.Thread.run(Thread.java:722) [?:1.7.0_21] [06:32:12] [Thread-258891/ERROR] [FML]: Index: 1 Listeners: [06:32:12] [Thread-258891/ERROR] [FML]: 0: NORMAL [06:32:12] [Thread-258891/ERROR] [FML]: 1: ASM: micdoodle8.mods.galacticraft.core.entities.player.GCPlayerHandler@3e7f9b8d onEntityConstructing(Lnet/minecraftforge/event/entity/EntityEvent$EntityConstructing;)V [06:32:12] [Thread-258891/ERROR] [FML]: 2: ASM: micdoodle8.mods.galacticraft.planets.asteroids.entities.player.AsteroidsPlayerHandler@3cda07e7 onEntityConstructing(Lnet/minecraftforge/event/entity/EntityEvent$EntityConstructing;)V [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: java.lang.reflect.InvocationTargetException [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at sun.reflect.GeneratedConstructorAccessor73.newInstance(Unknown Source) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.entity.EntityList.func_75615_a(EntityList.java:160) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.world.chunk.storage.AnvilChunkLoader.loadEntities(AnvilChunkLoader.java:465) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraftforge.common.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:41) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraftforge.common.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:12) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraftforge.common.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:344) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraftforge.common.util.AsynchronousExecutor.getSkipQueue(AsynchronousExecutor.java:302) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:12) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:126) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.world.gen.ChunkProviderServer.func_73158_c(ChunkProviderServer.java:101) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.world.gen.ChunkProviderServer.func_73154_d(ChunkProviderServer.java:199) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.world.World.func_72964_e(World.java:419) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.world.World.func_147438_o(World.java:2536) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at gcewing.sg.cc.CCSGPeripheral.getInterfaceTE(CCSGPeripheral.java:115) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at gcewing.sg.cc.CCSGPeripheral.detach(CCSGPeripheral.java:151) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at dan200.computercraft.core.apis.PeripheralAPI$PeripheralWrapper.detach(PeripheralAPI.java:86) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at dan200.computercraft.core.apis.PeripheralAPI.shutdown(PeripheralAPI.java:367) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at dan200.computercraft.core.computer.Computer$2.execute(Computer.java:756) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at dan200.computercraft.core.computer.ComputerThread$1$1.run(ComputerThread.java:115) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at java.lang.Thread.run(Thread.java:722) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: Caused by: java.lang.NoSuchMethodError: micdoodle8.mods.galacticraft.core.entities.player.GCPlayerHandler.onEntityConstructingClient(Lnet/minecraftforge/event/entity/EntityEvent$EntityConstructing;)V [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at micdoodle8.mods.galacticraft.core.entities.player.GCPlayerHandler.onEntityConstructing(GCPlayerHandler.java:104) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at cpw.mods.fml.common.eventhandler.ASMEventHandler_77_GCPlayerHandler_onEntityConstructing_EntityConstructing.invoke(.dynamic) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.entity.Entity.(Entity.java:179) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.entity.EntityLivingBase.(EntityLivingBase.java:119) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.entity.EntityLiving.(EntityLiving.java:68) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.entity.EntityCreature.(SourceFile:23) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.entity.passive.EntityWaterMob.(SourceFile:19) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: at net.minecraft.entity.passive.EntitySquid.(SourceFile:25) [06:32:12] [Thread-258891/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:747]: ... 22 more [06:32:12] [Thread-258891/WARN] [net.minecraft.entity.EntityList]: Skipping Entity with id Squid
(id Squid will of course may change to Creeper, Skeleton, etc.)

The problem is, while this problem is reproducible (well, it happens a lot of time), it is not always so. Usually a short connection does not incur the problem; when a player is logged in for a sufficiently long time (at least 5 to 10 minutes, I presume) this message will always come up, and that's what usually average players will do.

Also, this error message will be the last error message to show on the server console log when the server freezes (server log will vary: it will sometimes indicate it was collecting IDs to save before it stopped responding, thus leaving some time between the exception being thrown and the actual time of it being frozen; in other cases the error will be the last log to been written.)

This error persisted since version 3.0.6 232 (I don't know if it existed in the earlier version, for before that I was using MC 1.6).

Could this error be due to too many mob entities in the server?

Thank you, and have a nice day.

p.s. I see that there is a new version out, and I did test that in a test environment and have confirmed the issue persists; but I cannot currently update the main server due to several issues that I have yet to manage, so I am leaving the old version number in the title.

p.s.s. Is there a working tag to wrap the error log part? I see it's quite long and thought it would be more preferable if it could be hidden/shown at a click, but did a quick search and seems like there is no such thing in markdown...

radfast commented 9 years ago

I didn't understand everything you wrote, but I understand you to be saying that this is an error which you are seeing server-side

That is significant, because in that case the cause of the error is that client-side only code is trying to run on the server. A Minecraft dedicated server does not have the client-side code on it (or in the case of a mod like Galacticraft here, it is present but suppressed by the @SideOnly(Side.CLIENT) annotation) and that is why the "NoSuchMethod" error is produced.

Galacticraft is correctly checking whether it is running on client or server here, see https://github.com/micdoodle8/Galacticraft/blob/master/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCPlayerHandler.java#L102

That leads me to suspect that the cause of the error is that ComputerCraft is somehow firing Forge / FML events on the server which, in error, appear to be flagged as client-side when it is on a server. But, I am in no way a ComputerCraft expert, I am not aware of exactly how it might be able to do that - I am simply making inferences from what I can see in that stacktrace and without looking at ComputerCraft source code.

I think there is no error in Galacticraft's code here, and this is an issue you should be raising with ComputerCraft. I'm happy for you to show them what I wrote. I emphasise again, I am not 100% pointing the blame at them, I have not taken the time to diagnose this fully or to understand how their mod works.

radfast commented 9 years ago

To answer your second PS, the best way to put up a long log or log extract is to paste it up in a Github Gist (or elsewhere) and put a link to that in your issue report.

It would make it much easier to read, as well, because Gist does not wrap the lines...

Arisina commented 9 years ago

Thank you for your thorough reply, radfast. As for the text wrapping, I'll try that from the next time.

As for the issue I have reported, yes, this was a server-side console error, and I can see that the code is written to check whether it's running in server or client. I too have no idea why the client-only method would be called, but I guess I'll notify the CC forum and GC author. In the meantime, I will be searching for the way to display the remaining 22 errors to see if I can get more information out of it (if there's a way to do it, would you be so kind as to tell me, please?)

By the way, would the issue be solved if the if clause for client-check was brought first? i.e.

public void onEntityConstructing(EntityEvent.EntityConstructing event)
{
    if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
    {
        this.onEntityConstructingClient(event);
    }
    if (event.entity instanceof EntityPlayerMP && GCPlayerStats.get((EntityPlayerMP) event.entity) == null)
    {
        GCPlayerStats.register((EntityPlayerMP) event.entity);
    }
}

I am not a programmer (only learned basic Java back in my undergraduate period), so I may be wrong to suggest something like this - and actually I am more worried that such change may break the code.

Again, I appreciate your help on this subject. I'll let you know if I get some new information.

radfast commented 9 years ago

No the code order change you have suggested makes no difference. Galacticraft is already correctly coded so that the client-side code (inside the curly braces) will only be called if FMLCommonHandler says that the EffectiveSide is the client.

I'm not sure what you mean about 22 other errors. It's best to paste up either your full fml-server-latest log, or unedited extracts, on a Gist or Pastebin or other cloud-type pasting site.

radfast commented 9 years ago

I'm going to close this now as not being a Galacticraft issue, because I think the cause is ComputerCraft. If it turns out to be a Galacticraft issue we can re-open.

radfast commented 9 years ago

OK sorry it was "kind of" a Galacticraft issue, it's due to an obscure problem in Forge.

Should be fixed from the next GC version, please let me know how you get on with that if you have a chance.