Server crash with scarpet
Awakened-Redstone opened this issue · 13 comments
Server exception: https://hastebin.com/ulacahoqob.log
Crash report: crash-2021-01-14_13.14.21-server.txt
Renamed to .txt because gihub doesn't accept .sc
Script: random_tick.txt
Server version: 20w51a
Mods present:
- fabric-api-0.28.3+1.17.jar
- fabric-carpet-20w51a-1.4.22+v210113.jar
- ViaBackwards-3.3.0-20w51a (1).jar
- ViaFabric [1.16.3] {0.2.16-586.1}.jar
- ViaVersion-3.3.0-20w51a.jar
Steps to reproduce:
- Run /script load random_tick
- Run /random_tick setDelay 60
- Run /script load random_tick again
Expected result:
- Either not load the values back because I messed up or work fine
Actual result:
- Server closed
Deobfuscated version: NoSuchMethodError
: NbtIo.read
. (readCompressed?)
Edited: Final result: NbtIo.read
is now client-side only. PR attached.
Probably read, since it happens on reload (and it saves without any problem)
The weird thing is that class and method seems to exist, and it doesn't fail in dev.
Even with the script unloaded the server won't start again unless the "random_tick.data.nbt" file is deleted
Ok found it. While NbtIo.readCompressed()
is present in both sides, NbtIo.read()
doesn't exist in the server. That may have changed recently. So yeah, it basically crashes.
For the new comment: That is because scriptsAutoload
is now on by default
But that only makes the script be unloaded after loading. It needs to be parsed once to check for that value, and it is executed in that moment.
Server exception: https://hastebin.com/ulacahoqob.log
For me, following the link generates an HTTP 503 error and redirects to https://hastebin.com/
without loading the paste.
Likely cause: Service temporarily unavailable. Possible Workaround: Try posting a Gist and linking there.
Don't worry, that was basically the stack in the report. I'm preparing a PR to fix this already.
When it builts, the build at https://github.com/gnembon/fabric-carpet/actions/runs/486196725 should work.
[ERROR] Encountered an unexpected exception
java.lang.NoSuchMethodError: net.minecraft.class_2507.method_10633(Ljava/io/File;)Lnet/minecraft/class_2487;
at carpet.script.bundled.FileModule.read(FileModule.java:77) ~[fabric-carpet-20w51a-1.4.21+v201216.jar:?]
at carpet.script.bundled.Module.getData(Module.java:38) ~[fabric-carpet-20w51a-1.4.21+v201216.jar:?]
at carpet.script.CarpetScriptHost.loadState(CarpetScriptHost.java:673) ~[fabric-carpet-20w51a-1.4.21+v201216.jar:?]
at carpet.script.CarpetScriptHost.<init>(CarpetScriptHost.java:75) ~[fabric-carpet-20w51a-1.4.21+v201216.jar:?]
at carpet.script.CarpetScriptHost.create(CarpetScriptHost.java:89) ~[fabric-carpet-20w51a-1.4.21+v201216.jar:?]
at carpet.script.CarpetScriptServer.addScriptHost(CarpetScriptServer.java:240) ~[fabric-carpet-20w51a-1.4.21+v201216.jar:?]
at carpet.commands.ScriptCommand.lambda$register$36(ScriptCommand.java:248) ~[fabric-carpet-20w51a-1.4.21+v201216.jar:?]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:262) ~[intermediary-server.jar:?]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:176) ~[intermediary-server.jar:?]
at net.minecraft.class_2170.method_9249(class_2170.java:249) ~[intermediary-server.jar:?]
at net.minecraft.class_3244.method_14370(class_3244.java:1220) ~[intermediary-server.jar:?]
at net.minecraft.class_3244.method_31286(class_3244.java:1207) ~[intermediary-server.jar:?]
at net.minecraft.class_3244.method_12048(class_3244.java:1186) ~[intermediary-server.jar:?]
at net.minecraft.class_2797.method_12115(class_2797.java:36) ~[intermediary-server.jar:?]
at net.minecraft.class_2797.method_11054(class_2797.java:9) ~[intermediary-server.jar:?]
at net.minecraft.class_2600.method_11072(class_2600.java:21) ~[intermediary-server.jar:?]
at net.minecraft.class_3738.run(class_3738.java:18) ~[intermediary-server.jar:?]
at net.minecraft.class_1255.method_18859(class_1255.java:144) ~[intermediary-server.jar:?]
at net.minecraft.class_4093.method_18859(class_4093.java:23) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_24306(MinecraftServer.java:760) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_18859(MinecraftServer.java:157) ~[intermediary-server.jar:?]
at net.minecraft.class_1255.method_16075(class_1255.java:118) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_20415(MinecraftServer.java:742) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_16075(MinecraftServer.java:736) ~[intermediary-server.jar:?]
at net.minecraft.class_1255.method_18857(class_1255.java:127) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_16208(MinecraftServer.java:721) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.handler$zem000$modifiedRunLoop(MinecraftServer.java:3317) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:650) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:257) ~[intermediary-server.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
BTW the script wouldn't work as it was written. For saving multiple variables in store_app_data()
, you need to fill those in an nbt tag, load_app_data
only returns last saved.
Something like (note: bad code written in browser):
global_data = load_app_data();
if(!global_data,
global_data = nbt('{min:0,max:0,delay:0}')
);
setMax(max) -> (
global_data:'max' = max;
store_app_data(global_data);
);
...
You could even possibly simplify it to set(what, val)
and reuse it in the command.