Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Console Errors #2

Open
TomLewis opened this issue Apr 17, 2017 · 7 comments
Open

[Bug] Console Errors #2

TomLewis opened this issue Apr 17, 2017 · 7 comments

Comments

@TomLewis
Copy link

I get regular issues on the console:

[21:35:53 INFO]: [SignShopExport] Skipping sign 2396 as it failed to serialize. This is likely because it was changed mid-process
[21:35:53 WARN]: java.lang.ClassCastException
[21:36:13 INFO]: [SignShopExport] Skipping sign 2790 as it failed to serialize. This is likely because it was changed mid-process
[21:36:13 WARN]: java.lang.ClassCastException
[21:36:21 INFO]: [SignShopExport] Skipping sign 2941 as it failed to serialize. This is likely because it was changed mid-process
[21:36:21 WARN]: java.lang.IllegalArgumentException: class org.bukkit.craftbukkit.v1_11_R1.inventory.CraftMetaMap declares multiple JSON fields named locNa$
e
[21:36:21 WARN]:        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:122)
[21:36:21 WARN]:        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
[21:36:21 WARN]:        at com.google.gson.Gson.getAdapter(Gson.java:356)
[21:36:21 WARN]:        at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:55)
[21:36:21 WARN]:        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
[21:36:21 WARN]:        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
[21:36:21 WARN]:        at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
[21:36:21 WARN]:        at com.google.gson.internal.bind.ArrayTypeAdapter.write(ArrayTypeAdapter.java:93)
[21:36:21 WARN]:        at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
[21:36:21 WARN]:        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
[21:36:21 WARN]:        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
[21:36:21 WARN]:        at com.google.gson.Gson.toJson(Gson.java:593)
[21:36:21 WARN]:        at com.google.gson.Gson.toJsonTree(Gson.java:486)
[21:36:21 WARN]:        at com.google.gson.Gson.toJsonTree(Gson.java:465)
[21:36:21 WARN]:        at roycurtis.signshopexport.DataManager.doSerialize(DataManager.java:105)
[21:36:21 WARN]:        at roycurtis.signshopexport.DataManager.run(DataManager.java:71)
[21:36:21 WARN]:        at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58)
[21:36:21 WARN]:        at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:356)
[21:36:21 WARN]:        at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:820)
[21:36:21 WARN]:        at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:403)
[21:36:21 WARN]:        at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:754)
[21:36:21 WARN]:        at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:652)
[21:36:21 WARN]:        at java.lang.Thread.run(Thread.java:745)
[21:36:45 INFO]: [SignShopExport] Skipping sign 3429 as it failed to serialize. This is likely because it was changed mid-process
[21:36:45 WARN]: java.lang.ClassCastException
[21:36:53 INFO]: [SignShopExport] Skipping sign 3584 as it failed to serialize. This is likely because it was changed mid-process
[21:36:53 WARN]: java.lang.ClassCastException
@RoyCurtis
Copy link
Contributor

Acknowledged; thanks for reporting. Will look into this; I've not tested with serialization of map items before.

The signs that error out with java.lang.ClassCastException - do you get those all the time, even after a server restart? Do you happen to know which signs/items these may be triggering on? (Don't worry if you don't - my fault here for not adding more debugging information)

@TomLewis
Copy link
Author

Im not sure, is it possible to put the tppos of the signs in the error logs? then we could investigate!

@RoyCurtis
Copy link
Contributor

Good idea :D Will do that, thanks!

@RoyCurtis
Copy link
Contributor

I forgot that SSE already logs the details of erroring signs (e.g. location); it does this using the FINE logging level, but doesn't properly log exceptions.

If it's possible, I'd like you to do the following please:

  1. Replace your version of SignShopExport with this file
  2. In your server's directory, create a file called log4j.xml using this gist as the contents
  3. Add -Dlog4j.configurationFile=log4j.xml to your server's JVM arguments (i.e. before -jar)
  4. Run the server and let SignShopExport complete one full export

What this will do is log all of SignShopExport's debugging data, to its own log files at logs/sse_debug.log. This will catch all erroring signs' positions, types, owners and exceptions, Please upload and share a copy of this log.

This logging configuration should not affect your server's performance or logging, but when finished, you should comment out or remove these lines:

<!-- Full debugging for SignShopExport, to own file -->
<Logger additivity="false" level="ALL" name="roycurtis.signshopexport.SignShopExport">
    <AppenderRef ref="SSEDebug"/>
</Logger>

Doing this won't require a server restart. The monitorInterval="5" at the top means log4j.xml is checked for changes every 5 seconds.

@TomLewis
Copy link
Author

Alright! I've done this on my test server and its booting now, minus the editing the file at the end of task 4. I will let it do its thing for a few hours, see what happens.

@TomLewis
Copy link
Author

It worked, heres an extract from an error:

[00:13:20] [Server thread/TRACE]: [SignShopExport] 2810/4653 signs serialized
[00:13:20] [Server thread/TRACE]: [SignShopExport] 2820/4653 signs serialized
[00:13:21] [Server thread/TRACE]: [SignShopExport] 2830/4653 signs serialized
[00:13:21] [Server thread/INFO]: [SignShopExport] Skipping sign 2831 as it failed to serialize. This is likely because it was changed mid-process
[00:13:21] [Server thread/TRACE]: [SignShopExport] Details for sign 2831:
[00:13:21] [Server thread/TRACE]: [SignShopExport] Record: buy sign at 258,68,-2602 @ PirateCraft_1 by Plantpotgirl (9ac9aca4-fe28-474f-9aa9-d6bc955cef8b)
[00:13:21] [Server thread/TRACE]: [SignShopExport] Exception for sign 2831
java.lang.IllegalArgumentException: class org.bukkit.craftbukkit.v1_11_R1.inventory.CraftMetaMap declares multiple JSON fields named locName
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:122) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.Gson.getAdapter(Gson.java:356) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:55) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.internal.bind.ArrayTypeAdapter.write(ArrayTypeAdapter.java:93) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.Gson.toJson(Gson.java:593) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.Gson.toJsonTree(Gson.java:486) ~[patched_1.11.2.jar:git-Paper-1081]
	at com.google.gson.Gson.toJsonTree(Gson.java:465) ~[patched_1.11.2.jar:git-Paper-1081]
	at roycurtis.signshopexport.DataManager.doSerialize(DataManager.java:104) [SignShopExport-1.11-0.1.4-debug.jar:?]
	at roycurtis.signshopexport.DataManager.run(DataManager.java:70) [SignShopExport-1.11-0.1.4-debug.jar:?]
	at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58) [patched_1.11.2.jar:git-Paper-1081]
	at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:356) [patched_1.11.2.jar:git-Paper-1081]
	at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:820) [patched_1.11.2.jar:git-Paper-1081]
	at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:403) [patched_1.11.2.jar:git-Paper-1081]
	at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:754) [patched_1.11.2.jar:git-Paper-1081]
	at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:652) [patched_1.11.2.jar:git-Paper-1081]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
[00:13:22] [Server thread/TRACE]: [SignShopExport] 2840/4653 signs serialized
[00:13:22] [Server thread/TRACE]: [SignShopExport] 2850/4653 signs serialized
[00:13:22] [Server thread/TRACE]: [SignShopExport] 2860/4653 signs serialized
[00:13:23] [Server thread/TRACE]: [SignShopExport] 2870/4653 signs serialized
[00:13:23] [Server thread/TRACE]: [SignShopExport] 2880/4653 signs serialized

@RoyCurtis
Copy link
Contributor

RoyCurtis commented Apr 29, 2017

Thanks a lot!

I've released SignShopExport 1.0.0, which should solve this issue. Please keep in mind however, any websites or tools using data from this version may have to be updated for the new data format (for example; it's now possible for the meta object to be undefined, for items that don't need it).

Hope it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants