Resolving the "Failed to start the minecraft server" error
There are many different causes for this error on a Minecraft server, but some of the most common issues can be found below.
Invalid JSON Syntax
If you have invalid JSON syntax in any of your JSON configuration files, you may see an error on the server shortly after starting it up, looking something like this:
java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350) ~[JsonReader.class:?]
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80) ~[CollectionTypeAdapterFactory$Adapter.class:?]
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61) ~[CollectionTypeAdapterFactory$Adapter.class:?]
at net.minecraft.util.JsonUtils.func_193838_a(SourceFile:504) ~[rc.class:?]
at net.minecraft.util.JsonUtils.func_193841_a(SourceFile:522) ~[rc.class:?]
at net.minecraft.server.management.PlayerProfileCache.func_152657_b(SourceFile:177) ~[ph.class:?]
at net.minecraft.server.management.PlayerProfileCache.<init>(SourceFile:63) ~[ph.class:?]
at net.minecraft.server.MinecraftServer.main(MinecraftServer.java:1541) [MinecraftServer.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_265]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_265]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_265]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_265]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_265]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_265]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_265]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_265]
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:70) [sevtech-3.1.5.jar:?]
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34) [sevtech-3.1.5.jar:?]
This error is pretty ambiguous, and the specific IllegalStateException
may differ depending on how exactly your JSON is malformed, but from the com.google.gson.stream.JsonReader
mention in the stacktrace, we can assume this is JSON related.
Resolution
Double check the JSON syntax in any and all of your configuration files, including
ops.json
andwhitelist.json
Clear/delete the
usercache.json
andusernamecache.json
files if they exist on your server. These are cache files the game generates for UUID and username tracking, but can sometimes become corrupt. Deleting them will have no noticeable negative effects on your server and these files will be regenerated as they are needed.