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.23k stars 1.52k forks source link

Latest build mc-runner is broken - java path seems wrong #749

Closed gundestrup closed 3 years ago

gundestrup commented 3 years ago
From my log date stream content
2021-02-07 10:30:01 stdout 2021-02-07T10:30:01.682Z INFO mc-server-runner Done
2021-02-07 10:30:01 stdout 2021-02-07T10:30:01.681Z ERROR mc-server-runner command failed abnormally {"error": "exec: not started"}
2021-02-07 10:30:01 stdout 2021-02-07T10:30:01.681Z ERROR mc-server-runner Failed to start {"error": "exec: \"java\": executable file not found in $PATH"}
2021-02-07 10:30:01 stdout [init] Starting the Minecraft server...
2021-02-07 10:30:01 stdout [init] Setting initial memory to 4G and max to 4G
2021-02-07 10:30:01 stdout [init] Checking for JSON files.
2021-02-07 10:30:01 stdout [init] log4j2.xml already created, skipping
2021-02-07 10:30:01 stdout [init] server.properties already created, skipping
2021-02-07 10:30:01 stdout [init] Resolving type given VANILLA
2021-02-07 10:30:01 stdout [init] Resolved version given LATEST into 1.16.5
2021-02-07 10:30:01 stdout [init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x    1 1000     1000           282 Jan 30 14:59 /data'
gundestrup commented 3 years ago

it seems related to the updated java version new java home /opt/java/openjdk old java home /usr/lib/jvm/java-1.8-openjdk/jre

new path /opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin old path /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin

If you update the paths to the "new" it works

kanutten commented 3 years ago

hi, I'm having the same issue, where do I update the path for the updated version?

gundestrup commented 3 years ago

In the docker settings, enviroment

itzg commented 3 years ago

Seems to be a duplicate of https://github.com/itzg/docker-minecraft-server/issues/748 and that was "fixed" by re-pulling the image.

How are you creating the container? With Docker run, compose, or a docker management UI/platform?

I'm going to add some debunks to the next update though, because the PATH is set by the base image and shouldn't even become inconsistent.

Make sure your creation of the container isn't explicitly setting PATH.

kanutten commented 3 years ago

I use dockstarter, re-pulled the image, working fine now. thanks

gundestrup commented 3 years ago

I am using synology with the docker build in. I normaly turn off the container. Then I clear the container Then I download the image "latest". I then restart the container only fixed dir is /data

I did the same "operation" severel times, prior to posting this.

itzg commented 3 years ago

Is PATH being explicitly set by synology's container creation? Please cross-check that setup such as

> docker pull itzg/minecraft-server
Using default tag: latest
latest: Pulling from itzg/minecraft-server
Digest: sha256:1c9e531ca74bf2b129c3e1ba1615b65046b3c6923f9ee678a7cde97cb02d9181
Status: Image is up to date for itzg/minecraft-server:latest
docker.io/itzg/minecraft-server:latest

> docker run --rm --entrypoint bash itzg/minecraft-server -c "env | grep PATH"
PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Also, inspecting the image history I was able to confirm what I mentioned about the base image is where PATH is getting set:

> docker history --no-trunc itzg/minecraft-server | grep PATH
<missing>                                                                 20 hours ago        /bin/sh -c #(nop)  ENV JAVA_HOME=/opt/java/openjdk PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
itzg commented 3 years ago

I normaly turn off the container. Then I clear the container

Can you clarify what you meant by that? Do you mean docker stop and docker rm?

acidrs03 commented 3 years ago

@itzg was having the same issue. Followed @gundestrup path change in the env variables fixed the issue. I use Portainer to install 90% of my containers. When a new version of a container is released i stop the running container, click the recreate button to enable it to pull a fresh image. Hope this info helps.

gundestrup commented 3 years ago

Screenshot Untitled link to info: https://www.synology.com/en-global/knowledgebase/DSM/help/Docker/Docker

Click the Action button and select one of the following from the drop-down menu: Start: Start a container that has been stopped. Restart: Restart a container. Stop: Stop running containers. Force stop: Force stop a container when Stop isn't working for unknown reasons. Clear: Clear a container to return it to its settings upon creation. Delete: Delete a container.

So "clearing" an docker deletes it's contens, but the settings "enviroment variables" are kept.

So if you changed the path of the variables at some point, that "update" does not get pushed into the container. See the settings here Capture

itzg commented 3 years ago

Really?? Synology's UI has a huge usability bug then. It shouldn't prepopulate the environment variables for you, as the user, to set from ALL of the ENVs. These should not be there:

image

gundestrup commented 3 years ago

The enviroment variables are populated when the docker is created. But not "updated" when new image is downloaded, and clocker is cleared.

itzg commented 3 years ago

The enviroment variables are populated when the docker is created.

IMHO Synology should not be doing that. Delete those variables and I am quite sure your issue will be fixed.

gundestrup commented 3 years ago

I just did that, and it failed

date stream content
2021-02-09 20:15:12 stdout 2021-02-09T20:15:12.905Z INFO mc-server-runner Done
2021-02-09 20:15:12 stdout 2021-02-09T20:15:12.905Z ERROR mc-server-runner command failed abnormally {"error": "exec: not started"}
2021-02-09 20:15:12 stdout 2021-02-09T20:15:12.904Z ERROR mc-server-runner Failed to start {"error": "exec: \"java\": executable file not found in $PATH"}
2021-02-09 20:15:12 stdout [init] Starting the Minecraft server...
2021-02-09 20:15:12 stdout [init] Setting initial memory to 1G and max to 1G
2021-02-09 20:15:12 stdout [init] Checking for JSON files.
2021-02-09 20:15:12 stdout [init] log4j2.xml already created, skipping
2021-02-09 20:15:12 stdout [init] server.properties already created, skipping
2021-02-09 20:15:12 stdout [init] Resolving type given VANILLA
2021-02-09 20:15:12 stdout [init] Resolved version given LATEST into 1.16.5
2021-02-09 20:15:12 stdout [init] Running as uid=1000 gid=1000 with /data as 'drwxrwxrwx    1 1000     1000           124 Feb  9 20:14 /data'
2021-02-09 20:14:36 stdout 2021-02-09T20:14:36.265Z INFO mc-server-runner Done
2021-02-09 20:14:36 stdout 2021-02-09T20:14:36.264Z ERROR mc-server-runner command failed abnormally {"error": "exec: not started"}
2021-02-09 20:14:36 stdout 2021-02-09T20:14:36.264Z ERROR mc-server-runner Failed to start {"error": "exec: \"java\": executable file not found in $PATH"}
2021-02-09 20:14:36 stdout [init] Starting the Minecraft server...
2021-02-09 20:14:36 stdout [init] Setting initial memory to 1G and max to 1G
2021-02-09 20:14:36 stdout [init] Checking for JSON files.
2021-02-09 20:14:36 stdout [init] Creating log4j2.xml in /data/log4j2.xml
2021-02-09 20:14:36 stdout [init] Skip setting enforce-whitelist
2021-02-09 20:14:36 stdout [init] Skip setting use-native-transport
2021-02-09 20:14:36 stdout [init] Skip setting prevent-proxy-connections
2021-02-09 20:14:36 stdout [init] Skip setting op-permission-level
2021-02-09 20:14:36 stdout [init] Skip setting network-compression-threshold
2021-02-09 20:14:36 stdout [init] Skip setting function-permission-level
2021-02-09 20:14:36 stdout [init] Skip setting entity-broadcast-range-percentage
2021-02-09 20:14:36 stdout [init] Skip setting enable-status
2021-02-09 20:14:36 stdout [init] Skip setting sync-chunk-writes
2021-02-09 20:14:36 stdout [init] Skip setting enable-jmx-monitoring
2021-02-09 20:14:36 stdout [init] Skip setting broadcast-rcon-to-ops
2021-02-09 20:14:36 stdout [init] Skip setting broadcast-console-to-ops
2021-02-09 20:14:36 stdout [init] Skip setting player-idle-timeout
2021-02-09 20:14:36 stdout [init] Skip setting resource-pack-sha1
2021-02-09 20:14:36 stdout [init] Skip setting resource-pack
2021-02-09 20:14:36 stdout [init] Skip setting level-type
2021-02-09 20:14:36 stdout [init] Skip setting allow-flight
2021-02-09 20:14:36 stdout [init] Setting online-mode to 'true' in /data/server.properties
2021-02-09 20:14:36 stdout [init] Skip setting generator-settings
2021-02-09 20:14:36 stdout [init] Skip setting pvp
2021-02-09 20:14:36 stdout [init] Skip setting level-seed
2021-02-09 20:14:36 stdout [init] Setting level-name to 'world' in /data/server.properties
2021-02-09 20:14:36 stdout [init] Skip setting max-world-size
2021-02-09 20:14:36 stdout [init] Skip setting max-players
2021-02-09 20:14:36 stdout [init] Setting rcon.port to '25575' in /data/server.properties
2021-02-09 20:14:36 stdout [init] Setting rcon.password to 'minecraft' in /data/server.properties
2021-02-09 20:14:36 stdout [init] Setting enable-rcon to 'true' in /data/server.properties
2021-02-09 20:14:36 stdout [init] Skip setting query.port
2021-02-09 20:14:36 stdout [init] Skip setting enable-query
2021-02-09 20:14:36 stdout [init] Skip setting max-tick-time
2021-02-09 20:14:36 stdout [init] Skip setting force-gamemode
2021-02-09 20:14:36 stdout [init] Skip setting max-build-height
2021-02-09 20:14:36 stdout [init] Skip setting snooper-enabled
2021-02-09 20:14:36 stdout [init] Skip setting hardcore
2021-02-09 20:14:36 stdout [init] Skip setting view-distance
2021-02-09 20:14:36 stdout [init] Skip setting generate-structures
2021-02-09 20:14:36 stdout [init] Skip setting spawn-protection
2021-02-09 20:14:36 stdout [init] Skip setting spawn-npcs
2021-02-09 20:14:36 stdout [init] Skip setting spawn-monsters
2021-02-09 20:14:36 stdout [init] Skip setting spawn-animals
2021-02-09 20:14:36 stdout [init] Skip setting enable-command-block
2021-02-09 20:14:36 stdout [init] Skip setting announce-player-achievements
2021-02-09 20:14:36 stdout [init] Skip setting allow-nether
2021-02-09 20:14:36 stdout [init] Setting motd to 'A Vanilla Minecraft Server powered by Docker' in /data/server.properties
2021-02-09 20:14:36 stdout [init] Setting server-port to '25565' in /data/server.properties
2021-02-09 20:14:36 stdout [init] Skip setting server-ip
2021-02-09 20:14:36 stdout [init] Setting server-name to 'Dedicated Server' in /data/server.properties
2021-02-09 20:14:36 stdout [init] Creating server.properties in /data/server.properties
2021-02-09 20:14:33 stdout [init] Downloading minecraft_server.1.16.5.jar ...
2021-02-09 20:14:33 stdout [init] Resolving type given VANILLA
2021-02-09 20:14:33 stdout [init] Resolved version given LATEST into 1.16.5
2021-02-09 20:14:33 stdout [init] Running as uid=1000 gid=1000 with /data as 'drwxrwxrwx    1 1000     1000            16 Feb  9 20:14 /data'
gundestrup commented 3 years ago

Runing the same container with the the enviroment variables default (added the EULA True)

date stream content
2021-02-09 20:17:44 stdout [20:17:44] [Worker-Main-2/INFO]: Preparing spawn area: 27%
2021-02-09 20:17:43 stdout [20:17:43] [Worker-Main-2/INFO]: Preparing spawn area: 26%
2021-02-09 20:17:43 stdout [20:17:43] [Worker-Main-2/INFO]: Preparing spawn area: 25%
2021-02-09 20:17:42 stdout [20:17:42] [Worker-Main-2/INFO]: Preparing spawn area: 24%
2021-02-09 20:17:42 stdout [20:17:42] [Worker-Main-2/INFO]: Preparing spawn area: 23%
2021-02-09 20:17:41 stdout [20:17:41] [Worker-Main-2/INFO]: Preparing spawn area: 22%
2021-02-09 20:17:41 stdout [20:17:41] [Worker-Main-2/INFO]: Preparing spawn area: 21%
2021-02-09 20:17:40 stdout [20:17:40] [Worker-Main-2/INFO]: Preparing spawn area: 20%
2021-02-09 20:17:40 stdout [20:17:40] [Worker-Main-2/INFO]: Preparing spawn area: 20%
2021-02-09 20:17:39 stdout [20:17:39] [Worker-Main-2/INFO]: Preparing spawn area: 18%
2021-02-09 20:17:39 stdout [20:17:39] [Worker-Main-2/INFO]: Preparing spawn area: 17%
2021-02-09 20:17:38 stdout [20:17:38] [Worker-Main-2/INFO]: Preparing spawn area: 16%
2021-02-09 20:17:38 stdout [20:17:38] [Worker-Main-2/INFO]: Preparing spawn area: 15%
2021-02-09 20:17:37 stdout [20:17:37] [Worker-Main-2/INFO]: Preparing spawn area: 15%
2021-02-09 20:17:37 stdout [20:17:37] [Worker-Main-2/INFO]: Preparing spawn area: 13%
2021-02-09 20:17:36 stdout [20:17:36] [Worker-Main-2/INFO]: Preparing spawn area: 11%
2021-02-09 20:17:36 stdout [20:17:36] [Worker-Main-2/INFO]: Preparing spawn area: 10%
2021-02-09 20:17:35 stdout [20:17:35] [Worker-Main-2/INFO]: Preparing spawn area: 9%
2021-02-09 20:17:35 stdout [20:17:35] [Worker-Main-2/INFO]: Preparing spawn area: 9%
2021-02-09 20:17:34 stdout [20:17:34] [Worker-Main-2/INFO]: Preparing spawn area: 9%
2021-02-09 20:17:34 stdout [20:17:34] [Worker-Main-2/INFO]: Preparing spawn area: 8%
2021-02-09 20:17:33 stdout [20:17:33] [Worker-Main-2/INFO]: Preparing spawn area: 7%
2021-02-09 20:17:33 stdout [20:17:33] [Worker-Main-2/INFO]: Preparing spawn area: 6%
2021-02-09 20:17:32 stdout [20:17:32] [Worker-Main-2/INFO]: Preparing spawn area: 6%
2021-02-09 20:17:32 stdout [20:17:32] [Worker-Main-2/INFO]: Preparing spawn area: 5%
2021-02-09 20:17:31 stdout [20:17:31] [Worker-Main-2/INFO]: Preparing spawn area: 4%
2021-02-09 20:17:31 stdout [20:17:31] [Worker-Main-2/INFO]: Preparing spawn area: 3%
2021-02-09 20:17:30 stdout [20:17:30] [Worker-Main-2/INFO]: Preparing spawn area: 3%
2021-02-09 20:17:30 stdout [20:17:30] [Worker-Main-2/INFO]: Preparing spawn area: 2%
2021-02-09 20:17:29 stdout [20:17:29] [Worker-Main-2/INFO]: Preparing spawn area: 2%
2021-02-09 20:17:29 stdout [20:17:29] [Worker-Main-2/INFO]: Preparing spawn area: 1%
2021-02-09 20:17:28 stdout [20:17:28] [Worker-Main-2/INFO]: Preparing spawn area: 1%
2021-02-09 20:17:28 stdout [20:17:28] [Worker-Main-2/INFO]: Preparing spawn area: 1%
2021-02-09 20:17:27 stdout [20:17:27] [Worker-Main-2/INFO]: Preparing spawn area: 0%
2021-02-09 20:17:27 stdout [20:17:27] [Worker-Main-2/INFO]: Preparing spawn area: 0%
2021-02-09 20:17:26 stdout [20:17:26] [Worker-Main-2/INFO]: Preparing spawn area: 0%
2021-02-09 20:17:26 stdout [20:17:26] [Worker-Main-2/INFO]: Preparing spawn area: 0%
2021-02-09 20:17:25 stdout [20:17:25] [Worker-Main-2/INFO]: Preparing spawn area: 0%
2021-02-09 20:17:25 stdout [20:17:25] [Worker-Main-2/INFO]: Preparing spawn area: 0%
2021-02-09 20:17:25 stdout [20:17:25] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
2021-02-09 20:17:16 stdout [20:17:16] [Server thread/INFO]: Preparing level "world"
2021-02-09 20:17:16 stdout [20:17:16] [Server thread/INFO]: Using epoll channel type
2021-02-09 20:17:16 stdout [20:17:16] [Server thread/INFO]: Starting Minecraft server on *:25565
2021-02-09 20:17:16 stdout [20:17:16] [Server thread/INFO]: Generating keypair
2021-02-09 20:17:16 stdout [20:17:16] [Server thread/INFO]: Default game type: SURVIVAL
2021-02-09 20:17:15 stdout [20:17:15] [Server thread/INFO]: Loading properties
2021-02-09 20:17:15 stdout [20:17:15] [Server thread/INFO]: Starting minecraft server version 1.16.5
2021-02-09 20:17:12 stdout [20:17:12] [Worker-Main-2/INFO]: Loaded 927 advancements
2021-02-09 20:17:11 stdout [20:17:11] [Worker-Main-2/INFO]: Loaded 7 recipes
2021-02-09 20:17:10 stdout [20:17:10] [main/INFO]: Reloading ResourceManager: Default
2021-02-09 20:17:10 stdout [20:17:10] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
2021-02-09 20:17:10 stdout [20:17:10] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
2021-02-09 20:17:10 stdout [20:17:10] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
2021-02-09 20:17:10 stdout [20:17:10] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
2021-02-09 20:17:10 stdout [20:17:10] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
2021-02-09 20:17:09 stdout [20:17:09] [main/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
2021-02-09 20:16:58 stdout [init] Starting the Minecraft server...
2021-02-09 20:16:58 stdout [init] Setting initial memory to 1G and max to 1G
2021-02-09 20:16:58 stdout [init] Checking for JSON files.
2021-02-09 20:16:58 stdout [init] Creating log4j2.xml in /data/log4j2.xml
2021-02-09 20:16:58 stdout [init] Skip setting enforce-whitelist
2021-02-09 20:16:58 stdout [init] Skip setting use-native-transport
2021-02-09 20:16:58 stdout [init] Skip setting prevent-proxy-connections
2021-02-09 20:16:58 stdout [init] Skip setting op-permission-level
2021-02-09 20:16:58 stdout [init] Skip setting network-compression-threshold
2021-02-09 20:16:58 stdout [init] Skip setting function-permission-level
2021-02-09 20:16:58 stdout [init] Skip setting entity-broadcast-range-percentage
2021-02-09 20:16:58 stdout [init] Skip setting enable-status
2021-02-09 20:16:58 stdout [init] Skip setting sync-chunk-writes
2021-02-09 20:16:58 stdout [init] Skip setting enable-jmx-monitoring
2021-02-09 20:16:58 stdout [init] Skip setting broadcast-rcon-to-ops
2021-02-09 20:16:58 stdout [init] Skip setting broadcast-console-to-ops
2021-02-09 20:16:58 stdout [init] Skip setting player-idle-timeout
2021-02-09 20:16:58 stdout [init] Skip setting resource-pack-sha1
2021-02-09 20:16:58 stdout [init] Skip setting resource-pack
2021-02-09 20:16:58 stdout [init] Skip setting level-type
2021-02-09 20:16:58 stdout [init] Skip setting allow-flight
2021-02-09 20:16:58 stdout [init] Setting online-mode to 'true' in /data/server.properties
2021-02-09 20:16:58 stdout [init] Skip setting generator-settings
2021-02-09 20:16:58 stdout [init] Skip setting pvp
2021-02-09 20:16:58 stdout [init] Skip setting level-seed
2021-02-09 20:16:58 stdout [init] Setting level-name to 'world' in /data/server.properties
2021-02-09 20:16:58 stdout [init] Skip setting max-world-size
2021-02-09 20:16:58 stdout [init] Skip setting max-players
2021-02-09 20:16:58 stdout [init] Setting rcon.port to '25575' in /data/server.properties
2021-02-09 20:16:58 stdout [init] Setting rcon.password to 'minecraft' in /data/server.properties
2021-02-09 20:16:58 stdout [init] Setting enable-rcon to 'true' in /data/server.properties
2021-02-09 20:16:58 stdout [init] Skip setting query.port
2021-02-09 20:16:58 stdout [init] Skip setting enable-query
2021-02-09 20:16:58 stdout [init] Skip setting max-tick-time
2021-02-09 20:16:58 stdout [init] Skip setting force-gamemode
2021-02-09 20:16:58 stdout [init] Skip setting max-build-height
2021-02-09 20:16:58 stdout [init] Skip setting snooper-enabled
2021-02-09 20:16:58 stdout [init] Skip setting hardcore
2021-02-09 20:16:58 stdout [init] Skip setting view-distance
2021-02-09 20:16:58 stdout [init] Skip setting generate-structures
2021-02-09 20:16:58 stdout [init] Skip setting spawn-protection
2021-02-09 20:16:58 stdout [init] Skip setting spawn-npcs
2021-02-09 20:16:58 stdout [init] Skip setting spawn-monsters
2021-02-09 20:16:58 stdout [init] Skip setting spawn-animals
2021-02-09 20:16:58 stdout [init] Skip setting enable-command-block
2021-02-09 20:16:58 stdout [init] Skip setting announce-player-achievements
2021-02-09 20:16:58 stdout [init] Skip setting allow-nether
2021-02-09 20:16:58 stdout [init] Setting motd to 'A Vanilla Minecraft Server powered by Docker' in /data/server.properties
2021-02-09 20:16:58 stdout [init] Setting server-port to '25565' in /data/server.properties
2021-02-09 20:16:58 stdout [init] Skip setting server-ip
2021-02-09 20:16:58 stdout [init] Setting server-name to 'Dedicated Server' in /data/server.properties
2021-02-09 20:16:58 stdout [init] Creating server.properties in /data/server.properties
2021-02-09 20:16:56 stdout [init] Downloading minecraft_server.1.16.5.jar ...
2021-02-09 20:16:56 stdout [init] Resolving type given VANILLA
2021-02-09 20:16:56 stdout [init] Resolved version given LATEST into 1.16.5
2021-02-09 20:16:56 stdout [init] Running as uid=1000 gid=1000 with /data as 'drwxrwxrwx    1 1000     1000            16 Feb  9 20:16 /data'
2021-02-09 20:16:35 stdout /start-configuration: line 16: EULA: unbound variable
itzg commented 3 years ago

Can you provide a new screenshot of your Environment tab? Did you delete all of the variables including EULA before?

itzg commented 3 years ago

...and my apologies, I now see my screenshot/comment was misleading. Only these specific ones needed to be deleted:

image

gundestrup commented 3 years ago
Vanilla docker image (populated values) populated Screenshot of settings removed populated_removed Log shows /start-configuration: line 16: EULA: unbound variable stdout

From log when EULA is added and set to "True"

date stream content
2021-02-10 05:59:03 stdout 2021-02-10T05:59:03.637Z INFO mc-server-runner Done
2021-02-10 05:59:03 stdout 2021-02-10T05:59:03.637Z ERROR mc-server-runner command failed abnormally {"error": "exec: not started"}
2021-02-10 05:59:03 stdout 2021-02-10T05:59:03.637Z ERROR mc-server-runner Failed to start {"error": "exec: \"java\": executable file not found in $PATH"}
2021-02-10 05:59:03 stdout [init] Starting the Minecraft server...
2021-02-10 05:59:03 stdout [init] Setting initial memory to 1G and max to 1G
2021-02-10 05:59:03 stdout [init] Checking for JSON files.
2021-02-10 05:59:03 stdout [init] Creating log4j2.xml in /data/log4j2.xml
2021-02-10 05:59:03 stdout [init] Skip setting enforce-whitelist
2021-02-10 05:59:03 stdout [init] Skip setting use-native-transport
2021-02-10 05:59:03 stdout [init] Skip setting prevent-proxy-connections
2021-02-10 05:59:03 stdout [init] Skip setting op-permission-level
2021-02-10 05:59:03 stdout [init] Skip setting network-compression-threshold
2021-02-10 05:59:03 stdout [init] Skip setting function-permission-level
2021-02-10 05:59:03 stdout [init] Skip setting entity-broadcast-range-percentage
2021-02-10 05:59:03 stdout [init] Skip setting enable-status
2021-02-10 05:59:03 stdout [init] Skip setting sync-chunk-writes
2021-02-10 05:59:03 stdout [init] Skip setting enable-jmx-monitoring
2021-02-10 05:59:03 stdout [init] Skip setting broadcast-rcon-to-ops
2021-02-10 05:59:03 stdout [init] Skip setting broadcast-console-to-ops
2021-02-10 05:59:03 stdout [init] Skip setting player-idle-timeout
2021-02-10 05:59:03 stdout [init] Skip setting resource-pack-sha1
2021-02-10 05:59:03 stdout [init] Skip setting resource-pack
2021-02-10 05:59:03 stdout [init] Skip setting level-type
2021-02-10 05:59:03 stdout [init] Skip setting allow-flight
2021-02-10 05:59:03 stdout [init] Setting online-mode to 'true' in /data/server.properties
2021-02-10 05:59:03 stdout [init] Skip setting generator-settings
2021-02-10 05:59:03 stdout [init] Skip setting pvp
2021-02-10 05:59:03 stdout [init] Skip setting level-seed
2021-02-10 05:59:03 stdout [init] Setting level-name to 'world' in /data/server.properties
2021-02-10 05:59:03 stdout [init] Skip setting max-world-size
2021-02-10 05:59:03 stdout [init] Skip setting max-players
2021-02-10 05:59:03 stdout [init] Setting rcon.port to '25575' in /data/server.properties
2021-02-10 05:59:03 stdout [init] Setting rcon.password to 'minecraft' in /data/server.properties
2021-02-10 05:59:03 stdout [init] Setting enable-rcon to 'true' in /data/server.properties
2021-02-10 05:59:03 stdout [init] Skip setting query.port
2021-02-10 05:59:03 stdout [init] Skip setting enable-query
2021-02-10 05:59:03 stdout [init] Skip setting max-tick-time
2021-02-10 05:59:03 stdout [init] Skip setting force-gamemode
2021-02-10 05:59:03 stdout [init] Skip setting max-build-height
2021-02-10 05:59:03 stdout [init] Skip setting snooper-enabled
2021-02-10 05:59:03 stdout [init] Skip setting hardcore
2021-02-10 05:59:03 stdout [init] Skip setting view-distance
2021-02-10 05:59:03 stdout [init] Skip setting generate-structures
2021-02-10 05:59:03 stdout [init] Skip setting spawn-protection
2021-02-10 05:59:03 stdout [init] Skip setting spawn-npcs
2021-02-10 05:59:03 stdout [init] Skip setting spawn-monsters
2021-02-10 05:59:03 stdout [init] Skip setting spawn-animals
2021-02-10 05:59:03 stdout [init] Skip setting enable-command-block
2021-02-10 05:59:03 stdout [init] Skip setting announce-player-achievements
2021-02-10 05:59:03 stdout [init] Skip setting allow-nether
2021-02-10 05:59:03 stdout [init] Setting motd to 'A Vanilla Minecraft Server powered by Docker' in /data/server.properties
2021-02-10 05:59:03 stdout [init] Setting server-port to '25565' in /data/server.properties
2021-02-10 05:59:03 stdout [init] Skip setting server-ip
2021-02-10 05:59:03 stdout [init] Setting server-name to 'Dedicated Server' in /data/server.properties
2021-02-10 05:59:03 stdout [init] Creating server.properties in /data/server.properties
2021-02-10 05:59:01 stdout [init] Downloading minecraft_server.1.16.5.jar ...
2021-02-10 05:59:01 stdout [init] Resolving type given VANILLA
2021-02-10 05:59:01 stdout [init] Resolved version given LATEST into 1.16.5
2021-02-10 05:59:01 stdout [init] Running as uid=1000 gid=1000 with /data as 'drwxrwxrwx    1 1000     1000            16 Feb 10 05:59 /data'

So it seems that Synology populated the enviroments values at generation. They exposes alle of the values The values are not "reset" to default when image is cleared

I lack deep understanding is how values are set in a docker image, But are there any option of set If XXX is not present in image, then add this setting?

I am running crashplan for years (also java based with many many updated, where the images is cleared). I am had any problems with that image. See screenshot of their settings Capture_crashplan

regards Svend

itzg commented 3 years ago

There's a bug right now preventing the proper log message, but you need to acknowledge the EULA

https://github.com/itzg/docker-minecraft-server

I'll fix the logging of that though.

gundestrup commented 3 years ago

If the EULA is not accepted I get this "

/start-configuration: line 16: EULA: unbound variable

"

If EULA is accepted, as stated in last post. I get the long start up ending in

" 2021-02-10 05:59:03 stdout 2021-02-10T05:59:03.637Z INFO mc-server-runner Done
2021-02-10 05:59:03 stdout 2021-02-10T05:59:03.637Z ERROR mc-server-runner command failed abnormally {"error": "exec: not started"}
2021-02-10 05:59:03 stdout 2021-02-10T05:59:03.637Z ERROR mc-server-runner Failed to start {"error": "exec: "java": executable file not found in $PATH"}
2021-02-10 05:59:03 stdout [init] Starting the Minecraft server...

"

ons. 10. feb. 2021 14.31 skrev Geoff Bourne notifications@github.com:

There's a bug right now preventing the proper log message, but you need to acknowledge the EULA

https://github.com/itzg/docker-minecraft-server

I'll fix the logging of that though.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/itzg/docker-minecraft-server/issues/749#issuecomment-776706548, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAHQT5TKTVKYAUIOSWN6BDS6KC7BANCNFSM4XHJXPPQ .

itzg commented 3 years ago

The eula is accepted (see screenshot)

🤷🏻‍♂️ was going off of the last one I saw up there where I don't see "EULA"

image

I lack deep understanding is how values are set in a docker image,

I'm afraid Synology is not helping you out then. FYI, since they're UI "helped you" by adding PATH and JAVA_HOME is override a 3rd party declaration

https://github.com/AdoptOpenJDK/openjdk-docker/blob/a1f43408ff2770a36d3e9b8e23ba7c03ab26c33c/15/jre/debian/Dockerfile.hotspot.releases.full#L67-L68

But are there any option of set If XXX is not present in image, then add this setting?

Technically, yes, in the startup script I can, but not when Synology is overriding the valid PATH.

itzg commented 3 years ago

Per our Discord-discussion, I have pushed an enhancement that will fix up the PATH when java is not found in currently configured PATH.

itzg commented 3 years ago

...and helps if I actually push the git branch

itzg commented 3 years ago

I'm going to close since it sounds like no one else has run into the old behavior.

Vettax commented 2 years ago

Hi Itzg, I'm facing an issue similar or linked to the issue above. Not sure I need to open a new case, let me know. I updated to the lastest image using the docker Synology UI (stop, reinit, download lasted) to move to minecraft 1.8.1, and I've got this error msg :

2022-02-13 11:47:18,stdout,[init] Running as uid=1039 gid=100 with /data as 'drwxrwxr-x 1 1039 100 1294 Feb 13 11:04 /data' 2022-02-13 11:47:18,stdout,[init] ERROR: PATH should not be explicitly passed into the container 2022-02-13 11:46:15,stdout,[init] Remove configuration of that variable.

I tried to remove, the PATH var, but it changed nothing. I also tried to remove all the unexpected var you mentionned here : image

So I only have this in my env : image

but still the same results :(

itzg commented 2 years ago

Please report this issue to your NAS vendor (Synology?). This is broken behavior in their docker implementation and I am no longer supporting a workaround because of their flaw.

Vettax commented 2 years ago

That's it , i'm using synology. Strange if i'm the only one.

I could try to report it to synology. But I need to understand the issue better.

I can understand the general idea of the test below, but not the details :

if ! which java > /dev/null; then
  log "ERROR: PATH should not be explicitly passed into the container"
  log "       Remove configuration of that variable."
  exit 1
fi

So if you detect java, that means it's visible in the path, so error (even if it's the good java, the exit leave no chance)

I made other tests to try to understand what was expecting by the docker. My path var was initialy set with : /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin

If remove the line PATH completely as mentionned above, it changed nothing, exit on error. If I keep PATH, but remove just java paths from it, it changed nothing. Strange. If I set PATH empty, behavior changed, but it's worse as it can't find any basic commands :

2022-02-15 08:21:04,stdout,[init] ERROR: PATH should not be explicitly passed into the container 2022-02-15 08:21:04,stdout,/start-configuration: line 71: which: No such file or directory 2022-02-15 08:21:04,stdout,[init] Running as uid= gid= with /data as '' 2022-02-15 08:21:04,stdout,/start-configuration: line 19: ls: No such file or directory 2022-02-15 08:21:04,stdout,/start-configuration: line 19: id: No such file or directory 2022-02-15 08:21:04,stdout,/start-configuration: line 19: id: No such file or directory 2022-02-15 08:21:04,stdout,/start: line 9: id: No such file or directory 2022-02-15 08:21:04,stdout,/start: line 7: chmod: No such file or directory

So I suppose minimum PATH is required, but I can't figure out why it's not working when I removed the java dirs from the PATH. Do you agree that a path like that is what you expect ? PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

(sorry to bother you with that, let me know if you really don't want to heard of synology users, I understand it's difficult to support multiple exotic cases)

itzg commented 2 years ago

@Vettax no, you're not the only one as you see in the comments above.

It is rare to encounter the issue because it only seems to happen when a container's image has been updated from one version of Java to another, which has happened with the latest image tag.

The issue to report is that no matter if you remove PATH their container definition is not honoring the PATH that has been set by the base image layers. Also, it is improper for their UI to even extract variables like PATH and print the use to change it. In what scenario would a user even want to change that without risking breaking the container's software. Set PATH to "/tmp" and it causes nothing to be located.

I'll work on putting a workaround back in place since I fully anticipate Synology to brush it off and somehow blame my image.

Vettax commented 2 years ago

Hi, Good news, I've found a workaround for synology users (at least for me :D). I tried to recreate a new container using the same image, and you were right : it works ok. So I compared the env vars in both cases (updated vs new), and it appears that I had more old vars than the ones you advice to suppress.

image

On the right, a container that works ok. On the left, one that was reinit/updated, but failed to start.

So here's the process that works for three containers on my syno :

Vars in red will be recreated with correct values (I suppose the one in blue are not used anymore). So, not sure you need a new patch. Or maybe just change the comment to indicate that old vars must be cleared... (not easy without the full list and process :( ) Anyway, thanks for your help, and this docker that helps a lot to get a server running easily.

itzg commented 2 years ago

Thanks for the research info @Vettax !