Jmeter - Plugins behind the proxy - proxy

I placed plugin manager in "lib\ext" folder and tried to open it showed error:
java.io.IOException: Repository responded with wrong status code: 407
Jmeter version - 3.3
Plugin version - 0.16
Jmeter is invoked from command line by using the following parameters:
C:\Users\princen\Performance Testing\Software\apache-jmeter-3.3\bin\jmeter.bat -H Proxyserver -P 1234 -u princen -a ***
Parameters modified as suggested here
JVM_ARGS="-Dhttps.proxyHost=Proxyserver -Dhttps.proxyPort=1234 -Dhttp.proxyUser=princen -Dhttp.proxyPass=***" C:\Users\princen\Performance Testing\Software\apache-jmeter-3.3\bin\jmeter.bat
Above try gives the following error message
Windows cannot find "JVM_ARGS="-Dhttps.proxyHost=Proxyserver -Dhttps.proxyPort=1234 -Dhttp.proxyUser=princen -Dhttp.proxyPass=***
When I tried to changes command to the following:
C:\Users\princen\Performance Testing\Software\apache-jmeter-3.3\bin\jmeter.bat -Dhttps.proxyHost=Proxyserver -Dhttps.proxyPort=1234 -Dhttp.proxyUser=princen -Dhttp.proxyPass=***
I received an error:
java.io.IOException: Repository responded with wrong status code: 407
Can someone please correct parameters required to load the plugin manager?

Ensure you use last version of jmeter-plugins download manager.
Regarding your parameters, you're mixing different configurations, just set (for both http and https):
JVM_ARGS="-Dhttps.proxyHost=myproxy.com -Dhttps.proxyPort=8080 -Dhttps.proxyUser=john -Dhttps.proxyPass=password -Dhttp.proxyHost=myproxy.com -Dhttp.proxyPort=8080 -Dhttp.proxyUser=john -Dhttp.proxyPass=password"
Where password is your real password.

None of above methods working for me. Its really tough to work with Java(due to Loadrunner background). I added Ultimate thread alone and its working fine.
Thank you all for your inputs..

JMeter is using the official proxy configuration from Oracle (like here: https://memorynotfound.com/configure-http-proxy-settings-java/)
The problem is that the jmeter documentation is wrong about the password parameter: it should be http.proxyPassword not http.proxyPass.
Also you must use the https. properties for secured urls you want to access using the proxy. And the http. properties for non secured.

Related

Why does wget (windows) behind a proxy needs the PROXY_HTTP/HTTPS environment variables, and Chrome doesn't

I tried to download files from google drive using wget (on windows) using the script shown here:
[JULY 2020 - Windows users batch file solution]wget/curl large file from google drive.
It works well, but when computer is behind proxy, it will work ONLY if I will set environment variables PROXY_HTTP and PROXY_HTTP (It may be that it can also set by flag in the command, but I didn't try it)
The fact that I can download files from google drive using Chrome without these environment variables and without setting chrome for the proxy gives me the understanding that there is a way to download behind proxy without setting an application for the proxy.
How can I make wget works without need to set it manually (by flag or by environment variables) for the proxy?
In all likelyhood your Chrome also has a proxy set up in some way. In any case, the simplest way to define the proxy for wget is to create a .wgetrc file in your local home folder and set the following:
> vi ~/.wgetrc
use_proxy=on
http_proxy=http://[proxy_ip]:[proxy_port]
https_proxy=https://[proxy_ip]:[proxy_port]
ftp_proxy=http://[proxy_ip]:[proxy_port]
That should be all you need to do.
I found the solution after #Wilmar comment which he pointed out here (thanks!).
An application can automatically finds if it is behind a proxy by sending "http://wpad/wpad.dat".
If a proxy server is behind, it will answer with a message that contains PAC file with proxy details. The application then can extract the proxy details for any needed settings. Thats how Chrome can set itself for automatically for proxy.
Example using wget in windows to find proxy details
In Windows, you can use wget as follows to get the proxy server details. The details must be extracted from the text messages and you can use tool like jrepl for such task. Here I only show where the details are.
call wget "http://wpad/wpad.dat" -o "ProcessLog.txt" -O "PAC.txt"
There are three possible scenarios here:
In case there is no proxy behind, then PAC.txt is empty and ProcessLog.txt contains text message similar to this one.
ProcessLog.txt
--2020-09-01 08:38:29-- http://wpad/wpad.dat
Resolving wpad (wpad)... failed: The requested name is valid, but no data of the requested type was found. .
wget: unable to resolve host address 'wpad'
In case there is a proxy server behind, and windows environment variables for proxy are set:
http_proxy=http://proxy.mc.company.com:777
https_proxy=https://proxy.mc.company.com:777
then wget already knows the proxy address so PAC.txt is empty and ProcessLog.txt contains text message similar to the follow one that contains the proxy details. In this example, the proxy details are [proxy_ip]:[proxy_port] = proxy.mc.company.com:777
ProcessLog.txt
--2020-09-01 08:29:59-- http://wpad/wpad.dat
Resolving proxy.mc.company.com (proxy.mc.company.com)... 10.100.200.150
Connecting to proxy.mc.company.com (proxy.mc.company.com)|10.100.200.150|:777... connected.
Proxy request sent, awaiting response... 302 Found
Location: http://www.wpad.com/wpad.dat [following]
--2020-09-01 08:30:00-- http://www.wpad.com/wpad.dat
Connecting to proxy.mc.company.com (proxy.mc.company.com)10.100.200.150|:777... connected.
Proxy request sent, awaiting response... 403 Forbidden
2020-09-01 08:30:00 ERROR 403: Forbidden.
In case there is a proxy server behind, but no windows environment variables for proxy are set, then wget gets the proxy details from proxy server. In this case PAC.txt contains long text message similar to the follow one that contains the proxy details. In this example, the proxy details are [proxy_ip]:[proxy_port] = proxy.mc.company.com:777
PAC.txt
function FindProxyForURL(url,host) {
var me=myIpAddress();
var resolved_ip = dnsResolve(host);
if (host == "127.0.0.1") {return "DIRECT";}
if (host == "localhost") {return "DIRECT";}
if (isPlainHostName(host)) {return "DIRECT";}
if (url.substring(0,37) == "http://lyncdiscoverinternal.company.com") {return "DIRECT";}
if (!resolved_ip) { if (url.substring(0,6) == "https:") {return "PROXY proxy-mc.company.com:778";} else {return "PROXY proxy-mc.company.com:777";}}
if (host == "moran-for-localhost-only.com") {return "DIRECT";}
...
...
Simplifying using wget in windows to find proxy details
When using wget to find proxy details, we can command it to ignore proxy environment variables (if are set) using the flag --no-proxy. This leaves us with only two possible scenarios (1) and (3) described above. So we just need the ProxyInfo file. If it is empty (scenario 1) then no proxy is behind, if it contains text (scenario 3), it is behind a proxy and you can extract the proxy details from it.
call wget --no-proxy "http://wpad/wpad.dat" -O "PAC.txt"

Load test using Maven-jmeter plugin on Jenkins gives "Non HTTP response code: javax.net.ssl.SSLHandshakeException"

I am using Jmeter 3.0 for load testing API's. I am using Maven-Jmeter plugin to run my load tests. Currently using com.lazerycode.jmeter plugin version 2.0.3. Test's run fine on my local machine but when I run it via Jenkins, I get "Non HTTP response code: javax.net.ssl.SSLHandshakeException". I have googled and tried pretty much everything which is suggested in various forums but error doesn't go way. What am I missing? Any help is appreciated.
See error stack below.
httpSample t="1069" it="0" lt="0" ts="1485212600015" s="false" lb="ServiceProxy:TC#1: GET- Health Check For Proxy Service" **rc="Non HTTP response code: javax.net.ssl.SSLHandshakeException" rm="Non HTTP response message: Received fatal alert: handshake_failure"** tn="Service Proxy Regression Test Plan 1-1" dt="text" by="2566" ng="1" na="1">
****** received : [[[Non HTTP response code: javax.net.ssl.SSLHandshakeException]]]
****** comparison: [[[200 ]]]
class="java.lang.String">javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1979)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1086)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
at org.apache.http.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:573)
at org.apache.http.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:447)
at org.apache.jmeter.protocol.http.sampler.LazySchemeSocketFactory.createLayeredSocket(LazySchemeSocketFactory.java:121)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.updateSecureConnection(DefaultClientConnectionOperator.java:219)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.layerProtocol(ManagedClientConnectionImpl.java:421)
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.layerProtocol(MeasuringConnectionManager.java:152)
at org.apache.http.impl.client.DefaultRequestDirector.establishRoute(DefaultRequestDirector.java:815)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:616)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:447)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:619)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:379)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1135)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:465)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:410)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:241)
at java.lang.Thread.run(Thread.java:745)
...
I was able to solve the problem. Here is the solution:
1) I am using maven-jmeter plugin and maven-jmeter analysis plugin. In simple terms, running jmeter via a maven project. To solve the SSLHandshakeException problem, put your maven command in the "Execute Shell" area instead of "Goal" area in jenkins job. I also changed the command to "mvn -B -f ./pom.xml verify -s settings.xml".
However, after doing #1, I was seeing that my performance tests were running twice. So I followed the solution #2.
2) I used a freestyle project in jenkins instead of maven project. I put the command in "Execute shell" area. I was getting 'cmd fail' errors. This was due to old version of maven being used on slave. I specified exact version of maven I want to use on slave and things worked fine.
Here is how it looks like:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
export http_proxy=http://example.com:8080
export HTTP_PROXY=http://example.com:8080
export https_proxy=http://example.com:8080
export HTTPS_PROXY=http://example.com:8080
/usr/share/maven-3.3.9/bin/mvn -B -f ./pom.xml verify -s settings.xml -DSERVICE_P_NUM_OF_USERS=1 -DSERVICE_P_RAMP_UP_TIME=1
I have seen this error. Then i figured out that the error was due to java version of Jenkins-slave. Upgrade java version and see if it helps.

Jmeter 2.10 and 2.11 don't let me start a HTTP Script Recorder

I'm having trouble starting a proxy server for jmeter 2.10 and 2.11. I found a couple links here on SO and apache.org but my error message is slightly different that what's written on these links. Per the wiki from apache.org, I don't think I have trouble finding keytool because it returns the path when I do a
which keytool
/usr/bin/keytool
and I don't have trouble creating a file in the jmeter-210 and jmeter-211/bin dirs. This is the error message I get in my jmeter.log file:
ERROR - jmeter.protocol.http.proxy.ProxyControl: Could not initialise key store java.io.IOException: Command :'"keytool" "-genkeypair" "-alias" ":root_ca:" "-dname" "CN=_ DO NOT INSTALL unless this is your certificate (JMeter root CA), OU=Username: COMPANY\user.name, C=US" "-keyalg" "RSA" "-keystore" "proxyserver.jks" "-storepass" "randomstr1" "-keypass" "randomstr1" "-validity" "7" "-ext" "bc:c"' failed, code: 1
keytool error: java.io.IOException: Invalid escaped character in AVA: 's'
I don't know what this "invalid escaped char in AVA" is. My company and username don't have the string "AVA" and I didn't find it in any of the property files in jmeter-21x/bin.
Not sure if this is affecting it but I'm running jmeter from Darwin on a MBP, OSX 10.7.5.
JMeter 2.9 doesn't give me any proxy issues, although, I ran into other issues with it, which is why I tried using these 2 newer versions, which are giving me problems with the proxy server. I'll try going down to 2.8 to see what happens but I'd rather not if I can help it. That and I'm super curious what the issue is with 2.1x and my laptop. Thanks in advance for your help.
EDIT: The COMPANY/user.name part of the error message was changed this way to sanitize the error message, although, I will try at home on my linux box to see if the funny username representation is the cause.
As per sebb response on User Mailing List:
"I suspect it might be in the string "COMPANY\user.name" which is
derived from the Java system property "user.name".
You could try redefining it on the command line (or in
system.properties) to something simpler, for example:
-Duser.name=foobar
A bug has been opened to fix this issue with "\" character:
https://issues.apache.org/bugzilla/show_bug.cgi?id=56178

Setting appConcurrentRequestLimit in Windows 2008

I read from SO (HTTP Error 503.2 - Service Unavailable. The serverRuntime#appConcurrentRequestLimit setting is being exceeded) and MSDN (http://technet.microsoft.com/en-us/library/dd425294(v=office.13).aspx) that I need to set AppConCurrentRequestLimit to a bigger number if the site is showing appconcurrentlimit exceeded error (which mine is like that).
However upon executing the command provided by MSDN, I got error
c:\Windows\System32\inetsrv>appcmd.exe set config /section:serverRuntime /appCon
currentRequestLimit:100000
ERROR ( message:Unknown attribute "appConcurrentRequestLimit". Replace with -?
for help. )
I try to search in google but seems no one having the same issue as mine.
I try to manually input in ASPNET.Config in XML but whatever I change the site does not seem to restart, even I put random error text in the config, my site still does not show error, is ASPNET.Config configuration being used, why there is no error even the configuration is intentionally made error?
It fails if you have additional sections such as ftpsection.
In order to edit the serverRuntime of the system.webserver section you should run:
cd %windir%\system32\inetsrv
appcmd.exe set config /section:system.webserver/serverRuntime /appConcurrentRequestLimit:100000

HPCC/HDFS Connector

Does anyone know about HPCC/HDFS connector.we are using both HPCC and HADOOP.There is one utility(HPCC/HDFS connector) developed by HPCC which allows HPCC cluster to acess HDFS data
i have installed the connector but when i run the program to acess data from hdfs it gives error as libhdfs.so.0 doesn't exist.
I tried to build libhdfs.so using command
ant compile-libhdfs -Dlibhdfs=1
its giving me error as
target "compile-libhdfs" does not exist in the project "hadoop"
i used one more command
ant compile-c++-libhdfs -Dlibhdfs=1
its giving error as
ivy-download:
[get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar
[get] To: /home/hadoop/hadoop-0.20.203.0/ivy/ivy-2.1.0.jar
[get] Error getting http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar
to /home/hadoop/hadoop-0.20.203.0/ivy/ivy-2.1.0.jar
BUILD FAILED java.net.ConnectException: Connection timed out
any suggestion will be a great help
Chhaya, you might not need to build libhdfs.so, depending on how you installed hadoop, you might already have it.
Check in HADOOP_LOCATION/c++/Linux-<arch>/lib/libhdfs.so, where HADOOP_LOCATION is your hadoop install location, and arch is the machine’s architecture (i386-32 or amd64-64).
Once you locate the lib, make sure the H2H connector is configured correctly (see page 4 here).
It's just a matter of updating the HADOOP_LOCATION var in the config file:
/opt/HPCCSystems/hdfsconnector.conf
good luck.

Resources