Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partially-downloaded server jar's are not handled well at the moment, preventing container start #2841

Open
potomato opened this issue May 22, 2024 · 2 comments

Comments

@potomato
Copy link

potomato commented May 22, 2024

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
@itzg
Copy link
Owner

itzg commented May 22, 2024

That's a really small window of failure; however, it's obviously not zero since you hit it 😄

You're right that if the mc-image-helper get operation were to download to a temp file and then move into the final location, then that would help close some of those failure windows. As for making the change there or start-utils then it is certainly viable either way, but seems slightly cleaner to enhance mc-image-helper.

So, if you're wanting to help out there, then that would be great. All I ask is that you make very small changes and feel free to send a draft PR with any initial changes you want to consider.

Copy link

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.

@github-actions github-actions bot added the status/stale No recently activity has been seen and will be closed soon. label Jun 22, 2024
@itzg itzg removed the status/stale No recently activity has been seen and will be closed soon. label Jun 22, 2024
@itzg itzg added enhancement and removed bug labels Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants