Understanding stack traces

Jul 5, 2015
Understanding stack traces
  • Understanding stack traces

    How to determine how your server crashed


    Stack traces are essentially long error messages that are printed by a plugin (or software) to inform the user or developer of what went wrong. The stack trace contains two components: the actual error that occurred and where in the code it occurred. This information can help you, the server administrator, figure out what has gone wrong.


    Plugin Stacktraces(top)

    Here is an example plugin stack trace:
    Code (Text):
    [11:56:54] [Server thread/WARN]: java.lang.NullPointerException
    [11:56:54] [Server thread/WARN]:     at net.paradoxmc.NetworkManager.Points.PointsAPI.getPoints(PointsAPI.java:28)
    [11:56:54] [Server thread/WARN]:     at net.paradoxmc.NetworkManager.GizmoManager.ScoreboardManager$1.run(ScoreboardManager.java:40)
    [11:56:54] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftTask.run(CraftTask.java:71)
    [11:56:54] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
    [11:56:54] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:641)
    [11:56:54] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289)
    [11:56:54] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584)
    [11:56:54] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490)
    [11:56:54] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628)
    When looking at the top portion:
    Code (Text):
    [11:56:54] [Server thread/WARN]: java.lang.NullPointerException
    [11:56:54] [Server thread/WARN]:     at net.paradoxmc.NetworkManager.Points.PointsAPI.getPoints(PointsAPI.java:28)
    [11:56:54] [Server thread/WARN]:     at net.paradoxmc.NetworkManager.GizmoManager.ScoreboardManager$1.run(ScoreboardManager.java:40)
    For this error, we see that the actual error is on line 28 of PointsAPI.java, in a function called getPoints(). In this case, it was because this plugin's points system could not connect to the database. This function was called by ScoreboardManager$1.run() (an anonymous (as in no specified name) class inside the ScoreboardManager class), which would be the cause of your scoreboard updating.

    The second half of the stack trace is from the server software calling your code:
    Code (Text):
    [11:56:54] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftTask.run(CraftTask.java:71)
    [11:56:54] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
    [11:56:54] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:641)
    [11:56:54] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289)
    [11:56:54] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584)
    [11:56:54] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490)
    [11:56:54] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628)

    Stack traces while parsing YAML(top)

    People often get these confused, thinking it's a problem with the plugin. It typically is not. It is a problem that you have caused that can easily be rectified. This is a sample PermissionsEx stacktrace, caused by incorrect syntax when changing a prefix:
    Code (Text):
    ru.tehkode.permissions.exceptions.PermissionBackendException: Error loading permissions file!
        at ru.tehkode.permissions.backends.file.FileBackend.reload(FileBackend.java:331) ~[PermissionsEx.jar:?]
        at ru.tehkode.permissions.backends.file.FileBackend.<init>(FileBackend.java:119) ~[PermissionsEx.jar:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.7.0_55]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[?:1.7.0_55]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.7.0_55]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[?:1.7.0_55]
        at ru.tehkode.permissions.backends.PermissionBackend.getBackend(PermissionBackend.java:372) ~[PermissionsEx.jar:?]
        at ru.tehkode.permissions.backends.PermissionBackend.getBackend(PermissionBackend.java:347) ~[PermissionsEx.jar:?]
        at ru.tehkode.permissions.PermissionManager.createBackend(PermissionManager.java:713) ~[PermissionsEx.jar:?]
        at ru.tehkode.permissions.PermissionManager.setBackend(PermissionManager.java:695) ~[PermissionsEx.jar:?]
        at ru.tehkode.permissions.PermissionManager.initBackend(PermissionManager.java:772) ~[PermissionsEx.jar:?]
        at ru.tehkode.permissions.PermissionManager.<init>(PermissionManager.java:74) ~[PermissionsEx.jar:?]
        at ru.tehkode.permissions.bukkit.PermissionsEx.onEnable(PermissionsEx.java:158) [PermissionsEx.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316) [spigot.jar:git-Spigot-1604]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:329) [spigot.jar:git-Spigot-1604]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot.jar:git-Spigot-1604]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugin(CraftServer.java:476) [spigot.jar:git-Spigot-1604]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.enablePlugins(CraftServer.java:394) [spigot.jar:git-Spigot-1604]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.reload(CraftServer.java:866) [spigot.jar:git-Spigot-1604]
        at org.bukkit.Bukkit.reload(Bukkit.java:301) [spigot.jar:git-Spigot-1604]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) [spigot.jar:git-Spigot-1604]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181) [spigot.jar:git-Spigot-1604]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServer.java:767) [spigot.jar:git-Spigot-1604]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchServerCommand(CraftServer.java:753) [spigot.jar:git-Spigot-1604]
        at net.minecraft.server.v1_7_R4.DedicatedServer.aB(DedicatedServer.java:326) [spigot.jar:git-Spigot-1604]
        at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:290) [spigot.jar:git-Spigot-1604]
        at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [spigot.jar:git-Spigot-1604]
        at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [spigot.jar:git-Spigot-1604]
        at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [spigot.jar:git-Spigot-1604]
    Caused by: org.bukkit.configuration.InvalidConfigurationException: while parsing a block mapping
    in 'string', line 10, column 7:
              suffix: '&f'
              ^
    expected <block end>, but found Scalar
    in 'string', line 12, column 17:
              default: 'false'
                        ^

        at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:57) ~[spigot.jar:git-Spigot-1604]
        at ru.tehkode.permissions.backends.file.FileConfig.loadFromString(FileConfig.java:62) ~[PermissionsEx.jar:?]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:226) ~[spigot.jar:git-Spigot-1604]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:169) ~[spigot.jar:git-Spigot-1604]
        at ru.tehkode.permissions.backends.file.FileConfig.load(FileConfig.java:32) ~[PermissionsEx.jar:?]
        at ru.tehkode.permissions.backends.file.FileBackend.reload(FileBackend.java:319) ~[PermissionsEx.jar:?]
        ... 28 more
    Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping; expected <block end>, but found Scalar;  in 'string', line 12, column 17:
              default: 'false'
                        ^
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:570) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:143) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:159) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:237) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:159) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:237) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:159) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:237) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:159) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:120) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:481) ~[spigot.jar:git-Spigot-1604]
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:400) ~[spigot.jar:git-Spigot-1604]
        at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:55) ~[spigot.jar:git-Spigot-1604]
        at ru.tehkode.permissions.backends.file.FileConfig.loadFromString(FileConfig.java:62) ~[PermissionsEx.jar:?]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:226) ~[spigot.jar:git-Spigot-1604]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:169) ~[spigot.jar:git-Spigot-1604]
        at ru.tehkode.permissions.backends.file.FileConfig.load(FileConfig.java:32) ~[PermissionsEx.jar:?]
        at ru.tehkode.permissions.backends.file.FileBackend.reload(FileBackend.java:319) ~[PermissionsEx.jar:?]
        ... 28 more
    The strack trace informs you that there was an error while parsing the configuration. We will now use a tool (located at http://yaml-online-parser.appspot.com/) to identify the issue.

    This is the suspect group:
    Code (yml):
    Helper:
        build: false
        inheritance:
        - Member
        - Donor
        permissions:
        - networkmanager.nohide
        options:
          suffix: '&f'
          prefix: '&8[&9HELPER&8]
          default: 'false'
    When we paste the suspect portion of the permissions.yml file into the parser tool, this is what we get:
    [​IMG]

    From here you will be able to identify the errors and determine if you have fixed it in real time. Often the error will then show up on another line; in that case just look around.
  • Loading...
  • Loading...