question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failing to connect to Kafka

See original GitHub issue

Hi, Trying to make a connection to Kafka and produce message(son) to a topic but failing to connect.

Whilst sending a message using JMeter below issues are seen Kafka producer is closing with timeout=0ms Login module control flag not specified in JAAS config.

Please find the login specified in jaas.conf Screen Shot 2022-05-04 at 12 55 43

Have tried all the possible ways in defining the credentials in config file but didn’t worked, would appreciate your help in sorting the issue?

Thanks

KloadGen Version

Kloadgen-3.5.3

Relevant log output

INFO o.a.k.c.p.KafkaProducer: [Producer clientId=perf-test] Closing the Kafka producer with timeoutMillis = 0 ms.
2022-04-28 11:04:20,547 INFO o.a.k.c.m.Metrics: Metrics scheduler closed
2022-04-28 11:04:20,547 INFO o.a.k.c.m.Metrics: Closing reporter org.apache.kafka.common.metrics.JmxReporter
2022-04-28 11:04:20,547 INFO o.a.k.c.m.Metrics: Metrics reporters closed
2022-04-28 11:04:20,547 INFO o.a.k.c.u.AppInfoParser: App info kafka.producer for perf-test unregistered
2022-04-28 11:04:20,548 ERROR o.a.j.p.j.s.AbstractJavaSamplerClient: Failed to construct kafka producer
org.apache.kafka.common.KafkaException: Failed to construct kafka producer
	at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:440) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:291) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:318) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:303) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at net.coru.kloadgen.sampler.KafkaSchemaSampler.setupTest(KafkaSchemaSampler.java:113) [kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:194) [ApacheJMeter_java.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.4.1]
	at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.IllegalArgumentException: Login module control flag not specified in JAAS config
	at org.apache.kafka.common.security.JaasConfig.parseAppConfigurationEntry(JaasConfig.java:110) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.kafka.common.security.JaasConfig.<init>(JaasConfig.java:63) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.kafka.common.security.JaasContext.load(JaasContext.java:88) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.kafka.common.security.JaasContext.loadClientContext(JaasContext.java:82) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:167) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.kafka.common.network.ChannelBuilders.clientChannelBuilder(ChannelBuilders.java:81) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:105) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.kafka.clients.producer.KafkaProducer.newSender(KafkaProducer.java:448) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:429) ~[kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	... 10 more
2022-04-28 11:04:20,552 ERROR o.a.j.p.j.s.AbstractJavaSamplerClient: Failed to send message
java.lang.NullPointerException: Cannot invoke "org.apache.kafka.clients.producer.KafkaProducer.send(org.apache.kafka.clients.producer.ProducerRecord, org.apache.kafka.clients.producer.Callback)" because "this.producer" is null
	at net.coru.kloadgen.sampler.KafkaSchemaSampler.runTest(KafkaSchemaSampler.java:153) [kloadgen-3.5.3-kloadgen-plugin-3.5.3.jar:?]
	at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:197) [ApacheJMeter_java.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.4.1]
	at java.lang.Thread.run(Thread.java:833) [?:?]
2022-04-28 11:04:20,553 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group - KLoadgen 1-1
2022-04-28 11:04:20,553 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group - KLoadgen 1-1
2022-04-28 11:04:20,553 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2022-04-28 11:04:20,554 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

Have you added your JMX Testplan or a replica?

  • I have added a JMX testplan

Have you added your Schema or a replica?

  • I have added the Schema
Screen Shot 2022-05-04 at 13 17 38 Screen Shot 2022-05-04 at 13 18 04 Screen Shot 2022-05-04 at 13 18 26

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:45 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
jgbrizcommented, Jun 27, 2022

Hi @ShantiSumanth , You should be able to checkout the draft’s branch. No permissions needed.

1reaction
jgbrizcommented, Jun 23, 2022

Hi @ShantiSumanth,

We’ve made a solution to some problems we’ve detected processing the schema you provided us. Please, check the draft given in this issue, and try with that version.

Cheers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to connect to kafka cluster When running Kafka and ...
I run Kafka and Kafka-connect on different servers (Let`s say serverA ... ConnectException: Failed to connect to and describe Kafka cluster.
Read more >
Why Can't I Connect to Kafka? | Troubleshoot Connectivity
If the broker has not been configured correctly, the connections will fail. What sometimes happens is that people focus on only step 1...
Read more >
Kafka client applications are unable to connect to the cluster ...
Client applications are unable to produce or consume messages, connection errors are reported. Users are unable to login to the UI.
Read more >
Troubleshooting Kafka Connection Exceptions - 华为云
Checking the Network · Check whether the client and the Kafka instance are in the same VPC. If they are not in the...
Read more >
Kafka Connect is unable to recover from a closed ... - IBM
To resolve this issue, restart the Kafka Connect Service from Ambari. Important: If you restart the Network Performance Insight® database for any reason, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found