Jmeter - gRPC : java.lang.Throwable: Invalid call sequence - jmeter

We are working on the gRPC protocol; everything went well while attempting to execute via Postman but we are unable to execute via Jmeter and encountered the following problem.
2022-07-11 15:47:18,322 ERROR o.a.j.s.SampleResult: setEndTime must be called after setStartTime
java.lang.Throwable: Invalid call sequence
at org.apache.jmeter.samplers.SampleResult.setEndTime(SampleResult.java:1107) [ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.samplers.SampleResult.sampleEnd(SampleResult.java:1145) [ApacheJMeter_core.jar:5.4.1]
at vn.zalopay.benchmark.GRPCSampler.errorResult(GRPCSampler.java:112) [jmeter-grpc-request-v1.2.1.jar:?]
at vn.zalopay.benchmark.GRPCSampler.sample(GRPCSampler.java:79) [jmeter-grpc-request-v1.2.1.jar:?]
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(Unknown Source) [?:1.8.0_321]
2022-07-11 15:47:18,322 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'GRPC Request'.
java.lang.NullPointerException: null
at vn.zalopay.benchmark.GRPCSampler.errorResult(GRPCSampler.java:114) ~[jmeter-grpc-request-v1.2.1.jar:?]
at vn.zalopay.benchmark.GRPCSampler.sample(GRPCSampler.java:79) ~[jmeter-grpc-request-v1.2.1.jar:?]
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]
A snapshot of the error log

Most probably you're suffering from this bug, according to the comment the fix has been submitted 4 days ago
Try updating the plugin to the most recent version using JMeter Plugins Manager or building the plugin from the source using Apache Maven and the error should go away or you should see more meaningful response.

Related

Not able to generate report at end of Jmeter test

I saw a similar question here : Error while generating report in apache-jmeter-5.4.1.tgz, but nothing seems to be working. Not sure if there is a fix already in place.
I am using Apache Jmeter 5.4.1, MacOS (Big Sur) and Java version 1.8.0_311.
When I am running the jmeter in nonGUI moe, while generating the report, I am getting following error :
Error generating the report: org.apache.jmeter.report.dashboard.GenerationException: Error while processing samples: Consumer failed with message :Consumer failed with message :Consumer failed with message :Consumer failed with message :Begin size 1 is not equal to fixed size 5
... end of run
The log file suggests this error :
Caused by: java.lang.IllegalStateException: Begin size 1 is not equal to fixed size 5
at java.util.stream.Nodes$FixedNodeBuilder.begin(Nodes.java:1214) ~[?:?]
at java.util.stream.Sink$ChainedReference.begin(Sink.java:253) ~[?:?]
at java.util.stream.SliceOps$1$1.begin(SliceOps.java:192) ~[?:?]
at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:354) ~[?:?]
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:528) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[?:?]
at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[?:?]
at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[?:?]
at org.apache.jmeter.report.processor.Top5ErrorsSummaryData.getTop5ErrorsMetrics(Top5ErrorsSummaryData.java:82) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.Top5ErrorsBySamplerConsumer.createDataResult(Top5ErrorsBySamplerConsumer.java:97) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.Top5ErrorsBySamplerConsumer.createDataResult(Top5ErrorsBySamplerConsumer.java:29) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.AbstractSummaryConsumer.createResultFromKey(AbstractSummaryConsumer.java:200) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.AbstractSummaryConsumer.stopConsuming(AbstractSummaryConsumer.java:261) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.AbstractSampleConsumer.stopProducing(AbstractSampleConsumer.java:241) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.FilterConsumer.stopConsuming(FilterConsumer.java:111) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.AbstractSampleConsumer.stopProducing(AbstractSampleConsumer.java:241) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.FilterConsumer.stopConsuming(FilterConsumer.java:111) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.AbstractSampleConsumer.stopProducing(AbstractSampleConsumer.java:241) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.NormalizerSampleConsumer.stopConsuming(NormalizerSampleConsumer.java:125) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.CsvFileSampleSource$PrivateProducer.stopProducing(CsvFileSampleSource.java:335) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.CsvFileSampleSource.produce(CsvFileSampleSource.java:182) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.processor.CsvFileSampleSource.run(CsvFileSampleSource.java:235) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.report.dashboard.ReportGenerator.generate(ReportGenerator.java:240) ~[ApacheJMeter_core.jar:5.4.1]
Can someone please suggest me what went wrong or if I missed something?
Thanks.
I was having the same issue with JDK 17.0.1, JMeter 5.4.1, MacOS Monterey. I was able to resolve the issue by uninstalling JDK 17 (see instructions here how to uninstall in Mac), then download and install JRE instead.

Getting error - "java.io.IOException: Premature EOF" in JMeter

I am using JMeter 5.4.1, where I am using a HTTP request for Post API call. I am getting the error - "java.io.IOException: Premature EOF".
Keep-Alive is checked. Timeouts are also set to 60 Seconds. I am using single thread.
What is the solution to get raid of this?
java.io.IOException: Premature EOF
at sun.net.www.http.ChunkedInputStream.readAheadBlocking(Unknown Source)
at sun.net.www.http.ChunkedInputStream.readAhead(Unknown Source)
at sun.net.www.http.ChunkedInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
at org.apache.commons.io.input.ProxyInputStream.read(ProxyInputStream.java:102)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.readResponse(HTTPSamplerBase.java:1936)
at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.readResponse(HTTPAbstractImpl.java:530)
at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.readResponse(HTTPJavaImpl.java:296)
at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:567)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1296)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1285)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Unknown Source)
It's hard to say what's wrong, looking into the error it seems that you're getting an incomplete response.
If you can successfully execute this API call using browser or other API testing tool like SoapUI - make sure that JMeter sends the same HTTP Headers via HTTP Header Manager
You can also increase JMeter debug logging verbosity by adding the next line to log4j2.xml file
<Logger name="org.apache.jmeter.protocol.http" level="debug" />
JMeter restart will be required to pick the change up, once done you can check jmeter.log file for any suspicious entries
And last but not the least try switching to HttpClient4 implementation, the setting lives at "Advanced" tab of the HTTP Request sampler

SocketException after sending huge request via JMeter

I'm trying to send a huge request (144k lines) via Jmeter. It's definitely correct (was copied from browser console). After sending, JMeter gets the following errors:
java.net.SocketException: An established connection was aborted by the software in your host machine
at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:420)
at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440)
at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:826)
at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1052)
at java.base/sun.security.ssl.SSLSocketOutputRecord.deliver(SSLSocketOutputRecord.java:342)
at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:1264)
at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:124)
at org.apache.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:160)
at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:113)
at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:120)
at org.apache.http.entity.StringEntity.writeTo(StringEntity.java:167)
at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:156)
at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:152)
at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:238)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$2.doSendRequest(HTTPHC4Impl.java:454)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:930)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:641)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1281)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1270)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.base/java.lang.Thread.run(Thread.java:832)
or
java.net.SocketException: Connection reset by peer
at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:420)
at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440)
at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:826)
at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1052)
at java.base/sun.security.ssl.SSLSocketOutputRecord.deliver(SSLSocketOutputRecord.java:342)
at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:1264)
at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:124)
at org.apache.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:160)
at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:113)
at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:120)
at org.apache.http.entity.StringEntity.writeTo(StringEntity.java:167)
at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:156)
at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:152)
at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:238)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$2.doSendRequest(HTTPHC4Impl.java:454)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:930)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:641)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1281)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1270)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.base/java.lang.Thread.run(Thread.java:832)
I also tried to send this request with other tools - result is the same.
BlazeMeter shows me the following error:
Code: Non HTTP response code: java.net.SocketException
Description Count: Non HTTP response message: Broken pipe (Write failed)
Increasing JAVA HEAP did not help.
I believe that problem relates exactly to JVM. It looks like it blocks my request.
Running in non-GUI mode did not help me.
httpclient4.retrycount=1
hc.parameters.file=hc.parameters
and
http.connection.stalecheck$Boolean=true
also added.
Reproduced on Windows and MacOS
Does someone know how to esolve this issue? Thanks

Jmeter 3.3 java.net.SocketException: Socket closed

I faced an error using Jmeter 3.3
java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:161)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:278)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:286)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:257)
at org.apache.jmeter.protocol.http.sampler.hc.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:199)
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.receiveResponseHeader(MeasuringConnectionManager.java:212)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:684)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:695)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:454)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1178)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:498)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
at java.lang.Thread.run(Unknown Source)
I've tried modifying the following files:
hc.parameters by the following value
http.connection.stalecheck$Boolean=true
and user.properties by:
httpclient4.retrycount=1
hc.parameters.file=hc.parameters
But it did not take affect.
Web server works fine and I able to send request via Fiddler.
Could someone help me ?
I faced with this problem.
I changed range of listened ports. It looks helped me.
How to change range of ports on Linux you can find there

Configuring hadoop-2.0.2-alpha with hbase-0.94.2

if i try to start the hbase, hmaster is not running and getting below
error.From google i tried it is because of classpath mismatch so i
copied hadoop jar into hbase/lib,But still i am getiing below error.
FATAL master.HMaster: Unhandled exception. Starting shutdown.
org.apache.hadoop.ipc.RemoteException: Server IPC version 7 cannot communicate with client version 4
at org.apache.hadoop.ipc.Client.call(Client.java:1070)
at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225)
at $Proxy10.getProtocolVersion(Unknown Source)
at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:396)
at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:379)
at org.apache.hadoop.hdfs.DFSClient.createRPCNamenode(DFSClient.java:119)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:238)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:203)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:89)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1386)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:66)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1404)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:254)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:187)
at org.apache.hadoop.hbase.util.FSUtils.getRootDir(FSUtils.java:561)
at org.apache.hadoop.hbase.master.MasterFileSystem.<init>(MasterFileSystem.java:94)
at org.apache.hadoop.hbase.master.HMaster.finishInitialization(HMaster.java:482)
at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:344)
at java.lang.Thread.run(Thread.java:722)
If it is a Classpath error try to add $HBASE_HOME/conf/ and $HBASE_HOME/lib/ to your $HADOOP_CLASSPATH. That latter one can be set in $HADOOP_HOME/conf/hadoop-env.sh. For me it works that way.

Resources