jobson icon indicating copy to clipboard operation
jobson copied to clipboard

jobson serve without arguments should load config.yml

Open DannyBen opened this issue 2 years ago • 0 comments

EDIT: I found the problem, leaving the original issue below in case it is of interest.

Running jobson serve without a file is possible, and it does not load the default config.yml. Only running jobson serve config.yml works.

I believe this is a bug. Either disallow running without a filename, or default to the file created by jobson new (config.yml).


First of all, this is a magnificent project with a perfect name.

I have followed the standard installation (.deb) procedures, created a workspace, a user and a spec. After that, running jobson serve shows this error below.

There is no usersConfiguration anywhere in any of the generated files, so not sure where else to look for the problem's root cause.

Also as a side topic: I would suggest disabling the output of the java backtrace (perhaps unless an environment variable is set) - this information is of no use to the end users, and only makes it seem like an "unhandled error".

I am not providing the config.yml, since it is the default one generated by the new command.

Note: I just noticed this is also happening when using jobson new --demo - same error.

I am on Ubuntu 20.04.5 LTS if that matters.

$ jobson serve
io.dropwizard.configuration.ConfigurationParsingException: default configuration has an error:
  * Unrecognized field at: usersConfiguration
    Did you mean?:
      - authentication
      - execution
      - users
      - workingDirs
      - server
        [5 more]

	at io.dropwizard.configuration.ConfigurationParsingException$Builder.build(ConfigurationParsingException.java:278)
	at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:139)
	at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:108)
	at io.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:128)
	at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:74)
	at io.dropwizard.cli.Cli.run(Cli.java:78)
	at io.dropwizard.Application.run(Application.java:94)
	at com.github.jobson.App.main(App.java:74)
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "usersConfiguration" (class com.github.jobson.config.ApplicationConfig), not marked as ignorable (10 known properties: "metrics", "jobs", "workingDirs", "specs", "logging", "server", "users", "admin", "authentication", "execution"])
 at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: com.github.jobson.config.ApplicationConfig["usersConfiguration"])
	at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61)
	at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:843)
	at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1206)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1610)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1588)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:294)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
	at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4189)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2476)
	at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:126)
	... 6 more

DannyBen avatar Oct 25 '22 07:10 DannyBen