Skip to content
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

"konduit serve" CLI: Confusing error when configuration path does not exist #446

Open
AlexDBlack opened this issue Jul 7, 2020 · 0 comments
Assignees
Labels
UX User experience

Comments

@AlexDBlack
Copy link
Contributor

konduit serve -c does-not-exist.json -id demo_server gives the error below.
What actually happened here was I had a typo in the name of the JSON file. However, rather than "file X does not exist" I got a very confusing error, because the CLI was attempting to interpret the filename as an actual JSON string (because it wasn't a valid path).

Given configuration: 'does-not-exist.json' does not contain a valid JSON/YAML object


Errors while processing as a json string:
org.nd4j.shade.jackson.core.JsonParseException: Unrecognized token 'does': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)"does-not-exist.json"; line: 1, column: 5]
        at org.nd4j.shade.jackson.core.JsonParser._constructError(JsonParser.java:1840)
        at org.nd4j.shade.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:722)
        at org.nd4j.shade.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2868)
        at org.nd4j.shade.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1914)
        at org.nd4j.shade.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:773)
        at org.nd4j.shade.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4247)
        at org.nd4j.shade.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2720)
        at ai.konduit.serving.cli.launcher.command.build.extension.ServeBuildCommand.readConfiguration(ServeBuildCommand.java:171)
        at ai.konduit.serving.cli.launcher.command.build.extension.ServeBuildCommand.getConfigurationFromFileOrString(ServeBuildCommand.java:156)
        at ai.konduit.serving.cli.launcher.command.build.extension.ServeBuildCommand.run(ServeBuildCommand.java:83)
        at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:248)
        at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:383)
        at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:346)
        at ai.konduit.serving.cli.launcher.KonduitServingLauncher.exec(KonduitServingLauncher.java:70)
        at ai.konduit.serving.cli.launcher.KonduitServingLauncher.main(KonduitServingLauncher.java:61)


Errors while processing as a yaml string:
java.lang.IllegalStateException: Expected JsonNode to be ObjectNode but was TextNode while parsing as a YAML object. This usually indicates that the YAML was not parsed as expected. Could be a bad configuration file path in: does-not-exist.json
        at ai.konduit.serving.cli.launcher.command.build.extension.ServeBuildCommand.readConfiguration(ServeBuildCommand.java:176)
        at ai.konduit.serving.cli.launcher.command.build.extension.ServeBuildCommand.getConfigurationFromFileOrString(ServeBuildCommand.java:156)
        at ai.konduit.serving.cli.launcher.command.build.extension.ServeBuildCommand.run(ServeBuildCommand.java:83)
        at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:248)
        at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:383)
        at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:346)
        at ai.konduit.serving.cli.launcher.KonduitServingLauncher.exec(KonduitServingLauncher.java:70)
        at ai.konduit.serving.cli.launcher.KonduitServingLauncher.main(KonduitServingLauncher.java:61)
Invalid JSON/YAML configuration or invalid configuration file path defined by:
does-not-exist.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UX User experience
Projects
None yet
Development

No branches or pull requests

2 participants