sngular / kloadgen

KLoadGen is kafka load generator plugin for jmeter designed to work with AVRO, JSON and PROTOL-BUFFERS schema Registries.
http://sngular.com
Mozilla Public License 2.0
208 stars 42 forks source link

[Issue]: Error while processing sampler: 'Kafka Broker'. java.lang.NullPointerException: Cannot invoke "String.toUpperCase()" because "registry" is null #428

Open xck1007 opened 9 months ago

xck1007 commented 9 months ago

What happened?

I get nullpointer exceptions when calling the kafka broker (java request). I can call the schema registry on a test basis. I can call the key schema und the value schema. But the java request (Kafka Broker) receives errors. Error.zip

KloadGen Version

my built version 5.6.11 on the basis of 5.6.7

Relevant log output

2023-12-12 09:00:10,548 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'Kafka Broker'.
java.lang.NullPointerException: Cannot invoke "String.toUpperCase()" because "registry" is null
    at com.sngular.kloadgen.schemaregistry.SchemaRegistryManagerFactory.getSchemaRegistry(SchemaRegistryManagerFactory.java:22) ~[kloadgen-5.6.11.jar:?]
    at com.sngular.kloadgen.loadgen.impl.SRLoadGenerator.retrieveSchema(SRLoadGenerator.java:20) ~[kloadgen-5.6.11.jar:?]
    at com.sngular.kloadgen.loadgen.impl.AvroSRLoadGenerator.setUpGenerator(AvroSRLoadGenerator.java:38) ~[kloadgen-5.6.11.jar:?]
    at com.sngular.kloadgen.sampler.SamplerUtil.configureKeyGenerator(SamplerUtil.java:456) ~[kloadgen-5.6.11.jar:?]
    at com.sngular.kloadgen.sampler.KafkaProducerSampler.setupTest(KafkaProducerSampler.java:83) ~[kloadgen-5.6.11.jar:?]
    at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:194) ~[ApacheJMeter_java.jar:5.6.2]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) ~[ApacheJMeter_core.jar:5.6.2]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) ~[ApacheJMeter_core.jar:5.6.2]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) [ApacheJMeter_core.jar:5.6.2]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) [ApacheJMeter_core.jar:5.6.2]
    at java.lang.Thread.run(Thread.java:833) [?:?]

2023-12-12 09:00:10,577 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'Kafka Broker'.
java.lang.NullPointerException: Cannot invoke "java.util.Collection.toArray()" because "c" is null
    at java.util.ArrayList.<init>(ArrayList.java:181) ~[?:?]
    at com.sngular.kloadgen.randomtool.util.ValueUtils.replaceValuesContext(ValueUtils.java:28) ~[kloadgen-5.6.11.jar:?]
    at com.sngular.kloadgen.randomtool.generator.StatelessGeneratorTool.generateObject(StatelessGeneratorTool.java:38) ~[kloadgen-5.6.11.jar:?]
    at com.sngular.kloadgen.sampler.KafkaProducerSampler.getProducerRecord(KafkaProducerSampler.java:176) ~[kloadgen-5.6.11.jar:?]
    at com.sngular.kloadgen.sampler.KafkaProducerSampler.runTest(KafkaProducerSampler.java:138) ~[kloadgen-5.6.11.jar:?]
    at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:197) ~[ApacheJMeter_java.jar:5.6.2]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) ~[ApacheJMeter_core.jar:5.6.2]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) ~[ApacheJMeter_core.jar:5.6.2]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) [ApacheJMeter_core.jar:5.6.2]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) [ApacheJMeter_core.jar:5.6.2]
    at java.lang.Thread.run(Thread.java:833) [?:?]

Have you added your JMX Testplan or a replica?

Have you added your Schema or a replica?

xck1007 commented 9 months ago

Can someone please help me here.

AdrianLagartera commented 9 months ago

Could you add the jmx without the Prometheus plugin part to give it a look?

xck1007 commented 9 months ago

Here's the file without Prometheus. Thank you very much for looking at it.

kloadgen-without-prometheus.zip

xck1007 commented 8 months ago

I need to upgrade to the latest jmeter version 5.6.3 for security reasons - I am currently still using version 5.5. They are forcing me to switch to 5.6.3 as soon as possible. If I don't have a solution for kloadgen, I will have to remove kloadgen with a heavy heart.

I would be very happy if kloadgen would work for me.

jemacineiras commented 8 months ago

This is really odd and sad. Still do not know why is failing to your setup since we aree working in the latest for a while. Can you please attach your full configuration, SO, JDK version, plugins you have installed and a sample JMX. I will try to replcate your setup in order to solve your issue.

Cheers

xck1007 commented 8 months ago

I am using JMeter 5.6.2, Windows 10, Java 17.0.3.1, kloadgen 5.6.10 (from https://mvnrepository.com/artifact/com.sngular/kloadgen/5.6.10). I have uploaded the JMX file, jmeter.log, property files and a screenshot with a list of the plugins in a ZIP file.

I also had the errors based on kloadgen 5.6.7 (I built a version myself because the one provided had dependency errors).

If you need anything else to analyse, just let me know. Thank you very much for looking at this :-)

kloadgen-error.zip

xck1007 commented 8 months ago

The same error occurs on Ubuntu Linux 22.04 as well. Is there any way I can assist in resolving the issue?

jemacineiras commented 8 months ago

We had tried to reproduce in the same O.S. and versions and we could not see it failing. For all of us is working like a charm. Is there any other way you can send to us. Let me try to generate a versión with specific debug messages and I will let here the link.

xck1007 commented 7 months ago

I have downloaded JMeter version 5.6.2 and kloadgen 5.6.11 again. Nothing else. I still get the error. I can use the button "Test Registry", press the button "Load Subject" at Key Schema and Value Schema, everything is ok. Only when I start the load test do I get the reported errors.

I am now completely at a loss!?!?

jmeter.log

xck1007 commented 7 months ago

Sorry, i meant kloadgen 5.6.10.

jmeter.log