itzg / docker-minecraft-bedrock-server

Containerized Minecraft Bedrock Dedicated Server with selectable version
MIT License
1.13k stars 215 forks source link

Minecraft server crashing #201

Open usma0118 opened 2 years ago

usma0118 commented 2 years ago

My minecraft server has crashed and stopped working. i have tried setting up new server but got same issue:

Host: Kubernetes

All configurations are done via config

  EULA: "TRUE" # Must accept EULA to use this minecraft server
  GAMEMODE: "survival" # Options: survival, creative, adventure
  DIFFICULTY: "easy" # Options: peaceful, easy, normal, hard
  DEFAULT_PLAYER_PERMISSION_LEVEL: "member" # Options: visitor, member, operator
  LEVEL_NAME: "Bedrock level"
  #LEVEL_SEED: "33480944"
  SERVER_NAME: "Minecraft Server"
  SERVER_PORT: "19132"
  SERVER_PORT_V6: "19133"
  #LEVEL_TYPE: "DEFAULT" # Options: FLAT, LEGACY, DEFAULT
  ALLOW_CHEATS: "true" # Options: true, false
  MAX_PLAYERS: "10"
  PLAYER_IDLE_TIMEOUT: "30"
  TEXTUREPACK_REQUIRED: "true" # Options: true, false
  #
  ## Changing these will have a security impact
  ONLINE_MODE: "true" # Options: true, false (removes Xbox Live account requirements)
  WHITE_LIST: "false" # If enabled, need to provide a whitelist.json by your own means.
  #
  ## Changing these will have a performance impact
  #VIEW_DISTANCE: "10"
  #TICK_DISTANCE: "4"
  #MAX_THREADS: "8"
  UID: "1002"
  PID: "1002"
  GID: "1002"
  PACKAGE_BACKUP_KEEP: "2"

strange observation in logs on

[2021-12-24 21:48:54:111 INFO] IPv4 supported, port: 0
[2021-12-24 21:48:54:111 INFO] IPv6 supported, port: 0

Full log

time="2021-12-24T21:48:53Z" level=debug msg="Using /data to match uid and gid"
time="2021-12-24T21:48:53Z" level=debug msg="Resolved 1002 from environment variable UID"
time="2021-12-24T21:48:53Z" level=debug msg="Resolved 1002 from environment variable GID"
time="2021-12-24T21:48:53Z" level=debug msg="stdin is detached, so forwarding is disabled"
Looking up latest version...
Starting Bedrock server...
NO LOG FILE! - [] setting up server logging...
[2021-12-24 21:48:53:624 INFO] Starting Server
[2021-12-24 21:48:53:624 INFO] Version 1.18.2.03
[2021-12-24 21:48:53:624 INFO] Session ID a8ae1eef-d728-4e1a-a995-914413947ffb
[2021-12-24 21:48:53:625 INFO] Level Name: Bedrock level
[2021-12-24 21:48:53:625 INFO] Game mode: 0 Survival
[2021-12-24 21:48:53:625 INFO] Difficulty: 1 EASY
[2021-12-24 21:48:53:654 INFO] opening worlds/Bedrock level/db
[2021-12-24 21:48:54:111 INFO] IPv4 supported, port: 0
[2021-12-24 21:48:54:111 INFO] IPv6 supported, port: 0
[2021-12-24 21:48:54:134 INFO] Package: com.mojang.minecraft.dedicatedserver
Version: 1.18.2.03
OS: Linux
Server start: 2021-12-24 21:48:53 UTC
Dmp timestamp: 2021-12-24 21:48:54 UTC
Upload Date: 2021-12-24 21:48:54 UTC
Session ID: a8ae1eef-d728-4e1a-a995-914413947ffb
Commit hash: 74c6ce6eb10dfe6b481aa14578b375b50a5d2028
Build id: 7966228
CrashReporter Key: 8c4937c1-64cb-3532-a8dc-1deb28f67293

Crash
[2021-12-24 21:48:54:134 INFO] 
Failed to open curl lib from binary, use libcurl.so instead
usma0118 commented 2 years ago

have looked into this issue. #7 Verified that Kubernetes host has ipv6 disabled.

itzg commented 2 years ago

This sounds like an issue to report with Mojang. However, when you say you setup a new server are you certain you used a completely new, empty data volume?

usma0118 commented 2 years ago

Yes, i have tried. with complete new installation and empty volume. one observation though version 1.18 fails with libcrul error.

I have tried downgrading to version 1.16

shows

[2021-12-25 12:16:05 INFO] IPv4 supported, port: 0
[2021-12-25 12:16:05 INFO] IPv6 supported, port: 0

Full log v1.16

DEBU[0000] Using /data to match uid and gid             
DEBU[0000] Resolved UID=0 from match path               
DEBU[0000] Resolved GID=1005 from match path            
Starting Bedrock server...
NO LOG FILE! - setting up server logging...
[2021-12-25 12:16:02 INFO] Starting Server
[2021-12-25 12:16:02 INFO] Version 1.16.20.3
[2021-12-25 12:16:02 INFO] Session ID 7ded9c70-d7bc-4f8f-af20-b4a9b0ad6561
[2021-12-25 12:16:02 INFO] Level Name: my_minecraft_world1
[2021-12-25 12:16:02 INFO] Game mode: 0 Survival
[2021-12-25 12:16:02 INFO] Difficulty: 1 EASY
[2021-12-25 12:16:02 INFO] opening worlds/my_minecraft_world1/db
[2021-12-25 12:16:05 INFO] IPv4 supported, port: 0
[2021-12-25 12:16:05 INFO] IPv6 supported, port: 0
[2021-12-25 12:16:05 ERROR] Network port occupied, can't start server.
DEBU[0057] Forwarding signal                             signal=terminated
DEBU[0057] Sending message on stdin due to SIGTERM       message=stop
Quit correctly
usma0118 commented 2 years ago

verified server.properties

server-port=19132
# Which IPv4 port the server should listen to.
# Allowed values: Integers in the range [1, 65535]
usma0118 commented 2 years ago

I have ran a test, copied all files from volume and executed them locally on my machine (running ubuntu 21) Server started successfully

NO LOG FILE! - setting up server logging...
[2021-12-25 13:28:28 INFO] Starting Server
[2021-12-25 13:28:28 INFO] Version 1.16.20.3
[2021-12-25 13:28:28 INFO] Session ID b11b10f0-1592-482f-91ab-a87f7de7e486
[2021-12-25 13:28:28 INFO] Level Name: my_minecraft_world1
[2021-12-25 13:28:28 INFO] Game mode: 0 Survival
[2021-12-25 13:28:28 INFO] Difficulty: 1 EASY
[2021-12-25 13:28:28 INFO] opening worlds/my_minecraft_world1/db
[2021-12-25 13:28:30 INFO] IPv4 supported, port: 19132
[2021-12-25 13:28:30 INFO] IPv6 supported, port: 19133
[2021-12-25 13:28:30 INFO] IPv4 supported, port: 58426
[2021-12-25 13:28:30 INFO] IPv6 supported, port: 49742
[2021-12-25 13:28:31 INFO] Server started.
usma0118 commented 2 years ago

I have been able to recreate above on my linux server (running Ubuntu 20.04) Not sure what's causing this behavior since containers run in isolated box:

usma0118 commented 2 years ago

Known issue: https://bugs.mojang.com/browse/BDS-12751

itzg commented 2 years ago

FYI image is based on Debian 11.1:

> docker run -it --rm --entrypoint cat itzg/minecraft-bedrock-server /etc/debian_version
11.1
itzg commented 2 years ago

Please provide output of kubectl describe on the pod. I would like to confirm you're running a recent image version.

usma0118 commented 2 years ago

here goes: docker.io/itzg/minecraft-bedrock-server@sha256:930ca7b2fffcc0fdf5368a3a6ed1652c7231f0811156d80fc88f044760eb76dc

Start Time:   Sat, 25 Dec 2021 13:32:28 +0100
Controlled By:  StatefulSet/bds
Containers:
  main:
    Container ID:   containerd://af121b5f0c0b0a129834e8674148e3da011b256e86e1cecd41e9120e53bd6c99
    Image:          itzg/minecraft-bedrock-server
    Image ID:       docker.io/itzg/minecraft-bedrock-server@sha256:930ca7b2fffcc0fdf5368a3a6ed1652c7231f0811156d80fc88f044760eb76dc
    Port:           19132/UDP
    Host Port:      0/UDP
    State:          Running
      Started:      Sat, 25 Dec 2021 15:57:49 +0100
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Sat, 25 Dec 2021 15:56:56 +0100
      Finished:     Sat, 25 Dec 2021 15:57:48 +0100
    Ready:          False
    Restart Count:  45
    Liveness:       exec [mc-monitor status-bedrock --host 127.0.0.1] delay=30s timeout=1s period=10s #success=1 #failure=3
    Readiness:      exec [mc-monitor status-bedrock --host 127.0.0.1] delay=30s timeout=1s period=10s #success=1 #failure=3
    Environment:
      EULA:         TRUE
      SERVER_PORT:  19132
      VERSION:      1.16
      DEBUG:        TRUE
    Mounts:
      /data from data (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-jbb6q (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  data:
    Type:          HostPath (bare host directory volume)
    HostPathType:  Directory
  kube-api-access-jbb6q:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason     Age                     From     Message
  ----     ------     ----                    ----     -------
  Normal   Pulled     35m (x27 over 127m)     kubelet  (combined from similar events): Successfully pulled image "itzg/minecraft-bedrock-server" in 1.144875308s
  Normal   Pulling    15m (x41 over 145m)     kubelet  Pulling image "itzg/minecraft-bedrock-server"
  Warning  BackOff    5m21s (x472 over 139m)  kubelet  Back-off restarting failed container
  Warning  Unhealthy  25s (x256 over 143m)    kubelet  (combined from similar events): Readiness probe failed: 2021/12/25 14:57:38 failed to query bedrock server 127.0.0.1:19132: timeout reading the response: read udp 127.0.0.1:52575->127.0.0.1:19132: read: connection refused
itzg commented 2 years ago

Yep, that's the correct image. It starts up fine for me, so I'm not sure why it would differ since like you said it is containerized with its own distro file system. Kernel could differ but not sure how it would trigger a shared library issue.

usma0118 commented 2 years ago

Yeh, that's what i am stuck at... container should run properly. can't see any errors in firewall or related. so not sure what's causing this behavior in isolated environment.

usma0118 commented 2 years ago

java server image runs fine as container.

itzg commented 2 years ago

java server image runs fine as container.

I'm not sure how that's relevant.

usma0118 commented 2 years ago

java server image runs fine as container.

I'm not sure how that's relevant.

Just trying to figure out, how to recover my minecraft home server. attempted to run your minecraft java image to see if that fails, works fine.

usma0118 commented 2 years ago

FYI, I still don't understand why host environment has any impact on isolated container.. but apparently it does. reinstalled Host Server (same os and configuration via ansible). installed minecraft container again and it works.

usma0118 commented 2 years ago

and it's back...