简体   繁体   中英

JMeter(5.5) API testing fails to make a normal HTTP request, receives 502 status code

I've an application hosted on nginx , I'm not able to hit that API using JMeter. Receives below error on JMeter Sampler Result

Thread Name:Thread Group 1-1
Sample Start:2022-07-21 18:39:47 IST
Load time:31316
Connect Time:4
Latency:31316
Size in bytes:151
Sent bytes:118
Headers size in bytes:151
Body size in bytes:0
Sample Count:1
Error Count:1
Data type ("text"|"bin"|""):
Response code:502
Response message:Could not relay message upstream




HTTPSampleResult fields:
ContentType: 
DataEncoding: null

Response ::

HTTP/1.1 502 Could not relay message upstream
Date: Fri, 22 Jul 2022 03:42:26 GMT
Content-Length: 0
Connection: close
Via: HTTP/1.1 m_proxy_sin

But this API works fine from same Host machine over curl , Postman etc.

When hit via JMeter there are no error information available in the nginx log as well regarding the same.

Ping to the host is works fine, the host is reachable from the test Machine.

System Details::

OS : Windows 10
   
C:\Desktop>java --version
openjdk 11.0.15 2022-04-19
OpenJDK Runtime Environment OpenLogic-OpenJDK (build 11.0.15+10-adhoc..jdk11u)
OpenJDK 64-Bit Server VM OpenLogic-OpenJDK (build 11.0.15+10-adhoc..jdk11u, mixed mode)

JMeter - 5.5

If this API works fine for curl or Postman just record the request from curl or Postman using JMeter's HTTP(S) Test Script Recorder , it will generate the relevant HTTP Request sampler and HTTP Header Manager in order to send exactly the same request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM