Docker compose - Invalid or corrupt jarfile
Closed this issue · 4 comments
When running the default Docker compose script or specifying TYPE: VELOCITY, proxy container fails due to "Invalid or corrupt jarfile".
user@homelab:~/Containers/velocity-mc-server$ docker compose up
✔ Container velocity-mc-server-mc-1 Created 0.0s
✔ Container velocity-mc-server-proxy-1 Created 0.0s
Attaching to mc-1, proxy-1
proxy-1 | [init] Resolving type given BUNGEECORD
proxy-1 | [init] Copying configs over...
proxy-1 | [init] Replacing env variables in configs that match the prefix CFG_...
proxy-1 | [init] Setting initial memory to 512m and max to 512m
proxy-1 | Error: Invalid or corrupt jarfile /server/BungeeCord-1.jar
proxy-1 exited with code 1
user@homelab:~/Containers/velocity-mc-server$ docker compose up
✔ Container velocity-mc-server-mc-1 Created 0.0s
✔ Container velocity-mc-server-proxy-1 Recreated 0.2s
Attaching to mc-1, proxy-1
proxy-1 | [init] Resolving type given VELOCITY
proxy-1 | [init] Copying configs over...
proxy-1 | [init] Replacing env variables in configs that match the prefix CFG_...
proxy-1 | [init] Setting initial memory to 512m and max to 512m
proxy-1 | Error: Invalid or corrupt jarfile /server/velocity-3.4.0-SNAPSHOT-439.jar
proxy-1 exited with code 1
Both of these start fine for me
https://github.com/itzg/docker-mc-proxy/blob/master/docs/docker-compose.yml
https://github.com/itzg/docker-mc-proxy/blob/master/docs/velocity/docker-compose.yml
Provide the actual compose file you are using.
This is what I get using the velocity compose file you just linked. I'm unsure if this is the issue and whether or not it's from my Docker configuration, but when the proxy container is created the local dirs are owned by root. Any chance it's due to being in a symlinked dir?
user@homelab:/mnt/md0/containers/velocity-mc-server$ cat docker-compose.yml
services:
mc:
image: itzg/minecraft-server
environment:
EULA: "TRUE"
ONLINE_MODE: "FALSE"
TYPE: PAPER
SYNC_SKIP_NEWER_IN_DESTINATION: false
volumes:
- ./paper-global.yml:/config/paper-global.yml
proxy:
image: itzg/mc-proxy
environment:
TYPE: VELOCITY
DEBUG: "false"
ENABLE_RCON: "true"
ports:
- "25565:25577"
volumes:
- ./velocity.toml:/config/velocity.toml:ro
- ./forwarding.secret:/config/forwarding.secret:ro
- proxy:/server
volumes:
proxy: {}
user@homelab:~/Containers/velocity-mc-server$ docker compose up
[+] Running 3/3
✔ Network velocity-mc-server_default Created 0.1s
✔ Container velocity-mc-server-mc-1 Created 0.2s
✔ Container velocity-mc-server-proxy-1 Created 0.2s
Attaching to mc-1, proxy-1
proxy-1 | [init] Resolving type given VELOCITY
proxy-1 | [mc-image-helper] 00:28:26.737 INFO : Downloaded /server/velocity-3.4.0-SNAPSHOT-442.jar
proxy-1 | [init] Downloading Velocity rcon plugin
proxy-1 | [mc-image-helper] 00:28:28.634 INFO : Downloaded /server/plugins/utf-8''Tribufu-VelocityRcon-1.2.0.jar
proxy-1 | [init] Copy Velocity rcon configuration
proxy-1 | [init] Copying configs over...
proxy-1 | [init] Setting initial memory to 512m and max to 512m
proxy-1 | WARN StatusConsoleListener Advanced terminal features are not available in this environment
proxy-1 | [00:28:30 INFO]: Booting up Velocity 3.4.0-SNAPSHOT (git-2c8ce219-b442)...
proxy-1 | [00:28:30 INFO]: Loading localizations...
proxy-1 | [00:28:30 INFO]: Connections will use epoll channels, libdeflate (Linux x86_64) compression, OpenSSL 3.x.x (Linux x86_64) ciphers
proxy-1 | [00:28:30 ERROR]: Unable to read/load/save your velocity.toml. The server will shut down.
user@homelab:/mnt/md0/containers/velocity-mc-server$ ls -l
total 16
-rw-rw-r-- 1 user user 554 Oct 21 00:27 docker-compose.yml
drwxr-xr-x 2 root root 4096 Oct 21 00:27 forwarding.secret
drwxr-xr-x 2 root root 4096 Oct 21 00:27 paper-global.yml
drwxr-xr-x 2 root root 4096 Oct 21 00:27 velocity.toml
The files in the host directory are your responsibility to set with the correct ownership and permissions. Yes, perhaps whatever symlink'ing you're doing is the problem.
This issue is stale because it has been open 30 days with no activity. Please add a comment describing the reason to keep this issue open.