itzg / minecraft-server-charts

MIT License
267 stars 142 forks source link

changing type to SPIGOT causes server to stop running. #187

Closed damienj210 closed 7 months ago

damienj210 commented 7 months ago

I am trying to run the standard minecraft server helm chart, I choose to customize helm options before install. These are the items I change:

eula: 'TRUE'
motd: testing Minecraft on Kubernetes!
onlineMode: false
type: SPIGOT
persistence:
  annotations: {}
  dataDir:
    Size: 10Gi
    enabled: true
    existingClaim: pvc-testminecraft

Watching the logs during the pod creation, everything seems to be ok and it completes with "Done" but minutes later it shuts down the server. I have attached my logs and yaml files.

testminecraft-minecraft-857d4fd99b-mtbbm_testminecraft-minecraft.log testminecraft.yaml.txt

Please let me know what I'm doing wrong. This only happens when I change the type to SPIGOT. If I make all of the other changes but leave type as VANILLA it works fine.

Thanks.

itzg commented 7 months ago

Something signaled the pod/container to stop, so it did a graceful stop:

2024-01-24T02:37:39.671Z    INFO    mc-server-runner    Sending 'stop' to Minecraft server...
2024-01-23T20:37:39.671988020-06:00 2024-01-24T02:37:39.671Z    INFO    mc-server-runner    Waiting for completion...
[02:37:39] [Server thread/INFO]: Stopping the server
[02:37:39] [Server thread/INFO]: Stopping server
[02:37:39] [Server thread/INFO]: Saving players
[02:37:39] [Server thread/INFO]: Saving worlds
[02:37:45] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld

Perhaps use kubectl get events to see what kubernetes operation initiated it.

panromir commented 7 months ago

Hey there :)

I have run into the same issue and I assume it's the Probes.

I replaced them in the Helm chart values.yaml and that fixes the issue I can now play MC fine.

livenessProbe:
  enabled: false
  command:
    - echo
  initialDelaySeconds: 30
  periodSeconds: 5
  failureThreshold: 20
  successThreshold: 1
  timeoutSeconds: 1
readinessProbe:
  enabled: false
  command:
    - echo
  initialDelaySeconds: 30
  periodSeconds: 5
  failureThreshold: 20
  successThreshold: 1
  timeoutSeconds: 1
startupProbe:
  command:
    - echo
  enabled: false
  failureThreshold: 30
  periodSeconds: 10

Of course, that's not ideal!

Now the original issue is the following:

The mc-status script errors out:

minecraft-minecraft-6cf79f486b-ftwtp:/data$ mc-health
failed to ping localhost:25565 : json: cannot unmarshal string into Go struct field ServerInfo.description of type mcpinger.RegularChatComponent

What mc-monitor does I don't know, since it's a go binary. This happens with Spigot 1.20.4

itzg commented 7 months ago

@panromir that latest behavior is being tracked in https://github.com/itzg/docker-minecraft-server/issues/2545 and will be fixed soon

panromir commented 7 months ago

@panromir that latest behavior is being tracked in itzg/docker-minecraft-server#2545 and will be fixed soon

This has fixed the Probes and the server is now running properly in k3s with Spigot 1.20.4 with the original values.yaml configuration. Thanks!

itzg commented 7 months ago

Resolved by https://github.com/itzg/docker-minecraft-server/pull/2628