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

Crash on invalid config value type #869

Closed
matthi4s opened this Issue Mar 17, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@matthi4s

matthi4s commented Mar 17, 2018

Glowstone build: 2018.3.0-SNAPSHOT.98b00f3 (MC: 1.12.2)

After searching for a problem with Glowstone server starts, I've discovered a bug in our system, which sets all lines with only monsters: in it to monsters: true/false. Glowstone completely crashes on start because of this (see output below) and doesn't even log anything, which makes it hard to find the issue. I don't know if the server should start when the config is invalid (reading ServerConfig.java it seems that it should only warn and use the default value), but it should probably still log the error and maybe give an information about the invalid option to simplify the debugging here.

To reproduce:

Set a glowstone.yml config option to an invalid type (e.g. set creatures.limit.monsters to true)


Output:

22:37:28 [INFO] This server is running Glowstone version 2018.3.0-SNAPSHOT.98b00f3 (MC: 1.12.2) (Implementing API version 1.12.2-R2.0-SNAPSHOT)
22:37:29 [SEVERE] Error during server startup.
java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Integer
	at java.util.function.Predicate.lambda$or$2(Predicate.java:101)
	at net.glowstone.util.config.ServerConfig.load(ServerConfig.java:269)
	at net.glowstone.GlowServer.loadConfig(GlowServer.java:980)
	at net.glowstone.GlowServer.(GlowServer.java:444)
	at net.glowstone.GlowServer.createFromArguments(GlowServer.java:494)
	at net.glowstone.GlowServer.main(GlowServer.java:454)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment