HOW TO TROUBLESHOOT A MINECRAFT SERVER
Minecraft, although is now a "full" version game, still has its bugs and when you couple it with a third-party server wrapper such as CraftBukkit and third-party plugins, you will eventually run into problems such as crashes, lag, errors, conflicts, and broken plugins. Server problems are inevitable with most Minecraft servers and the more plugins and the larger your world, the more likely you'll have these issues. This guide is meant to detail the basics of troubleshooting your server so you can narrow down where the issue is stemming from.
One point we'd like to emphasize is that server crashes and most causes of lag have nothing to do with the host themselves (this goes for all hosts - not just BeastNode). Every host runs the Minecraft/CraftBukkit "server" software (which is an actual file that IS the server itself) through Java, which is cross-platform and essentially allows all servers to run the same way. Due to this, it isn't the host that is actually "running" your server, it is the Minecraft/CraftBukkit server software that is running through Java that actually processes everything. The only time a crash is an issue on the host's side is if their actual hardware dies or if the operating system crashes - all other crashes are caused directly by Minecraft/CraftBukkit and plugins themselves. You will also want to realize that the host cannot fix all Minecraft related problems for you as they did not make the game, CraftBukkit, or the plugins you use - they can only give you their best effort at debugging the problems using their experience. User-error is also something is difficult for a host to fix since they did not configure your server nor did they install the plugins - so you always want to provide as much information as to how the problems started if you need help on these types of issues. However, some problems simply cannot be solved without either doing a world reset or complete plugin re-work.
FIRST STEP OF ANY SERVER ISSUES:
The first thing you want to do with ANY server problem is check your console or server.log. The console is basically a live version of the server.log, but the server.log file has a longer history since it is all the server messages recorded on your server, while the console is limited to the last 10,000 lines or so. A lot of the messages will look cryptic in the console/server.log, but you can usually find the error messages containing the names of the plugins the error is related to. Error messages are usually preceeded by a "[SEVERE]" tag. Some errors will tell you exactly what is wrong also, which makes it easier for you to troubleshoot it. In some cases, your server.log file will be in the gigabytes, which makes it impossible to open. Usually when your server.log file is this large, it is due to chunk corruption.
Hint: Most errors are displayed during the start up messages of the server or at the end before the server is restarted. Some errors are harmless and do not affect anything.
Tip: Deleting your server.log file (with the server off) will make it much shorter/cleaner and easier to see startup and shut down errors - it wouldn't be fun to have to download and open a 100MB log file each time.
Once you are able to figure out the problem plugin(s), the next step is to make sure that plugin, and all other plugins are up to date (including your CraftBukkit server JAR by using the Update button in the game panel). You can update your plugins using this method here (some plugins require you to delete the config for updated versions so it can generate a new config): https://www.beastnode.com/portal/knowledgebase/53/Updating-Plugins.html
This should clear up most plugin related errors, but if you're still getting errors, then they can be related to other issues, which requires further investigation. You'll want to check on the new errors and see if they are related to any plugins and use some of the methods described in this guide.
REMOVING THE WORLD AS A SOURCE OF THE PROBLEM:
Sometimes, the problem is something within the world itself (usually the cause of lag and crash issues). To test this, you will want to go into your game panel and change the "level-name" setting (default is "world") to something else (such as "test") and hit the "Save" button and allow the server to auto restart. This will create a new world folder in your server's directory called "test" (or whatever you named it) and will be a clean world. Check your server.log file to see if the same errors come up. Note that changing your level-name might interfere with how Multiverse and other multi-world plugins work - so you may have to disable them for this to work properly (you may also have to remove the 'test' world from your multi-world plugin's world list once done testing or it will auto regenerate the test world on every restart).
If this stops lag on your server, then it also means that something in your world is causing lag, which can be (but not limited to): redstone, pistons, water, lava, fires, mob overspawn, and mob farms. These have to be removed manually from your server.
At this point, you can also check to see if your plugins still throw errors in your server.log/console.
To change the world back to your old one, simply change the level-name back to whatever it was previously (capitalizations and spaces matter, so type it in exactly the same as before).
- Alternative world fix -
You can also "repair" your world by downloading it to your computer and running it in your vanilla Minecraft game client in single player mode. If your world is modded, this method may remove the modded items.
BASICS TO FIXING PLUGIN PROBLEMS:
In most cases, plugin errors are caused because they are improperly installed (e.g. some plugins require other plugins to be installed to work) or they are out of date. You ALWAYS want to make sure that your CraftBukkit server file is updated to the latest recommended build (from the game panel) and that the plugins you install support the same version of CraftBukkit. Differences in these versions can cause server errors, lag, and crashes. It is usually best to simply not install a plugin that doesn't support the latest CraftBukkit. Plugins can sometimes be updated at a very rapid rate, so you will always want to check on http://dev.bukkit.org and http://plugins.bukkit.org for the latest versions, then use this updating guide to update them: https://www.beastnode.com/portal/knowledgebase/53/Updating-Plugins.html
Note that dev.bukkit.org and plugins.bukkit.org may have the same plugins, but one of them may not be updated as plugin developers have switched between both of them, so one site may have an outdated version, while the other has the most up to date one.
If updating does not remove the errors, then it is likely an issue with your config. Some plugins require things such as a MySQL database (which we can provide by request) and if you don't enter in the MySQL database login info, then the plugin will throw errors. Other issues with plugin configs can come from old configs used with an updated version of the plugin, so you will need to delete the config, then restart the server so the plugin generates a new config for it. Some plugins also have data files that can become corrupt. In some cases, the data files can be manually edited to fix the problem, but you may end up having to delete (or rename it just in case you need it later on if it is repairable) the entire data folder for the plugin to fix the issue. Many causes of errors stemming from configs is in the .yml files - those have a VERY specific format that you must follow, failure to do so and getting even a single space wrong, will break the plugin and all associated plugins. You can check the syntax of any .yml file using this site: http://yaml-online-parser.appspot.com/
TYPES OF PLUGINS THAT CAN CAUSE LAG:
The following plugins can cause server lag:
Anti X-Ray (or any x-ray related plugin)
NPC (too many NPCs)
Wrong version of anti-lag plugins
Out of date/wrong version of plugins in general
THE PROCESS OF ELIMINATION:
One of the ways to test for server problems is to disable plugins in groups to narrow down the issue to a single plugin. You can either rename the plugin's .jar file at append ".disabled" at the end or make a new folder and drag the .jar files to disable in there (with the server off). Start up the server and check your console/server.log if the same errors are occuring or if they stop. If they stop, then you can slowly add in plugins again and restart the server each time to see if the error comes back, which will help you find the trouble plugin. Also, make sure you don't have two copies of the same plugin in your plugins folder.
WHAT TO DO IF YOUR SERVER DOESN'T START UP:
There are a few causes of why a server won't start up (at all), so we'll go over a few here.
1. You have no more disk space. Check the "Profile" page in your game panel to ensure you have not maxed out your disk space. This is common if you have backup plugins that you don't keep track of and it creates hundreds of backups, thus using up all of your disk space.
2. You have chunk corruption, which spams errors into your server.log file and makes it max our your disk space as it can increase into the gigabytes in size. You will want to delete your server.log file in this case and may need to load a new world.
3. Your CraftBukkit JAR file is corrupt. You can upload the latest version using the Update button in your game panel.
4. There is a plugin that freezes your server on start up. You will want to use the process of elimination as stated above and disable plugins until your server starts up, then narrow it down to a single (or a few) plugins that are causing the problems.
TYPES OF LAG:
There are different types of lag that can mean different things on your server. We'll go over a couple here:
1. Delayed block breaking, movement lag (you get moved "backwards in time" after walking a certain amount of time aka "rubber banding"), and damage delay.
-- This type of lag can usually stem from network lag (on the hosts side), lag on the client's own internet connection, server performance issues that can stem from plugins/world(s), and the use of external MySQL databases for plugins. One good way to determine if the lag is coming from your world/plugins is by using a plugin called "LagMeter" and using the /lag command when you feel lag. If the TPS is near 20, then the issue is related to other things.
2. Cannot (or barely) look around - framerate issue on the client side.
-- This type of lag is usually caused by something wrong with the chunk generation. It can also be caused by TNT explosions and damage to chunks caused by TNT. A new world may be required. This type of lag can also come up from using ore obfuscation or anti x-ray types of plugins. The only solution to that would be to update the plugin or to simply remove it.
We also have a list of common console/server errors with possible fixes and/or reasons for them on this page: https://www.beastnode.com/portal/knowledgebase/7/Common-Errors
Common errors that can usually cause crashes are out of memory errors and read timed out errors (both found in link above).