itzg / docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup

Home Page:https://docker-minecraft-server.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to create new containers with 1.20.5 and 1.20.6

danabrey opened this issue · comments

Describe the problem

I'm having an issue creating new containers for version 1.20.5 and 1.20.6 on Ubuntu 22.04.

I've pulled the latest versions of both of the java17 and java21 tagged images. I may be doing something silly!

Container definition

With java21:

version: "3"
services:
  server:
    image: itzg/minecraft-server:java21
    volumes:
      - /data/minecraft-challenge-2024:/data
    ports:
      - "25565:25565"
    environment:
      - "EULA=TRUE"
      - "VERSION=1.20.6"
      - "MEMORY=4G"

With java17:

version: "3"
services:
  server:
    image: itzg/minecraft-server:java17
    volumes:
      - /data/minecraft-challenge-2024:/data
    ports:
      - "25565:25565"
    environment:
      - "EULA=TRUE"
      - "VERSION=1.20.6"
      - "MEMORY=4G"

Container logs

With java21:

server_1  | [init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 2 1000 1000 4096 May 22 12:36 /data'
server_1  | [init] ERROR: your Docker provider has an annoying flaw where it
server_1  | [init]        tries to set PATH even though the container establishes
server_1  | [init]        a very specific value.
server_1  | [init] ERROR: could not locate path that contains java
minecraftchallenge2024_server_1 exited with code 1

With java17:

server_1  | [init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 2 1000 1000 4096 May 22 12:37 /data'
server_1  | [init] Resolving type given VANILLA
server_1  | [init] Resolved version given 1.20.6 into 1.20.6
server_1  | [init] Downloading 1.20.6 server...
server_1  | [init] Creating server properties in /data/server.properties
server_1  | [init] Disabling whitelist functionality
server_1  | [mc-image-helper] 12:40:44.537 INFO  : Created/updated 4 properties in /data/server.properties
server_1  | [init] Setting initial memory to 4G and max to 4G
server_1  | [init] Starting the Minecraft server...
server_1  | Error: LinkageError occurred while loading main class net.minecraft.bundler.Main
server_1  | 	java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0
server_1  | 2024-05-22T12:40:51.822Z	WARN	mc-server-runner	Minecraft server failed. Inspect logs above for errors that indicate cause. DO NOT report this line as an error.	{"exitCode": 1}
server_1  | 2024-05-22T12:40:51.822Z	INFO	mc-server-runner	Done
minecraftchallenge2024_server_1 exited with code 1

You definitely need to be using the java21 image but note the error

server_1  | [init] ERROR: your Docker provider has an annoying flaw where it
server_1  | [init]        tries to set PATH even though the container establishes
server_1  | [init]        a very specific value.

Are you using Portainer? It's usually the one that breaks the PATH variable like that.

A docker compose down and then docker compose up -d might fix it since it would give a fresh container (but existing volume mapping) to be created.

Hmm, no, I'm just using regular docker and docker compose via the CLI.

I'll make sure I'm not using super old versions, it could be that.