itzg / itzg/docker-minecraft-server
Partially-downloaded server jar's are not handled well at the moment, preventing container start
- Dominant language
- Shell
- Stars
- 14.3k
- Forks
- 1.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 31
Description
Hi,
I've had a couple of cases recently where I've had to start and then quickly stop a new minecraft server container.
The scripts have correctly started downloading the latest jar but the container was stopped before it had finished.
On restarting the container I get ` Error: Invalid or corrupt jarfile minecraft_server.1.20.6.jar` or similar, unsurprisingly.
I would make sense to me to first download into a temporary file with a modified name, then rename. On every start we could delete any partially-downloaded files matching the temporary pattern, and then continue to re-download if required.
I'm happy to do this work (I submitted a PR for the bedrock image a while back).
Would this be better to be done as part of your `mc-image-helper get` in that repo or in this one, perhaps in `start-utils.sh`?
Thanks for all your effort on this.
### Container logs
```
[init] Setting initial memory to 1G and max to 1G
[init] Starting the Minecraft server...
Error: Invalid or corrupt jarfile minecraft_server.1.20.6.jar
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading start-utils.sh and checking the mc-image-helper get entry point mentioned in the issue to determine where the server jar download is handled. Reproduce a stopped download and restart, then verify that incomplete temporary files are cleaned up and a completed download is installed without producing an invalid jarfile.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100