devshawn/kafka-gitops

plan dies with a nullpointer exception

Opened this issue ยท 5 comments

After setting KAFKA_SASL_JAAS_USERNAME, KAFKA_SASL_JAAS_PASSWORD and KAFKA_BOOTSTRAP_SERVERS running kafka-gitops validate as well as kafka-gitops plan results in

java.lang.NullPointerException
	at com.devshawn.kafka.gitops.config.KafkaGitopsConfigLoader.handleAuthentication(KafkaGitopsConfigLoader.java:62)
	at com.devshawn.kafka.gitops.config.KafkaGitopsConfigLoader.setConfig(KafkaGitopsConfigLoader.java:41)
	at com.devshawn.kafka.gitops.config.KafkaGitopsConfigLoader.load(KafkaGitopsConfigLoader.java:18)
	at com.devshawn.kafka.gitops.StateManager.<init>(StateManager.java:63)
	at com.devshawn.kafka.gitops.cli.PlanCommand.call(PlanCommand.java:37)
	at com.devshawn.kafka.gitops.cli.PlanCommand.call(PlanCommand.java:19)
	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:76)

I tried it with both 0.2.14 and 0.2.15.

Looking at the error - and checking the line in the code
if (config.get(SaslConfigs.SASL_MECHANISM).equals("PLAIN")) {

You're likely missing the setting KAFKA_SASL_MECHANISM

It happened with me as well. The issue for me was - one of the config values are empty or null.

If you're still interested, this issue should have been fixed in https://github.com/joschi/kafka-gitops/releases/tag/0.2.16.

Then we can actually close the issue. Thank you so much :)

Then we can actually close the issue. Thank you so much :)

Please note that https://github.com/joschi/kafka-gitops is an unofficial fork of this project. ๐Ÿ˜„