itzg / docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup
https://docker-minecraft-server.readthedocs.io/
Apache License 2.0
9.49k stars 1.55k forks source link

LIMBO server crash on startup due to required JSON format for motd #1223

Closed weihao closed 2 years ago

weihao commented 2 years ago

Describe the problem

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

Container definition

Paste run command or compose file here

Container logs

Paste logs here
itzg commented 2 years ago

Set the variable DEBUG to true and provide those logs.

itzg commented 2 years ago

Download speed of the hosting site is horrible...waiting...

> docker run -it --rm -e EULA=TRUE -e TYPE=LIMBO itzg/minecraft-server
[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 2 1000 1000 4096 Dec  5 00:43 /data'
[init] Resolved version given LATEST into 1.18.1
[init] Resolving type given LIMBO
[init] Resolved latest Limbo build to 7
[init] Downloading Limbo from https://ci.loohpjames.com/job/Limbo/lastStableBuild/artifact/target/Limbo-0.6.9-ALPHA-1.18.1.jar ...
weihao commented 2 years ago

Reference in new issue

so paper and limbo are using the same server.properties file.

limbo container runtime overwrites the server.properties with paper environments and caused issues

itzg commented 2 years ago

Can the issue be closed?

weihao commented 2 years ago

no, the image shouldn't overwrite the server.properties

itzg commented 2 years ago

It doesn't unless you tell it to. Provide the commands or compose files you used to create the two containers. That was supposed to be provided with the initial report.

weihao commented 2 years ago
  lobby:
    image: itzg/minecraft-server
    environment:
      EULA: "TRUE"
      TYPE: "LIMBO"
      DEBUG: "true"
    restart: unless-stopped
    volumes:
      - ./lobby:/data
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 23:28:33 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
itzg commented 2 years ago

What about the paper server? Do you even need a data volume mounted for limbo server?

weihao commented 2 years ago

What about the paper server? Do you even need a data volume mounted for limbo server?

no, what I meant was paper and limbo as server sided software are both reading the server.properties file.

itzg/minecraft-server image setupServerProperties script always generates paper's server.properties file which created the conflict in limbo.

weihao commented 2 years ago

I can only reproduce this error on the itzg/minecraft-server container. setting limbo server up on local was working fine. the server.properties was modified by the container at runtime generation and caused the error.

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

Originally posted by @weihao in https://github.com/LOOHP/Limbo/issues/39#issuecomment-1006621919