kafka-gitops icon indicating copy to clipboard operation
kafka-gitops copied to clipboard

Missing properties are not reported clearly

Open tgdavies opened this issue 2 years ago • 1 comments

I had a reference to a property in my state.yaml:

replication: ${my_data_default_replication}

which I had failed to define in my props file.

The exception message is not very helpful.

[INFO] reading props from ../config/prod.props java.lang.NullPointerException at com.devshawn.kafka.gitops.service.ParserService.parseStateFile(ParserService.java:84) at com.devshawn.kafka.gitops.service.ParserService.parseStateFile(ParserService.java:42) at com.devshawn.kafka.gitops.StateManager.getAndValidateStateFile(StateManager.java:72) at com.devshawn.kafka.gitops.cli.ValidateCommand.call(ValidateCommand.java:26) at com.devshawn.kafka.gitops.cli.ValidateCommand.call(ValidateCommand.java:15) at picocli.CommandLine.executeUserObject(CommandLine.java:1783) at picocli.CommandLine.access$900(CommandLine.java:145) at picocli.CommandLine$RunLast.handle(CommandLine.java:2141) at picocli.CommandLine$RunLast.handle(CommandLine.java:2108) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1975) at picocli.CommandLine.execute(CommandLine.java:1904) at com.devshawn.kafka.gitops.MainCommand.main(MainCommand.java:69)

tgdavies avatar Dec 15 '22 06:12 tgdavies

@tgdavies Which version of kafka-gitops are you using?

The string "reading props from" doesn't appear in its sources anywhere. 🤔

ParserService.java:84 is about extracting the exception root cause and unfortunately offers quite some opportunities to fail with a NullPointerException: https://github.com/devshawn/kafka-gitops/blob/0.2.15/src/main/java/com/devshawn/kafka/gitops/service/ParserService.java#L84

Would you be able to share your desired state file, the properties file, and the exact command you're running?

joschi avatar Jan 23 '23 21:01 joschi