docker-minecraft-server icon indicating copy to clipboard operation
docker-minecraft-server copied to clipboard

Can't launch server : Sending 'stop' to Minecraft server

Open dquartino opened this issue 6 years ago • 3 comments

Hi there !

I cant launch the server. Using docker compose inside a vm

Compose file :

`version: "3.4" services: minecraft: image: itzg/minecraft-server ports: - "25565:25565" volumes: - "mc:/data" environment: EULA: "TRUE" MEMORY: ${MEMORY}

volumes: mc: driver: local driver_opts: type: none device: ${ROOT_PATH}/server o: bind`

Logs :

[init] Resolved version given LATEST into 1.15.2, [init] Resolving type given VANILLA, [init] server.properties already created, skipping, [init] log4j2.xml already created, skipping, [init] Checking for JSON files., [init] Copying any mods over..., [init] Setting initial memory to 2G and max to 2G, [init] Starting the Minecraft server..., [09:17:18] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498], [09:17:18] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0], [09:17:18] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0], [09:17:18] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498], [09:17:18] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0], [09:17:18] [Server thread/INFO]: Starting minecraft server version 1.15.2, [09:17:18] [Server thread/INFO]: Loading properties, [09:17:18] [Server thread/INFO]: Default game type: SURVIVAL, [09:17:18] [Server thread/INFO]: Generating keypair, [09:17:20] [Server thread/INFO]: Starting Minecraft server on *:25565, [09:17:20] [Server thread/INFO]: Using epoll channel type, [09:17:21] [Server thread/INFO]: Preparing level "world", [09:17:21] [Server thread/INFO]: Found new data pack vanilla, loading it automatically, [09:17:21] [Server thread/INFO]: Reloading ResourceManager: Default, [09:17:27] [Server thread/INFO]: Loaded 6 recipes, [09:17:30] [Server thread/INFO]: Loaded 825 advancements, [09:18:39] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld, [09:18:39] [Server-Worker-1/INFO]: Preparing spawn area: 0%, [09:18:39] [Server-Worker-1/INFO]: Preparing spawn area: 0%, [09:18:40] [Server-Worker-1/INFO]: Preparing spawn area: 0%, [09:18:40] [Server-Worker-1/INFO]: Preparing spawn area: 0%, [09:18:41] [Server-Worker-1/INFO]: Preparing spawn area: 0%, [09:18:41] [Server-Worker-1/INFO]: Preparing spawn area: 0%, [09:18:42] [Server-Worker-1/INFO]: Preparing spawn area: 0%, [09:18:43] [Server-Worker-1/INFO]: Preparing spawn area: 0%, [09:18:43] [Server-Worker-1/INFO]: Preparing spawn area: 0%, [09:18:43] [Server-Worker-1/INFO]: Preparing spawn area: 0%, [09:18:44] [Server-Worker-1/INFO]: Preparing spawn area: 1%, [09:18:44] [Server-Worker-1/INFO]: Preparing spawn area: 1%, [09:18:45] [Server-Worker-1/INFO]: Preparing spawn area: 1%, [09:18:45] [Server-Worker-1/INFO]: Preparing spawn area: 2%, [09:18:46] [Server-Worker-1/INFO]: Preparing spawn area: 2%, [09:18:46] [Server-Worker-1/INFO]: Preparing spawn area: 2%, [09:18:47] [Server-Worker-1/INFO]: Preparing spawn area: 2%, [09:18:47] [Server-Worker-1/INFO]: Preparing spawn area: 3%, [09:18:48] [Server-Worker-1/INFO]: Preparing spawn area: 3%, [09:18:48] [Server-Worker-1/INFO]: Preparing spawn area: 3%, [09:18:49] [Server-Worker-1/INFO]: Preparing spawn area: 3%, [09:18:49] [Server-Worker-1/INFO]: Preparing spawn area: 4%, [09:18:50] [Server-Worker-1/INFO]: Preparing spawn area: 5%, [09:18:50] [Server-Worker-1/INFO]: Preparing spawn area: 5%, [09:18:51] [Server-Worker-1/INFO]: Preparing spawn area: 6%, [09:18:51] [Server-Worker-1/INFO]: Preparing spawn area: 6%, [09:18:52] [Server-Worker-1/INFO]: Preparing spawn area: 7%, [09:18:52] [Server-Worker-1/INFO]: Preparing spawn area: 8%, [09:18:53] [Server-Worker-1/INFO]: Preparing spawn area: 9%, [09:18:53] [Server-Worker-1/INFO]: Preparing spawn area: 9%, [09:18:54] [Server-Worker-1/INFO]: Preparing spawn area: 10%, [09:18:54] [Server-Worker-1/INFO]: Preparing spawn area: 11%, [09:18:55] [Server-Worker-1/INFO]: Preparing spawn area: 12%, [09:18:55] [Server-Worker-1/INFO]: Preparing spawn area: 12%, [09:18:56] [Server-Worker-1/INFO]: Preparing spawn area: 13%, [09:18:56] [Server-Worker-1/INFO]: Preparing spawn area: 13%, [09:18:57] [Server-Worker-1/INFO]: Preparing spawn area: 14%, [09:18:57] [Server-Worker-1/INFO]: Preparing spawn area: 15%, [09:18:58] [Server-Worker-1/INFO]: Preparing spawn area: 15%, [09:18:58] [Server-Worker-1/INFO]: Preparing spawn area: 16%, [09:18:59] [Server-Worker-1/INFO]: Preparing spawn area: 17%, [09:18:59] [Server-Worker-1/INFO]: Preparing spawn area: 17%, [09:19:00] [Server-Worker-1/INFO]: Preparing spawn area: 19%, [09:19:00] [Server-Worker-1/INFO]: Preparing spawn area: 19%, [09:19:01] [Server-Worker-1/INFO]: Preparing spawn area: 20%, [09:19:01] [Server-Worker-1/INFO]: Preparing spawn area: 21%, [09:19:02] [Server-Worker-1/INFO]: Preparing spawn area: 22%, [09:19:02] [Server-Worker-1/INFO]: Preparing spawn area: 22%, [09:19:03] [Server-Worker-1/INFO]: Preparing spawn area: 22%, [09:19:03] [Server-Worker-1/INFO]: Preparing spawn area: 23%, [09:19:04] [Server-Worker-1/INFO]: Preparing spawn area: 25%, [09:19:04] [Server-Worker-1/INFO]: Preparing spawn area: 25%, [09:19:05] [Server-Worker-1/INFO]: Preparing spawn area: 27%, 2020-04-16T09:19:05.624Z INFO mc-server-runner Sending 'stop' to Minecraft server..., 2020-04-16T09:19:05.625Z INFO mc-server-runner Waiting for completion..., [09:19:05] [Server-Worker-1/INFO]: Preparing spawn area: 27%, [09:19:06] [Server-Worker-1/INFO]: Preparing spawn area: 28%, [09:19:06] [Server-Worker-1/INFO]: Preparing spawn area: 29%, [09:19:07] [Server-Worker-1/INFO]: Preparing spawn area: 29%, [09:19:08] [Server-Worker-1/INFO]: Preparing spawn area: 29%, [09:19:08] [Server-Worker-1/INFO]: Preparing spawn area: 30%, [09:19:08] [Server-Worker-1/INFO]: Preparing spawn area: 31%, [09:19:09] [Server-Worker-1/INFO]: Preparing spawn area: 32%, [09:19:09] [Server-Worker-1/INFO]: Preparing spawn area: 33%, [09:19:10] [Server-Worker-1/INFO]: Preparing spawn area: 34%, [09:19:10] [Server-Worker-1/INFO]: Preparing spawn area: 34%, [09:19:11] [Server-Worker-1/INFO]: Preparing spawn area: 34%, [09:19:11] [Server-Worker-1/INFO]: Preparing spawn area: 36%, [09:19:12] [Server-Worker-1/INFO]: Preparing spawn area: 37%, [09:19:12] [Server-Worker-1/INFO]: Preparing spawn area: 38%, [09:19:13] [Server-Worker-1/INFO]: Preparing spawn area: 39%, [09:19:13] [Server-Worker-1/INFO]: Preparing spawn area: 40%, [09:19:14] [Server-Worker-1/INFO]: Preparing spawn area: 40%, [09:19:14] [Server-Worker-1/INFO]: Preparing spawn area: 42%, [09:19:15] [Server-Worker-1/INFO]: Preparing spawn area: 43%

dquartino avatar Apr 16 '20 09:04 dquartino

The timing doesn't quite line up, but it looks like it failed to reach a healthy state in time and docker started to initiate a stop of the container.

The default healthcheck is configured in the image https://github.com/itzg/docker-minecraft-server/blob/master/Dockerfile#L20

Given yours is taking just a little bit longer to start, you can adjust the start_period and retries using

https://docs.docker.com/compose/compose-file/#healthcheck

itzg avatar Apr 16 '20 18:04 itzg

Can confirm the issue. The thing is that first run (spawn generation) takes time, and if livenessProbe/healthcheck is made before server is really ready (spawn generated), then TERM is being sent. Currently only sane solution is to delay the check.

gynter avatar Apr 16 '20 20:04 gynter

Thanks for you feedback, it was indeed due to the healthcheck. The start_period of 60s seems to be too short on first launch.

120s fix the problem.

dquartino avatar Apr 17 '20 11:04 dquartino