1

I see most of the requests that requires authentication fails with a '500 internal server error' when running the scripts on an AWS instance with ubuntu. The same script runs fine on my local with Windows, in UI and Non GUI mode. I am running Jmeter V3 in both the local and AWS.

It is pretty much similar to the question here, https://stackoverflow.com/questions/21854363/request-type-not-being-set-in-non-gui-mode-in-jmeter

More details below

Jmeter V3.0 Java 1.7.0_121 No external CSV files used

Working Results

    Sampler Thread
Thread Name: Thread Group 1-1
Sample Start: 2016-12-09 11:19:45 NZDT
Load time: 346
Connect Time: 60
Latency: 346
Size in bytes: 763
Headers size in bytes: 451
Body size in bytes: 312
Sample Count: 1
Error Count: 0
Data type ("text"|"bin"|""): text
Response code: 302
Response message: Found

Response headers:
HTTP/1.1 302 Found
Server: nginx/1.4.6 (Ubuntu)
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/5.5.9-1ubuntu4.20
Set-Cookie: PHPSESSID=87of7r5f3sp3ffqs8eho2742f6; path=/; HttpOnly
Cache-Control: no-cache
Location: /dashboard
Date: Thu, 08 Dec 2016 22:19:46 GMT
Set-Cookie: PHPSESSID=87of7r5f3sp3ffqs8eho2742f6; path=/; httponly
Strict-Transport-Security: max-age=31536000;


HTTPSampleResult fields:
ContentType: text/html; charset=UTF-8
DataEncoding: UTF-8

Request
POST https://uat.aaa.io/login_check

POST data:
_csrf_token=hUH5yqAnUrEY5bmVSawxnZ_RCexqFSvD4AM7ZRq7pm4&_password=Password&_remember_me=on&_username=user%40gmail.com

Cookie Data:
PHPSESSID=9v0k47vjls5p0jkbnqdu17kso0

Request Headers:
Connection: keep-alive
Origin: https://uat.aaa.io
X-DevTools-Emulate-Network-Conditions-Client-Id: 89a8518d-de0e-42ff-b9b7-32ef7bfe9c0f
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/54.0.2840.99Safari/537.36
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: https://aaa.ranqx.io/login
Accept-Encoding: gzip,deflate,br
Accept-Language: en-US,en;q=0.8
Content-Type: application/json
Connection: keep-alive
Content-Length: 119
Host: uat.aaa.io

Response
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="1;url=/dashboard" />

        <title>Redirecting to /dashboard</title>
    </head>
    <body>
        Redirecting to <a href="/dashboard">/dashboard</a>.
    </body>
</html>

Not Working results

Sampler Thread

Thread Name: Thread Group 1-1
Sample Start: 2016-12-09 10:09:21 NZDT
Load time: 55
Connect Time: 0
Latency: 55
Size in bytes: 495
Headers size in bytes: 0
Body size in bytes: 495
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 500
Response message: Internal Server Error

Response headers:
HTTP/1.1 500 Internal Server Error
Server: nginx/1.4.6 (Ubuntu)
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/5.5.9-1ubuntu4.20
Set-Cookie: PHPSESSID=26v8j302nebncbkc0cjf5v2vq5; path=/; HttpOnly
Cache-Control: no-cache
Date: Thu, 08 Dec 2016 21:09:37 GMT
Set-Cookie: PHPSESSID=26v8j302nebncbkc0cjf5v2vq5; path=/; httponly


HTTPSampleResult fields:
ContentType: 
DataEncoding: null

Request
POST https://uat.aaa.io/login_check

POST data:
_csrf_token=mQl3y2qPaJd1RZZnJT2KzkWMBsdCzGXekABdQnikKyg&_password=password&_remember_me=on&_username=user%40gmail.com

Cookie Data:
PHPSESSID=26v8j302nebncbkc0cjf5v2vq5

Request Headers:
Connection: keep-alive
Origin: https://uat.aaa.io
X-DevTools-Emulate-Network-Conditions-Client-Id: 89a8518d-de0e-42ff-b9b7-32ef7bfe9c0f
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/54.0.2840.99Safari/537.36
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: https://uat.aaa.io/login
Accept-Encoding: gzip,deflate,br
Accept-Language: en-US,en;q=0.8
Content-Type: application/json
Connection: keep-alive
Content-Length: 119
Host: uat.aaa.io

Response
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>An Error Occurred: Internal Server Error</title>
    </head>
    <body>
        <h1>Oops! An Error Occurred</h1>
        <h2>The server returned a "500 Internal Server Error".</h2>

        <div>
            Something is broken. Please let us know what you were doing when this error occurred.
            We will fix it as soon as possible. Sorry for any inconvenience caused.
        </div>
    </body>
</html>

Jmeter Log

2016/12/08 22:20:23 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US  2016/12/08 22:20:23 INFO  - jmeter.JMeter: Loading user properties from: /home/ubuntu/apache-jmeter-3.0/bin/user.properties  2016/12/08 22:20:23 INFO  - jmeter.JMeter: Loading system properties from: /home/ubuntu/apache-jmeter-3.0/bin/system.properties  2016/12/08 22:20:23 INFO  - jmeter.JMeter: Copyright (c) 1998-2016 The Apache Software Foundation  2016/12/08 22:20:23 INFO  - jmeter.JMeter: Version 3.0 r1743807  2016/12/08 22:20:23 INFO  - jmeter.JMeter: java.version=1.7.0_121  2016/12/08 22:20:23 INFO  - jmeter.JMeter: java.vm.name=OpenJDK 64-Bit Server VM  2016/12/08 22:20:23 INFO  - jmeter.JMeter: os.name=Linux  2016/12/08 22:20:23 INFO  - jmeter.JMeter: os.arch=amd64  2016/12/08 22:20:23 INFO  - jmeter.JMeter: os.version=3.13.0-101-generic  2016/12/08 22:20:23 INFO
- jmeter.JMeter: file.encoding=ANSI_X3.4-1968  2016/12/08 22:20:23 INFO  - jmeter.JMeter: Max memory     =921174016  2016/12/08 22:20:23 INFO  - jmeter.JMeter: Available Processors =2  2016/12/08 22:20:23 INFO  - jmeter.JMeter: Default Locale=English (United States)  2016/12/08 22:20:23 INFO  - jmeter.JMeter: JMeter  Locale=English (United States)  2016/12/08 22:20:23 INFO  - jmeter.JMeter: JMeterHome=/home/ubuntu/apache-jmeter-3.0  2016/12/08 22:20:23 INFO  - jmeter.JMeter: user.dir  =/home/ubuntu/apache-jmeter-3.0/bin  2016/12/08 22:20:23 INFO  - jmeter.JMeter: PWD      
=/home/ubuntu/apache-jmeter-3.0/bin  2016/12/08 22:20:23 INFO  - jmeter.JMeter: IP: 172.31.36.33 Name: ip-172-31-36-33 FullName: ip-172-31-36-33.ap-southeast-2.compute.internal  2016/12/08 22:20:23 INFO  - jmeter.services.FileServer: Default base='/home/ubuntu/apache-jmeter-3.0/bin'  2016/12/08 22:20:23 INFO  - jmeter.services.FileServer: Set new base='/home/ubuntu/apache-jmeter-3.0/bin'  2016/12/08 22:20:24 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2  2016/12/08 22:20:24 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8  2016/12/08 22:20:24 INFO  - jmeter.save.SaveService: Using SaveService properties version
2.9  2016/12/08 22:20:24 INFO  - jmeter.save.SaveService: All converter versions present and correct  2016/12/08 22:20:24 INFO  - jmeter.save.SaveService: Loading file: BankUC3.jmx  2016/12/08 22:20:24 INFO  - jmeter.protocol.http.control.CookieManager: Settings: Delete null: false Check: true Allow variable: true Save: true Prefix: COOKIE_  2016/12/08 22:20:24 INFO  - jmeter.protocol.http.control.CacheManager: Will only cache the following methods: [GET]  2016/12/08 22:20:24 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser  2016/12/08 22:20:24 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser  2016/12/08 22:20:24 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser  2016/12/08 22:20:24 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser  2016/12/08 22:20:24 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser  2016/12/08 22:20:24 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser  2016/12/08 22:20:24 INFO  - jmeter.JMeter: Creating summariser <summary>  2016/12/08 22:20:24 INFO  - jmeter.engine.StandardJMeterEngine: Running the test!  2016/12/08 22:20:24 INFO  - jmeter.samplers.SampleEvent: List of sample_variables: []  2016/12/08 22:20:24 INFO  - jmeter.samplers.SampleEvent: List of sample_variables: []  2016/12/08 22:20:24 INFO  - jmeter.engine.util.CompoundVariable: Note: Function class names must contain the string: '.functions.'  2016/12/08 22:20:24 INFO  - jmeter.engine.util.CompoundVariable: Note: Function class names must not contain the string: '.gui.'  2016/12/08 22:20:24 INFO  - jmeter.JMeter: Running test (1481235624408)  2016/12/08 22:20:24 INFO  - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group  2016/12/08 22:20:24 INFO  - jmeter.engine.StandardJMeterEngine: Starting 1 threads for group Thread Group.  2016/12/08 22:20:24 INFO  - jmeter.engine.StandardJMeterEngine: Thread will continue on error  2016/12/08 22:20:24 INFO  - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 1 ramp-up 1 perThread 1000.0 delayedStart=false  2016/12/08 22:20:24 INFO  - jmeter.threads.ThreadGroup: Started thread group number 1  2016/12/08 22:20:24 INFO  - jmeter.engine.StandardJMeterEngine: All thread groups have been started  2016/12/08 22:20:24 INFO  - jmeter.threads.JMeterThread: Thread started: Thread Group 1-1  2016/12/08 22:20:24 INFO  - jmeter.protocol.http.sampler.HTTPHCAbstractImpl: Local host = ip-172-31-36-33  2016/12/08 22:20:24 INFO  - jmeter.protocol.http.sampler.HTTPHC4Impl: HTTP request retry count = 0 2016/12/08 22:20:24 INFO  - jmeter.samplers.SampleResult: Note: Sample TimeStamps are START times  2016/12/08 22:20:24 INFO  - jmeter.samplers.SampleResult: sampleresult.default.encoding is set to UTF-8  2016/12/08 22:20:24 INFO  - jmeter.samplers.SampleResult: sampleresult.useNanoTime=true  2016/12/08 22:20:24 INFO  - jmeter.samplers.SampleResult: sampleresult.nanoThreadSleep=5000  2016/12/08 22:20:25 INFO  - jmeter.protocol.http.sampler.LazySchemeSocketFactory: Setting up HTTPS TrustAll Socket Factory  2016/12/08 22:20:25 INFO  - jmeter.util.JsseSSLManager: Using default SSL protocol: TLS  2016/12/08 22:20:25 INFO  - jmeter.util.JsseSSLManager: SSL session context: per-thread  2016/12/08 22:20:25 INFO  - jmeter.util.SSLManager: JmeterKeyStore Location:  type JKS  2016/12/08 22:20:25 INFO  - jmeter.util.SSLManager: KeyStore created OK  2016/12/08 22:20:25 WARN  - jmeter.util.SSLManager: Keystore file not found, loading empty keystore  2016/12/08 22:20:25 INFO  - jmeter.protocol.http.parser.BaseParser: Created org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser  2016/12/08 22:20:25 INFO  - jmeter.protocol.http.sampler.ResourcesDownloader: Creating ResourcesDownloader with keepalive_inseconds:60  2016/12/08 22:20:25 INFO  - jmeter.protocol.http.parser.BaseParser: Created org.apache.jmeter.protocol.http.parser.CssParser  2016/12/08 22:20:32 INFO  - jmeter.reporters.Summariser: summary +      2 in 00:00:08 =   
0.2/s Avg:  1269 Min:    80 Max:  2458 Err:     1 (50.00%) Active: 1 Started: 1 Finished: 0  2016/12/08 22:20:36 INFO  - jmeter.threads.JMeterThread: Thread is done: Thread Group 1-1  2016/12/08 22:20:36 INFO  - jmeter.threads.JMeterThread: Thread finished: Thread Group 1-1  2016/12/08 22:20:36 INFO  - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test  2016/12/08 22:20:36 INFO  - jmeter.reporters.Summariser: summary
+      4 in 00:00:03 =    1.2/s Avg:    42 Min:    34 Max:    58 Err:     4 (100.00%) Active: 0 Started: 1 Finished: 1  2016/12/08 22:20:36 INFO
- jmeter.reporters.Summariser: summary =      6 in 00:00:12 =    0.5/s Avg:   451 Min:    34 Max:  2458 Err:     5 (83.33%)

Resolved Found that my app had a GeoIp based blocking, and throwing GeoIp2\Exception\AddressNotFoundException if accessed from same data center as the app is hosted. Removing that block, The scripts started working.

2
  • Can you share your test script? Did you record the script (if yes which tool did you use)? Dec 8, 2016 at 4:38
  • I had 2 scripts, both recorded, one using jmeter firefox proxy and one using blazemeter chrome plugin. The trouble both the script runs on the machine that is created and does not run in the AWS instance.
    – Ram
    Dec 8, 2016 at 22:55

1 Answer 1

1

We are not telepathic enough to guess why exactly your script works on one machine and doesn't work on another. The reason is something different, where "something" could be:

  • Java version
  • JMeter version
  • .jmx script
  • jmeter/system properties
  • external files used in i.e. CSV Data Set Config
  • application unavailability from one of the locations
  • etc.

Troubleshooting suggestions:

  1. First of all check jmeter.log file, normally it contains enough information to get the idea regarding the error
  2. For failing request(s) compare the full information available via View Results Tree listener: request parameters, headers, cookies, full response including response message, headers and body. Mention the differences and work them around. You can temporary enable storing aforementioned request and response details by adding the next lines to user.properties file (located in JMeter's "bin" folder) on Amazon instance

    jmeter.save.saveservice.output_format=xml
    jmeter.save.saveservice.response_data=true
    jmeter.save.saveservice.samplerData=true
    jmeter.save.saveservice.requestHeaders=true
    jmeter.save.saveservice.url=true
    jmeter.save.saveservice.responseHeaders=true
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.