Bug 55959 - improve error message when Test Script Recorder fails due to I/O problem
Summary: improve error message when Test Script Recorder fails due to I/O problem
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.11
Hardware: PC All
: P2 minor (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-06 10:54 UTC by rikard_edgren
Modified: 2014-01-09 19:43 UTC (History)
0 users



Attachments
log output for issue (3.88 KB, text/plain)
2014-01-06 10:54 UTC, rikard_edgren
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rikard_edgren 2014-01-06 10:54:18 UTC
Created attachment 31172 [details]
log output for issue

The new 2.10/2.11 Test Script Recorder seems promising, but some users have a hard time getting it running. 
https://wiki.apache.org/jmeter/TestRecording210 informs about how to get Java JDK up and running.
But it also doesn't work when installed in a folder without full access rights, e.g. C:\Program Files\apache-jmeter-2.11
This seems to be a known issue according to thread http://mail-archives.apache.org/mod_mbox/jmeter-dev/201311.mbox/%3cCAH9fUpb6USD6=-6T_2Fyf6GYBdmMmN7W5ySw8AyN+S133faHvQ@mail.gmail.com%3e
Not sure if it can be addressed so it works, but a more helpful error message would be good.

Client: Windows 8, 64-bit, Java JRE 1.7.0_45_b18, Java JDK 1.7.0_45, JMeter 2.11
JMeter location: C:\Program Files\apache-jmeter-2.11

1. Edit jmeter.bat according to https://wiki.apache.org/jmeter/TestRecording210 so Java JDK is accessed
2. Start JMeter 2.11
3. In Workbench, Add Non-Test Elements, HTTP(S) Test Script Recorder
4. Click Start

Result: An extremely wide error message (2 lines): 
"Could not create script recording proxy - see log for details: Command :'"C:\Program Files\Java\jre7\bin\keytool" -genkeypair -alias :root_ca: -dname "CN=_ DO NOT INSTALL unless this is your certificate (JMeter root CA), OU=Username: rikard, C=US" -keyalg RSA -keystore proxyserver.jks -storepass {redacted) -keypass {redacted) -validity 7 -ext bc:c' failed, code: 1
keytool error: java.io.FileNotFoundException: proxyserver.jks (Access is denied)"

(Full log message in attached JMeter210_ProgramFiles_ProxyRecordingError.txt)

The path listed in error dialog is for Java, which is misleading, since the work-around is to place JMeter in a folder with full administrative rights.

Expected: A more informative error message that helps the user address the problem, e.g. by hinting at access rights problems for the JMeter location.
Or that it works also when JMeter is installed in Program Files (or similar)

https://wiki.apache.org/jmeter/TestRecording210 could also be updated with information regarding this.
Comment 1 Sebb 2014-01-07 12:04:04 UTC
(In reply to rikard_edgren from comment #0)
> Created attachment 31172 [details]
> log output for issue
> 
> The new 2.10/2.11 Test Script Recorder seems promising, but some users have
> a hard time getting it running. 
> https://wiki.apache.org/jmeter/TestRecording210 informs about how to get
> Java JDK up and running.
> But it also doesn't work when installed in a folder without full access
> rights, e.g. C:\Program Files\apache-jmeter-2.11
> This seems to be a known issue according to thread
> http://mail-archives.apache.org/mod_mbox/jmeter-dev/201311.mbox/
> %3cCAH9fUpb6USD6=-6T_2Fyf6GYBdmMmN7W5ySw8AyN+S133faHvQ@mail.gmail.com%3e
> Not sure if it can be addressed so it works, but a more helpful error
> message would be good.

JMeter can be told to create the file in a different directory, see:

http://jmeter.apache.org/usermanual/component_reference.html#HTTP%28S%29_Test_Script_Recorder

proxy.cert.directory

> Client: Windows 8, 64-bit, Java JRE 1.7.0_45_b18, Java JDK 1.7.0_45, JMeter
> 2.11
> JMeter location: C:\Program Files\apache-jmeter-2.11
> 
> 1. Edit jmeter.bat according to
> https://wiki.apache.org/jmeter/TestRecording210 so Java JDK is accessed
> 2. Start JMeter 2.11
> 3. In Workbench, Add Non-Test Elements, HTTP(S) Test Script Recorder
> 4. Click Start
> 
> Result: An extremely wide error message (2 lines): 
> "Could not create script recording proxy - see log for details: Command
> :'"C:\Program Files\Java\jre7\bin\keytool" -genkeypair -alias :root_ca:
> -dname "CN=_ DO NOT INSTALL unless this is your certificate (JMeter root
> CA), OU=Username: rikard, C=US" -keyalg RSA -keystore proxyserver.jks
> -storepass {redacted) -keypass {redacted) -validity 7 -ext bc:c' failed,
> code: 1
> keytool error: java.io.FileNotFoundException: proxyserver.jks (Access is
> denied)"
> 
> (Full log message in attached JMeter210_ProgramFiles_ProxyRecordingError.txt)
> 
> The path listed in error dialog is for Java, which is misleading, since the
> work-around is to place JMeter in a folder with full administrative rights.

I think the error message is clear that the path is for the command that failed.
 
> Expected: A more informative error message that helps the user address the
> problem, e.g. by hinting at access rights problems for the JMeter location.

The last part of the error message clearly states:

java.io.FileNotFoundException: proxyserver.jks (Access is denied)"

Is that not clear?

I suppose the command line could be dropped from the error dialog to make it a bit easier to read, but the information is there.

> Or that it works also when JMeter is installed in Program Files (or similar)

It does, provided that you tell JMeter where to store the JKS file
 
> https://wiki.apache.org/jmeter/TestRecording210 could also be updated with
> information regarding this.

Yes
Comment 2 Sebb 2014-01-09 19:43:39 UTC
URL: http://svn.apache.org/r1556930
Log:
improve error message when Test Script Recorder fails due to I/O problem
Bugzilla Id: 55959

Modified:
    jmeter/trunk/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java

URL: http://svn.apache.org/r1556932
Log:
improve error message when Test Script Recorder fails due to I/O problem
Bugzilla Id: 55959

Modified:
    jmeter/trunk/xdocs/changes.xml