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

Missing properties are not reported clearly #97

Open
tgdavies opened this issue Dec 15, 2022 · 1 comment
Open

Missing properties are not reported clearly #97

tgdavies opened this issue Dec 15, 2022 · 1 comment

Comments

@tgdavies
Copy link

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)

@joschi
Copy link

joschi commented Jan 23, 2023

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants