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

Failing to connect to Kafka #239

Closed
2 tasks done
ShantiSumanth opened this issue May 4, 2022 · 45 comments
Closed
2 tasks done

Failing to connect to Kafka #239

ShantiSumanth opened this issue May 4, 2022 · 45 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@ShantiSumanth
Copy link

ShantiSumanth commented May 4, 2022

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

@github-actions
Copy link

github-actions bot commented May 4, 2022

Thank you for collaborating with the project by giving us feedback!!' You will help us a lot if you can attach an example AVRO and an example Test Plan in order to be able to reproduce the error, if that is the case. Cheers

@cmunozgomez cmunozgomez added the bug Something isn't working label May 5, 2022
@cmunozgomez
Copy link
Contributor

Hi @ShantiSumanth

Thank you for your collaboration, we will review it and the changes/progress that we are making will inform you here.

@cmunozgomez cmunozgomez added the question Further information is requested label May 5, 2022
@ShantiSumanth
Copy link
Author

Thanks @cmunozgomez.

@cmunozgomez cmunozgomez assigned pedror19 and jgbriz and unassigned pedror19 May 5, 2022
@jgbriz
Copy link
Contributor

jgbriz commented May 10, 2022

Hi @ShantiSumanth

We are currently reviewing the issue. We'll inform you as soon as we get a solution.

@pedror19
Copy link
Contributor

Hi @ShantiSumanth
We have problems reading the config from a jaas.conf file, try to set the kafka client auth from the jaas.conf file in the java.security.auth.login.config property of the java request. It must be a single line string like this:

KafkaClient { org.apache.kafka.common.security.plain.PlainLoginModule required username=(xxxx) password=(+dljlsjfl); };

@pedror19 pedror19 added the blocked Waiting for answer label May 10, 2022
@ShantiSumanth
Copy link
Author

ShantiSumanth commented May 11, 2022

Hi @pedror19,

I've already included Kafka client auth in java request and added auth in a single line string but didn't work.
Screen Shot 2022-05-11 at 10 43 07.

Screen Shot 2022-05-11 at 10 46 05

Could you please look into this again.

Thanks

@pedror19 pedror19 removed the blocked Waiting for answer label May 11, 2022
@pedror19
Copy link
Contributor

Hi @ShantiSumanth,

We will review the problem again and you will be in formed as soon as we made some improvement.

@pedror19
Copy link
Contributor

Hi again @ShantiSumanth,
We figured out that you are still using the jass.conf file, you need to write the config like this.

imagen

@pedror19 pedror19 added the blocked Waiting for answer label May 11, 2022
@ShantiSumanth
Copy link
Author

ShantiSumanth commented May 11, 2022

Hello @pedror19,
I've added the Kafka auth details in the java request and it is throwing java.io.ioexception
Screen Shot 2022-05-11 at 13 28 43

@pedror19 pedror19 removed the blocked Waiting for answer label May 11, 2022
@pedror19
Copy link
Contributor

Hello again @ShantiSumanth.
We will review again your problem and inform you about any improvement as soon as posible

@jgbriz
Copy link
Contributor

jgbriz commented May 12, 2022

Hi @ShantiSumanth ,

We've noticed that you are using the 3.5.3 version of KLoadGen, can you update and use the lastest version? We will continue searching for the problem, but it'd be great if you can update so we can be sure the problem is not because of an old version.
One more thing, can you tell us where are you locating the jass.conf file?

@jemacineiras
Copy link
Contributor

Hi @ShantiSumanth,

we were playing around a bit with Kafka Authentication, and notice you need to pass the absolute path in the java.security.auth.login.config property. It also works if you put the module configuration in a line like my colleague @pedror19 said, but, without the KafkaClient part, neither the '{'.

Can you please try after update to the latest version (if possible)?

@pedror19
Copy link
Contributor

Hi @ShantiSumanth,
Adding to what @jemacineiras said you need to add to the java.security.auth.login.config the serviceName field like this:

org.apache.kafka.common.security.plain.PlainLoginModule required serviceName="yourServiceName" username="(xxxxx)" password="(+dljlsjfl)";

@pedror19 pedror19 added the blocked Waiting for answer label May 12, 2022
@ShantiSumanth
Copy link
Author

Thanks @pedror19 @jgbriz @jemacineiras .
I'm trying to get latest version of kloadgen plugin but failing to build the project. if possible would you mind providing me with latest version of kloadgen plugin please?

Thanks

@pedror19
Copy link
Contributor

Hi @ShantiSumanth,
Every version is deployed automatically to maven central repository, you can download the latest version from there.

@ShantiSumanth
Copy link
Author

Thanks @pedror19.

Ran script with latest version but still failing with same error(java.io exception and login module control flag not specified).

@jgbriz , jaas.conf file is located in jmeter/bin folder so given config file name directly in the request.
Screen Shot 2022-05-13 at 16 11 19

Adding file name in java request is throwing error " java.lang.IllegalArgumentException: Login module control flag not specified in JAAS config"

giving authentication as a single string in the request is failing with exception, " java.io.IOException:org.apache.kafka.common.security.plain.PlainLoginModule required serviceName="yourServiceName" username="(xxxxx)" password="(+dljlsjfl)"; (No such file or directory)".

Screen Shot 2022-05-13 at 16 04 06

Thanks

@pedror19 pedror19 removed the blocked Waiting for answer label May 16, 2022
@jgbriz
Copy link
Contributor

jgbriz commented May 16, 2022

Hello @ShantiSumanth ,
Thank you for the information, we'll look into it.

@jgbriz jgbriz added the blocked Waiting for answer label May 26, 2022
@jgbriz
Copy link
Contributor

jgbriz commented Jun 1, 2022

Hello @ShantiSumanth ,
We need more information about the error you are getting, so we can have a better look trying to get the cause of the problem.

@ShantiSumanth
Copy link
Author

Hi @jgbriz,
Apologies, lost my project so building the script again. Will give detailed information on error by eod.

Thanks

@jgbriz
Copy link
Contributor

jgbriz commented Jun 7, 2022

Hi @ShantiSumanth
No problem. In that case, I think it's better option to close this issue, and to reopen one in case you have other problems.

@ShantiSumanth
Copy link
Author

Hi @jgbriz,
Experiencing two issues now,

  1. failing to open Value Schema File Load Generator config. fyi... Loaded json file (file content screenshot

Screen Shot 2022-06-08 at 10 52 13

attached) 2. throwing java.io.IOException: Configuration Error, config error , think it is complaining about json file but the file is valid without errors. error details below, Caused by: java.lang.SecurityException: java.io.IOException: Configuration Error: Line 14: expected [option key], found [null] at sun.security.provider.ConfigFile$Spi.(ConfigFile.java:139) ~[?:?] at sun.security.provider.ConfigFile.(ConfigFile.java:104) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) ~[?:?] at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) ~[?:?] at java.lang.Class.newInstance(Class.java:645) ~[?:?] at javax.security.auth.login.Configuration$2.run(Configuration.java:258) ~[?:?] at javax.security.auth.login.Configuration$2.run(Configuration.java:249) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?]

Screen Shot 2022-06-08 at 10 50 15

Please let me know if further details required for investigating.

Thanks

@jgbriz
Copy link
Contributor

jgbriz commented Jun 8, 2022

Hi @ShantiSumanth ,
We'll look into it.

@jgbriz jgbriz removed the blocked Waiting for answer label Jun 8, 2022
@jemacineiras
Copy link
Contributor

Hi @ShantiSumanth,

please, can you provide the required files in order to reproduce the error?
We are going to need the .jmx and .avsc ( or json schema) file you are using, or similar, in order to investigate and understand where is the problem.

Cheers

@ShantiSumanth
Copy link
Author

Hi @jemacineiras,
please find attached json and imx files
jsonfile.json.zip
CatalogueService-07June2022.jmx.zip
Thanks

@jemacineiras
Copy link
Contributor

Hi @ShantiSumanth,

those files are a bit confusing. What you want to achieve?
I need the original avsc file and the jmx, and you send to us a json file with values on it. This is not a data definition, as the plugin requires. May be if you describe the test you want to build, we can help you better.

Cheers

@ShantiSumanth
Copy link
Author

Hi @jemacineiras,
I've changed all the confidential info to dummy values.
Trying to produce/send a json file(shared earlier) to Kafka topic in confluent cloud. With the current script I'm able to successfully connect to confluent cloud and load subjects, subject values were loaded using Value Schema Load gen config.

Thanks

@jemacineiras
Copy link
Contributor

Hi @ShantiSumanth,

that is OK, but the json you send to us is not a valid json schema it looks like a Json with values. If you are trying to use this file as schema origin, it will not work.
If you try to use a data in JSON format, as source of the generation, we do not know what to generate, because there is no type and structure reference there.
Cheers!

@ShantiSumanth
Copy link
Author

Will speak to our Devs. Thanks @jemacineiras

@ShantiSumanth
Copy link
Author

Hi @jemacineiras,

Thanks for your support. Isn't the subject loaded on 'Value Schema Load Generator Config' type and structure reference? please correct me if I understood it wrongly.

Thanks
Screen Shot 2022-06-16 at 09 37 41

@jemacineiras
Copy link
Contributor

Hi @ShantiSumanth,

that’s right, but I'm talking about the files you sent to us. We need more information about your test and the files in order to reproduce, unless you give us clearance to deal with your files in the confluent cloud.

Cheers.

@ShantiSumanth
Copy link
Author

Hi @jemacineiras,
PFA schema.

schemaDoc.docx

@jgbriz jgbriz linked a pull request Jun 22, 2022 that will close this issue
@jgbriz jgbriz removed a link to a pull request Jun 22, 2022
@jgbriz jgbriz linked a pull request Jun 23, 2022 that will close this issue
@jgbriz
Copy link
Contributor

jgbriz commented 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.

@ShantiSumanth
Copy link
Author

Hi @jgbriz,

Unable pull the draft version due to authentication issues. would you mind sharing the version/jar please?

Thanks

@jgbriz
Copy link
Contributor

jgbriz commented Jun 27, 2022

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

@jgbriz jgbriz removed a link to a pull request Jul 4, 2022
jgbriz added a commit that referenced this issue Jul 4, 2022
@jgbriz
Copy link
Contributor

jgbriz commented Jul 4, 2022

Hi @ShantiSumanth ,
We've uploaded a new version with the fixes. Download the lastest version from maven-central and try it.

@ShantiSumanth
Copy link
Author

ShantiSumanth commented Jul 7, 2022

Hi @jgbriz,

I've tried with draft and latest version of plugin but still throwing same error
Screen Shot 2022-07-07 at 14 29 24

Also throwed an exception(Uncaught Exception org.apache.avro.SchemaParseException: No type: {"customerId":"0023422","correlationId":") whilst loading json file in Value scheme file load gen config
Could you please take a look and let me know if I have missed anything.

Thanks

@jemacineiras
Copy link
Contributor

Hi, @ShantiSumanth,

we are not able to reproduce the errors you comment to us about the Security Exception. Guessing you already had checkout all the properties with your dev team?

About the Schema Parse Exception... Why are you trying to parse a JSON into an AVO?
Is how is looks like reading that Also throwed an exception (Uncaught Exception org.apache.avro.SchemaParseException: No type: {"customerId":"0023422","correlationId":")

Cheers

@jemacineiras
Copy link
Contributor

Hi, @ShantiSumanth,

have you tried what I said the last time? Any luck with your test?

Cheers

@dianaGomezGar
Copy link
Contributor

I'm going to close due to inactivity. If you have any question you can open a new Issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants