LOOHP / Limbo

Standalone Limbo Minecraft Server (Currently 1.21.1)
http://ci.loohpjames.com/job/Limbo/
Apache License 2.0
232 stars 28 forks source link

Crash on startup #39

Closed weihao closed 2 years ago

weihao commented 2 years ago
07:49:09 Info] Loading Limbo Version 0.6.9-ALPHA on Minecraft 1.18.1
Exception in thread "main" [07:49:10 Error]com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 4 path $
[07:49:10 Error]        at com.google.gson.Gson.assertFullConsumption(Gson.java:903)
[07:49:10 Error]        at com.google.gson.Gson.fromJson(Gson.java:893)
[07:49:10 Error]        at com.google.gson.Gson.fromJson(Gson.java:841)
[07:49:10 Error]        at com.google.gson.Gson.fromJson(Gson.java:813)
[07:49:10 Error]        at net.kyori.adventure.text.serializer.gson.GsonComponentSerializerImpl.deserialize(GsonComponentSerializerImpl.java:84)
[07:49:10 Error]        at net.kyori.adventure.text.serializer.gson.GsonComponentSerializerImpl.deserialize(GsonComponentSerializerImpl.java:37)
[07:49:10 Error]        at com.loohp.limbo.file.ServerProperties.<init>(ServerProperties.java:110)
[07:49:10 Error]        at com.loohp.limbo.Limbo.<init>(Limbo.java:170)
[07:49:10 Error]        at com.loohp.limbo.Limbo.main(Limbo.java:101)
[07:49:10 Error]Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 4 path $
[07:49:10 Error]        at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1568)
[07:49:10 Error]        at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1409)
[07:49:10 Error]        at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:542)
[07:49:10 Error]        at com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
[07:49:10 Error]        at com.google.gson.Gson.assertFullConsumption(Gson.java:899)
[07:49:10 Error]        ... 8 more
2021-12-25T07:49:10.050Z        WARN    mc-server-runner        sub-process failed      {"exitCode": 1}
2021-12-25T07:49:10.050Z        INFO    mc-server-runner        Done

https://github.com/itzg/docker-minecraft-server/issues/1223#issue-1088564037

LOOHP commented 2 years ago

Did your docker modified the server.properties incorrectly?

weihao commented 2 years ago

Did your docker modified the server.properties incorrectly?

I used the default settings

LOOHP commented 2 years ago

Can you show me your server.properties?

weihao commented 2 years ago
#For explaination of what each of the options does, please visit:
#https://github.com/LOOHP/Limbo/blob/master/src/main/resources/server.properties
#Sat Dec 25 15:41:21 UTC 2021
reduced-debug-info=false
default-gamemode=creative
enable-jmx-monitoring=false
level-seed=
rcon.port=25575
enable-command-block=true
gamemode=0
enable-query=false
generator-settings=
forwarding-secrets=
ticks-per-second=5
level-name=Default;default.schem
motd=A Limbo Minecraft Server powered by Docker
query.port=25565
texture-pack=
pvp=true
generate-structures=true
version=Limbo\!
difficulty=1
network-compression-threshold=256
max-tick-time=60000
max-players=20
use-native-transport=true
handshake-verbose=true
velocity-modern=false
online-mode=true
enable-status=true
allow-flight=false
broadcast-rcon-to-ops=true
required-resource-pack=false
view-distance=10
max-build-height=256
server-ip=0.0.0.0
resource-pack-prompt={"text"\:"","extra"\:[{"text"\:"Install server resource pack\!","color"\:"yellow"}]}
allow-nether=true
server-port=25565
enable-rcon=true
sync-chunk-writes=true
op-permission-level=4
tab-header=
bungeecord=false
prevent-proxy-connections=false
resource-pack=
entity-broadcast-range-percentage=100
player-idle-timeout=0
rcon.password=minecraft
world-spawn=world;20.5;17;22.5;-90;0
announce-player-achievements=true
allow-chat=true
force-gamemode=false
hardcore=false
white-list=false
broadcast-console-to-ops=true
spawn-npcs=true
tab-footer=
spawn-animals=true
snooper-enabled=true
function-permission-level=2
level-dimension=minecraft\:overworld
bungee-guard=false
level-type=DEFAULT
spawn-monsters=true
enforce-whitelist=false
resource-pack-sha1=
spawn-protection=16
max-world-size=29999984
LOOHP commented 2 years ago

Default server.properties looks like this: https://github.com/LOOHP/Limbo/blob/master/src/main/resources/server.properties

weihao commented 2 years ago

changed to the default server.properties

[17:25:03 Error]java.lang.reflect.InvocationTargetException
[17:25:03 Error]        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[17:25:03 Error]        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[17:25:03 Error]        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[17:25:03 Error]        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[17:25:03 Error]        at com.loohp.limbo.Limbo.<init>(Limbo.java:300)
[17:25:03 Error]        at com.loohp.limbo.Limbo.main(Limbo.java:101)
[17:25:03 Error]Caused by: java.lang.NullPointerException: Cannot read the array length because "<local1>" is null
[17:25:03 Error]        at com.loohp.limbo.plugins.PluginManager.loadPlugins(PluginManager.java:37)
[17:25:03 Error]        ... 6 more
[17:25:03 Info] Limbo server listening on /0.0.0.0:30000
[17:25:03 Error]java.io.FileNotFoundException: plugins/bStats/config.yml (No such file or directory)
[17:25:03 Error]        at java.base/java.io.FileOutputStream.open0(Native Method)
[17:25:03 Error]        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
[17:25:03 Error]        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
[17:25:03 Error]        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:184)
[17:25:03 Error]        at com.loohp.limbo.file.FileConfiguration.saveConfig(FileConfiguration.java:139)
[17:25:03 Error]        at com.loohp.limbo.metrics.Metrics.<init>(Metrics.java:89)
[17:25:03 Error]        at com.loohp.limbo.Limbo.<init>(Limbo.java:313)
[17:25:03 Error]        at com.loohp.limbo.Limbo.main(Limbo.java:101)
LOOHP commented 2 years ago

Is your docker changing your server properties?

weihao commented 2 years ago

yeah i think it was a bug: https://github.com/itzg/docker-minecraft-server/issues/1223#issuecomment-1001048532

but the latest error i got was related to the server jar

itzg commented 2 years ago

yeah i think it was a bug: itzg/docker-minecraft-server#1223 (comment)

but the latest error i got was related to the server jar

You have this backwards. An existing server.properties is not modified by the container startup.

itzg commented 2 years ago

@LOOHP what properties matter in server.properties? I thought it was just:

level-name=Default;default.schem
LOOHP commented 2 years ago

These are all the properties that Limbo reads from and needs to be present. https://github.com/LOOHP/Limbo/blob/master/src/main/resources/server.properties

itzg commented 2 years ago

These are all the properties that Limbo reads from and needs to be present. https://github.com/LOOHP/Limbo/blob/master/src/main/resources/server.properties

That's all of them. I mean, which ones has Limbo specifically changed or added with special behavior, such as level-name?

weihao commented 2 years ago

that is not what i observed bug

on the left is the server.properties i pulled from the limbo container, on the right is what i pulled from a working local limbo server.

i also looked at the setupServerProperties bash script that the container uses, it does modify the server.properties

itzg commented 2 years ago

You're still not understanding. An existing server.properties is not modified by the container startup. Provide your own Limbo properties file and the server properties script will not touch it.

https://github.com/itzg/docker-minecraft-server/blob/c506cf11ac9470be5b1a792a8aed8354137ec2e1/scripts/start-setupServerProperties#L213

In any case, why do the extra properties matter? I'm not doing anything about this issue until I get some explanations about that.

weihao commented 2 years ago

You're still not understanding. An existing server.properties is not modified by the container startup. Provide your own Limbo properties file and the server properties script will not touch it.

https://github.com/itzg/docker-minecraft-server/blob/c506cf11ac9470be5b1a792a8aed8354137ec2e1/scripts/start-setupServerProperties#L213

In any case, why do the extra properties matter? I'm not doing anything about this issue until I get some explanations about that.

yeah I understand this. I was able to get the limbo container working by mounting an existing server.properties to it.

if you look at the diff, server-port was generated by the container script first, then the LIMBO will just read it, which changes the default behavior. the motd was also generated by the script first, but in an incompatible format that will crash the LIMBO server. this is why i opened this ticket.

itzg commented 2 years ago

Thank you @weihao , this whole time it wasn't pointed out that the motd format was causing the crash. That is something I can have the container startup adjust in the case of Limbo. (FWIW every other server type doesn't accept JSON for that property.)

itzg commented 2 years ago

@LOOHP can you clarify the expected motd JSON structure. Is $.text always expected to be an empty string and the actual MOTD goes in $.extra.text?

LOOHP commented 2 years ago

motd takes in an empty string (Disable) or a JSON Chat Component.

weihao commented 2 years ago

resolved, thanks @LOOHP @itzg