
How to fix zip file closed errors in Minecraft?
Updated on by Maddy Miller
Originally posted on
In Minecraft with tags Explainer, Minecraft Servers
Part 23 in a series on Running A Minecraft Server
1037 words, 4 minutes to read
If you run a Minecraft server, you might have come across cryptic errors such as “zip file closed” from various plugins, mods, or even the server itself.
https://madelinemiller.dev/blog/minecraft-zip-file-closed/If you run a Minecraft server, you might have come across cryptic errors such as “zip file closed” being attributed to various plugins, mods, or even the server itself. The error will often show up as java.lang.IllegalStateException: zip file closed. These errors can be caused by many different problems, most of which can easily be resolved. It’s also important to note that if a specific plugin or mod is mentioned in the error, it does not mean that plugin or mod is the problem. In fact it’s fairly difficult for a mod/plugin to actually cause this issue directly, so it’s much more likely for something else to be the cause.
Possible Causes and How to Fix it
Replacing JAR files while the server is running
The most common cause of errors like this is replacing jar files while the server is running. These can be jar files of plugins, mods, or even the server itself. All of these can cause this error. If this is what has caused the error, the fix is simple. Just restart your server, and in the future only replace jar files while the server is shut down. Given the way Java works, it can sometimes need to load code from jar files while the server is running. If a jar file is swapped out, suddenly the code that it is loading might not match up what it has loaded before, causing unexpected behaviour and errors.
Another way this can happen is if the jar file has actually been removed. Either by the file changing name, being deleted, getting moved, or the physical device being unplugged. A good rule of thumb is that if the file contains code that is actually run, most often jar files in a Minecraft server context, it should never be touched while the application is actually running.
If you do want to schedule a plugin update on a Paper server for next restart, placing it within the plugins/update folder is one way to do this. Plugins placed there will be installed into the server, replacing any older version of that plugin, on the next restart. This lets you safely update plugins without shutting down your server in the moment.
Background software modifying files
This can also happen while running a server within a cloud-synced folder, such as a folder owned by OneDrive or Dropbox, as they often change files as they’re used. Other software that can impact files in this way are certain Antivirus programs, backup software, or anything that performs occasional system scans. These can all cause the file to be marked as modified, and Java to get confused and consider the file closed. If you can, it’s best to avoid running servers from this type of folder.
Plugins failing to load
In some cases, a plugin failing to load can cause this error to happen for other plugins that depend on the failing plugin. To fix this, check your logs to see if any plugins are not loading, and ask the developers of those plugins for help. Generally, this will be most noticeable due to other errors occurring in your logs before the “zip file closed” ones. In these cases, it’s a good idea to get all of the other issues fixed to see if it resolves this issue.
Reloading the server
Bukkit-based servers such as Paper include a /reload command, which is known to cause issues. While there are many more devastating issues that command can cause, the “zip file closed” error is one that it’s capable of causing. To resolve this, restart your server and don’t use the /reload command or any plugins offering reload features such as PlugMan to reload plugins.
Running broken forks of Paper
Many servers are now running modified forks of the popular server software Paper, however some of these can contain large numbers of bugs and other issues. Some of these forks make buggy changes in a component known as a classloader, which is what Bukkit-based servers use to load plugins. A straightforward way to tell if this is your issue is to switch to Paper and see if that resolves the issue. If it does, issue solved.
JVM Bug
Worst case, it’s also possible you’ve either hit a Java bug, or a bug in the distribution of Java that you have downloaded. Many different companies package their own releases of Java, some of which can have modifications that will affect running a Minecraft server. A known working distribution of Java is AdoptOpenJDK or the Microsoft JDK. Other gotchas to look out for with Java distributions is making sure that they aren’t headless, and that you’re running the latest version compatible with your release of Minecraft.
Low quality Minecraft server host
If you’re using a Minecraft server host, it’s possible poor configuration of the underlying systems that power your Minecraft server are causing this issue. It can be hard to identify a good Minecraft server host, but determining if they’re causing this issue can be even harder. Usually if your host is causing this issue, it’ll be due to either software they’re running in the background that’s modifying files like mentioned above, or due to a broken version of Java being installed on the machine. If you’ve tried everything else and found that nothing is working, it might be worth contacting your host’s support about the issue.
Malware
It's also possible that this error is caused by the presence of malware. If this is the case, you should follow the steps outlined in this article to remove the malware from your system.
If it’s still an issue
If it’s still an issue, it’s time to start narrowing down any plugins or mods you have until the issue is resolved. There are many ways to do this, some are outlined in this post. From here, your best bet is to ask for support from the developers of the server software you’re using. Be it Paper, Forge, Fabric, or something else. It’s possible they’ve got a bug, or something else less common is going on.
Conclusion
The zip file closed error can be hard to pin down, as it nearly never tells you what’s causing it. Luckily in most cases the fix is simple. By avoiding the common causes of the issue you should be able to prevent it happening in nearly all cases.
Continue reading the next part of the series: Why you shouldn't use Offline Mode on a Minecraft Server



