Bug 53840 - Proxy Recording : Response message: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "" "
Proxy Recording : Response message: URLDecoder: Illegal hex characters in esc...
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.7
All All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-09-07 19:22 UTC by Unknown
Modified: 2012-12-01 23:35 UTC (History)
2 users (show)



Attachments
New build of apacheJmeter.jar with updated UrlConfigGui.java (11.36 KB, application/java-archive)
2012-09-07 19:22 UTC, Unknown
Details
Jmeter.log (6.40 KB, application/octet-stream)
2012-09-07 19:38 UTC, Unknown
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Unknown 2012-09-07 19:22:20 UTC
Created attachment 29342 [details]
New build of apacheJmeter.jar with updated UrlConfigGui.java

This seems like a duplicate of bug 52613. I tried the fix and it doesn't seem to be working. 

I am still getting the error:

Response message: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "" "

Please assist.

Thanks in advance
Comment 1 Philippe Mouawad 2012-09-07 19:31:18 UTC
Hello,
Can you attach:
- Simple Test plan showing the issue

- jmeter.log

What is there exactly in the attached file ?

Regards

Philippe
Comment 2 Unknown 2012-09-07 19:38:35 UTC
Created attachment 29344 [details]
Jmeter.log
Comment 3 Unknown 2012-09-07 19:39:37 UTC
The first attachment contains the new ApacheJmeter.jar I am using.

Second attachment contains Jmeter.log
Comment 4 Philippe Mouawad 2012-09-07 20:30:23 UTC
Thanks, 
Reading your log file, issue occurs while you are recording using HTTP Proxy server, right ?

Please attach Test Plan, it's the most important one to reproduce.
Attached jar is useless, you can obsolete it.
 
Can you try with next nightly build revision r1382138, I have just updated code to get more logs:
- https://builds.apache.org/job/JMeter-trunk/lastSuccessfulBuild/artifact/trunk/dist/

Read following instructions to install this version:
- http://jmeter.apache.org/nightly.html


Before doing so, change the following in jmeter.properties:
log_level.jmeter=DEBUG
log_level.jmeter.junit=DEBUG
log_level.jmeter.control=DEBUG
log_level.jmeter.testbeans=DEBUG
log_level.jmeter.engine=DEBUG
log_level.jmeter.threads=DEBUG
log_level.jmeter.testelement=DEBUG
log_level.jmeter.util=DEBUG
log_level.jmeter.util.classfinder=DEBUG
log_level.jmeter.test=DEBUG
log_level.jmeter.protocol.http=DEBUG
# For CookieManager, AuthManager etc:
log_level.jmeter.protocol.http.control=DEBUG
log_level.jmeter.protocol.http.proxy=DEBUG

Regards
Philippe
Comment 5 Unknown 2012-09-10 12:53:43 UTC
Thank you for the nightly build but unfortunately I can't even get the apachejmeter.jar to execute. 

I ended up turning on the additional logging as you suggested and think I found something.

You are correct regarding the test. I am running Proxy Server and a recording controller to record my steps executed against the web page. 

Everything works but in one step when I try to save the form. It seems like it's having trouble with one of the fields: Terms. This field has a value of '0 %'

If you look at the attached log: and locate line 20794 - you can see the value for Terms and next line is where the error occurs. 

I am not a guru in this but seems like there is a problem with encoding the '%' with using java.lang3 I was initially using commons.lang (2.6 version0. I updated to Lang3 (version 3.1) but doesn't seem to help. 

Any assistance with this is greatly appreciated.


snap from log:
===============================================================================
2012/09/10 08:32:16 DEBUG - jmeter.protocol.http.proxy.HttpRequestHdr: rawPostData in default JRE encoding: <Action UIStatus="2"><Vendor Id="9292" HOST_ID="0" VENDOR="9292" TERMS_TYPE="No Terms" TERMS="0 %" AUTO_PRICE="Use System Default" VM_VENDOR_TYPE="DSD Vendor" ITEM_FORMAT="PLU" COST_ENTRY_SORT="UPC/EAN" VM_REPORT_SORT="UPC/EAN" VM_ORDER_SORT="UPC/EAN" VM_RECEIVING_SORT="UPC/EAN" VM_MAX_BACK_ORDERS="99" MAX_OPEN_DAYS="99" PAY_BASED_ON="System Cost" ORDER_COST_DATE="Use System Rule" VM_CONSIDER_FREE="False" VM_SHOW_DETAIL="False" VM_UPDATE_COST="No" RD_USE_VENDOR_CC="False" BLIND_RECEIVING="Default" EXCLUDE_RECEIVED_COST="False" PRINT_ITEM_ADJ="False" PRINT_OVERALL_ADJ="False" PRINT_TAX_DETAIL="False" BLOCK_PRICE_VIEW="False" DELIVERY_STATUS="No Delivery" AUTO_RECEIVE="False" TARGET_GM_FLAG="%" MINIMUM_GM_FLAG="%" MARGIN_TYPE="Gross Margin" HOLD_REGULAR="Default" HOLD_SPECIALS="Default" TRUSTING_VENDOR="False" AUTO_ACCEPT="All" EARLY_RCPT_AFFECTS="All Costs" SBT_ELIGIBLE="Not eligible" SBT_REPORTING_DAY="Monday" AUTO_BALANCE_FLAG="$" DAX_MANAGED="False" CHANGE_ID="QA" CHANGE_SOURCE="Manual Change" ORIGINAL_SOURCE="Manual Change" RECORD_STATUS="Add" RECORD_STATUS_DATE="9/7/2012 8:34:58 AM" VENDOR_NAME="test" UIStatus="2"/></Action> 
2012/09/10 08:32:16 DEBUG - jmeter.protocol.http.proxy.HttpRequestHdr: Request: POST http://vmdal-hqqa9/retalixhq/GG_Implementation/ScreenEntity/ScreenEntityHTTP.aspx?Action=Save&ET=Vendor&TT=Single&Sid=1347280336092 HTTP/1.1
x-requested-with: XMLHttpRequest
Accept-Language: en-us
Referer: http://vmdal-hqqa9/retalixhq/GG_Implementation/ScreenEntity/ScreenEntityPage.aspx?ET=Vendor&TT=Single&WM=2&UID=9292&Sid=1347280331908&UITH=Blue&MUID=window_0
Accept: */*
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; Tablet PC 2.0)
Host: vmdal-hqqa9
Content-Length: 1146
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cookie: RHQ=sid=5aaeb66c-e174-4f4c-9928-83cffcc62150

<Action UIStatus="2"><Vendor Id="9292" HOST_ID="0" VENDOR="9292" TERMS_TYPE="No Terms" TERMS="0 %" AUTO_PRICE="Use System Default" VM_VENDOR_TYPE="DSD Vendor" ITEM_FORMAT="PLU" COST_ENTRY_SORT="UPC/EAN" VM_REPORT_SORT="UPC/EAN" VM_ORDER_SORT="UPC/EAN" VM_RECEIVING_SORT="UPC/EAN" VM_MAX_BACK_ORDERS="99" MAX_OPEN_DAYS="99" PAY_BASED_ON="System Cost" ORDER_COST_DATE="Use System Rule" VM_CONSIDER_FREE="False" VM_SHOW_DETAIL="False" VM_UPDATE_COST="No" RD_USE_VENDOR_CC="False" BLIND_RECEIVING="Default" EXCLUDE_RECEIVED_COST="False" PRINT_ITEM_ADJ="False" PRINT_OVERALL_ADJ="False" PRINT_TAX_DETAIL="False" BLOCK_PRICE_VIEW="False" DELIVERY_STATUS="No Delivery" AUTO_RECEIVE="False" TARGET_GM_FLAG="%" MINIMUM_GM_FLAG="%" MARGIN_TYPE="Gross Margin" HOLD_REGULAR="Default" HOLD_SPECIALS="Default" TRUSTING_VENDOR="False" AUTO_ACCEPT="All" EARLY_RCPT_AFFECTS="All Costs" SBT_ELIGIBLE="Not eligible" SBT_REPORTING_DAY="Monday" AUTO_BALANCE_FLAG="$" DAX_MANAGED="False" CHANGE_ID="QA" CHANGE_SOURCE="Manual Change" ORIGINAL_SOURCE="Manual Change" RECORD_STATUS="Add" RECORD_STATUS_DATE="9/7/2012 8:34:58 AM" VENDOR_NAME="test" UIStatus="2"/></Action> 
2012/09/10 08:32:16 DEBUG - jmeter.protocol.http.proxy.DefaultSamplerCreator: getSampler: sampler path =  
2012/09/10 08:32:16 DEBUG - jmeter.protocol.http.proxy.DefaultSamplerCreator: Proxy: setting server: vmdal-hqqa9 
2012/09/10 08:32:16 DEBUG - jmeter.protocol.http.proxy.DefaultSamplerCreator: Proxy: setting method: POST 
2012/09/10 08:32:16 DEBUG - jmeter.protocol.http.proxy.DefaultSamplerCreator: Proxy: setting port: 80 
2012/09/10 08:32:16 DEBUG - jmeter.protocol.http.proxy.HttpRequestHdr: Proxy: setting protocol to : http 
2012/09/10 08:32:16 DEBUG - jmeter.protocol.http.proxy.DefaultSamplerCreator: Proxy: setting path: /retalixhq/GG_Implementation/ScreenEntity/ScreenEntityHTTP.aspx?Action=Save&ET=Vendor&TT=Single&Sid=1347280336092 
2012/09/10 08:32:16 DEBUG - jmeter.protocol.http.proxy.DefaultSamplerCreator: Using encoding utf-8 for request body 
2012/09/10 08:32:16 DEBUG - jmeter.protocol.http.sampler.HTTPSamplerBase: adding argument: name: <Action UIStatus value: "2"><Vendor Id="9292" HOST_ID="0" VENDOR="9292" TERMS_TYPE="No Terms" TERMS="0 %" AUTO_PRICE="Use System Default" VM_VENDOR_TYPE="DSD Vendor" ITEM_FORMAT="PLU" COST_ENTRY_SORT="UPC/EAN" VM_REPORT_SORT="UPC/EAN" VM_ORDER_SORT="UPC/EAN" VM_RECEIVING_SORT="UPC/EAN" VM_MAX_BACK_ORDERS="99" MAX_OPEN_DAYS="99" PAY_BASED_ON="System Cost" ORDER_COST_DATE="Use System Rule" VM_CONSIDER_FREE="False" VM_SHOW_DETAIL="False" VM_UPDATE_COST="No" RD_USE_VENDOR_CC="False" BLIND_RECEIVING="Default" EXCLUDE_RECEIVED_COST="False" PRINT_ITEM_ADJ="False" PRINT_OVERALL_ADJ="False" PRINT_TAX_DETAIL="False" BLOCK_PRICE_VIEW="False" DELIVERY_STATUS="No Delivery" AUTO_RECEIVE="False" TARGET_GM_FLAG="%" MINIMUM_GM_FLAG="%" MARGIN_TYPE="Gross Margin" HOLD_REGULAR="Default" HOLD_SPECIALS="Default" TRUSTING_VENDOR="False" AUTO_ACCEPT="All" EARLY_RCPT_AFFECTS="All Costs" SBT_ELIGIBLE="Not eligible" SBT_REPORTING_DAY="Monday" AUTO_BALANCE_FLAG="$" DAX_MANAGED="False" CHANGE_ID="QA" CHANGE_SOURCE="Manual Change" ORIGINAL_SOURCE="Manual Change" RECORD_STATUS="Add" RECORD_STATUS_DATE="9/7/2012 8:34:58 AM" VENDOR_NAME="test" UIStatus="2"/></Action> metaData: = contentEncoding: utf-8 
2012/09/10 08:32:16 ERROR - jmeter.protocol.http.proxy.Proxy: Not implemented (probably used https) java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "" "
	at java.net.URLDecoder.decode(Unknown Source)
	at org.apache.jmeter.protocol.http.util.HTTPArgument.<init>(HTTPArgument.java:113)
	at org.apache.jmeter.protocol.http.util.HTTPArgument.<init>(HTTPArgument.java:139)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.addEncodedArgument(HTTPSamplerBase.java:531)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.parseArguments(HTTPSamplerBase.java:1009)
	at org.apache.jmeter.protocol.http.proxy.DefaultSamplerCreator.computeFromPostBody(DefaultSamplerCreator.java:179)
	at org.apache.jmeter.protocol.http.proxy.DefaultSamplerCreator.populateSampler(DefaultSamplerCreator.java:89)
	at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:212)
================================================================================
Comment 6 Unknown 2012-09-10 13:06:35 UTC
ok. I just took out that field and it still failed with same message. So it's not the data or that field.

I added a data write and here is what i collected:

<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
<sample t="0" lt="0" ts="0" s="false" lb="Sample failed" rc="" rm="URLDecoder: Illegal hex characters in escape (%) pattern - For input string: &quot;&quot; &quot;" tn="" dt="" by="0"/>
Comment 7 Philippe Mouawad 2012-09-11 05:44:29 UTC
Hello, 
Thanks for feedback.

Did you read nightly build build instructions ?
If you use it we will have much more infos.

Download the _bin and _lib files 
Unpack the archives into the same directory structure 
The other archives are not needed to run JMeter.
Building JMeter
Comment 8 Philippe Mouawad 2012-09-15 13:23:27 UTC
After some analysis :
The issue comes from the fact that contentEncoding has been computed to UTF-8 instead of being empty which leads to the error.

Analyzing it further, I think it may come from a previously computed content encoding from URL :
http://vmdal-hqqa9/retalixhq/GG_Implementation/ScreenEntity/ScreenEntityHTTP.aspx

And problematic code may be here in DefaultSamplerCreator#computeContentEncoding:

// Check if we know the encoding of the page
            if (pageEncodings != null) {
                synchronized (pageEncodings) {
                    contentEncoding = pageEncodings.get(urlWithoutQuery);
                }
            }
            // Check if we know the encoding of the form
            if (formEncodings != null) {
                synchronized (formEncodings) {
                    String formEncoding = formEncodings.get(urlWithoutQuery);
                    // Form encoding has priority over page encoding
                    if (formEncoding != null) {
                        contentEncoding = formEncoding;
                    }
                }
            }


For record this is the request:

POST http://vmdal-hqqa9/retalixhq/GG_Implementation/ScreenEntity/ScreenEntityHTTP.aspx?Action=Save&ET=Vendor&TT=Single&Sid=1347280336092 HTTP/1.1
x-requested-with: XMLHttpRequest
Accept-Language: en-us
Referer: http://vmdal-hqqa9/retalixhq/GG_Implementation/ScreenEntity/ScreenEntityPage.aspx?ET=Vendor&TT=Single&WM=2&UID=9292&Sid=1347280331908&UITH=Blue&MUID=window_0
Accept: */*
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; Tablet PC 2.0)
Host: vmdal-hqqa9
Content-Length: 1146
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cookie: RHQ=sid=5aaeb66c-e174-4f4c-9928-83cffcc62150

<Action UIStatus="2"><Vendor Id="9292" HOST_ID="0" VENDOR="9292" TERMS_TYPE="No Terms" TERMS="0 %" AUTO_PRICE="Use System Default" VM_VENDOR_TYPE="DSD Vendor" ITEM_FORMAT="PLU" COST_ENTRY_SORT="UPC/EAN" VM_REPORT_SORT="UPC/EAN" VM_ORDER_SORT="UPC/EAN" VM_RECEIVING_SORT="UPC/EAN" VM_MAX_BACK_ORDERS="99" MAX_OPEN_DAYS="99" PAY_BASED_ON="System Cost" ORDER_COST_DATE="Use System Rule" VM_CONSIDER_FREE="False" VM_SHOW_DETAIL="False" VM_UPDATE_COST="No" RD_USE_VENDOR_CC="False" BLIND_RECEIVING="Default" EXCLUDE_RECEIVED_COST="False" PRINT_ITEM_ADJ="False" PRINT_OVERALL_ADJ="False" PRINT_TAX_DETAIL="False" BLOCK_PRICE_VIEW="False" DELIVERY_STATUS="No Delivery" AUTO_RECEIVE="False" TARGET_GM_FLAG="%" MINIMUM_GM_FLAG="%" MARGIN_TYPE="Gross Margin" HOLD_REGULAR="Default" HOLD_SPECIALS="Default" TRUSTING_VENDOR="False" AUTO_ACCEPT="All" EARLY_RCPT_AFFECTS="All Costs" SBT_ELIGIBLE="Not eligible" SBT_REPORTING_DAY="Monday" AUTO_BALANCE_FLAG="$" DAX_MANAGED="False" CHANGE_ID="QA" CHANGE_SOURCE="Manual Change" ORIGINAL_SOURCE="Manual Change" RECORD_STATUS="Add" RECORD_STATUS_DATE="9/7/2012 8:34:58 AM" VENDOR_NAME="test" UIStatus="2"/></Action>
Comment 9 Philippe Mouawad 2012-12-01 23:27:33 UTC
Date: Sat Dec  1 23:26:37 2012
New Revision: 1416080

URL: http://svn.apache.org/viewvc?rev=1416080&view=rev
Log:
Bug 53840 - Proxy Recording : Response message: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "" "
Bugzilla Id: 53840

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/DefaultSamplerCreator.java
    jmeter/trunk/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java
    jmeter/trunk/xdocs/changes.xml
Comment 10 Philippe Mouawad 2012-12-01 23:35:09 UTC
Date: Sat Dec  1 23:34:31 2012
New Revision: 1416081

URL: http://svn.apache.org/viewvc?rev=1416081&view=rev
Log:
Bug 53840 - Proxy Recording : Response message: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "" "
Oups last minute change
Bugzilla Id: 53840