Bug 60714 - java.nio.charset.MalformedInputException: Input length = 1
Summary: java.nio.charset.MalformedInputException: Input length = 1
Status: RESOLVED INVALID
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 3.1
Hardware: All Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-09 09:40 UTC by Frederic Girard
Modified: 2021-10-16 12:24 UTC (History)
1 user (show)



Attachments
jmeter's exception (2.69 KB, text/plain)
2017-02-09 09:40 UTC, Frederic Girard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Girard 2017-02-09 09:40:54 UTC
Created attachment 34739 [details]
jmeter's exception

When doing a simple HTTP GET with the HTTP sampler :

GET https://xxx/usr-gateway/oauth/authorize?client_id=whatever&response_type=code

No request is sent, I only get a jmeter exception. See attached log.

When doing the same thing with jmeter 3.0, it works fine.
Comment 1 Philippe Mouawad 2017-02-10 20:58:19 UTC
Hello,
Could you check with nightly build please ?
http://jmeter.apache.org/nightly.html

If issue persists, using nightly build set in log4j2.xml, uncomment :
    <Logger name="org.apache.http" level="debug" />
    <Logger name="org.apache.http.wire" level="debug" />

Run your test and attach logs here.
Thanks
Comment 2 Frederic Girard 2017-02-13 14:44:14 UTC
Latest nightly (r1782718) fails to start with the following message :

An error occurred: class org.apache.log4j.spi.NOPLogger overrides final method getEffectiveLevel.()Lorg/apache/log4j/Level
Comment 3 UbikLoadPack support 2017-02-13 14:52:24 UTC
(In reply to Frederic Girard from comment #2)
> Latest nightly (r1782718) fails to start with the following message :
> 
> An error occurred: class org.apache.log4j.spi.NOPLogger overrides final
> method getEffectiveLevel.()Lorg/apache/log4j/Level

Hi,
Are you sure you don't have incompatible 3rd party plugins ?
Can you attach jmeter.log ?
Thanks
Comment 4 Philippe Mouawad 2017-02-13 21:18:30 UTC
(In reply to Frederic Girard from comment #2)
> Latest nightly (r1782718) fails to start with the following message :
> 
> An error occurred: class org.apache.log4j.spi.NOPLogger overrides final
> method getEffectiveLevel.()Lorg/apache/log4j/Level

I confirm I face no issue with nightly build
Comment 5 Philippe Mouawad 2017-02-14 20:34:51 UTC
Any feedback ? 
Did you try again nightly build ?
Thanks
Comment 6 Frederic Girard 2017-02-15 16:08:20 UTC
Hello, I can start jmeter without any plugin, but my script won't load without some of them.
So you're probably right, some plugins seems no more compatible with v3.1, and I can't use it anyway.
Comment 7 Felix Schumacher 2017-02-15 16:31:52 UTC
Can you tell us, which 3rd party plugins you are using?
Comment 8 Frederic Girard 2017-02-16 16:32:32 UTC
Ok, I'm using the standard, extras and extralibs plugins, the CMDrunner, hazelcast client, HTTPraw, functions and a custom one.

But it seems it was quite a mess in the ext folder, with many versions of the same plugins. I couldn't find which one was causing this error message.

I did some cleanup and it seems it works better. I couldn't retry the oauth HTTP request, I'll do it ASAP.
Comment 9 Frederic Girard 2017-04-19 14:31:17 UTC
Hello everyone,

After many tests, it appears that I still have the "java.nio.charset.MalformedInputException: Input length = 1" exception with jmeter 3.1 on a simple http request, whereas jmeter 3.0 works fine.
Comment 10 Felix Schumacher 2017-04-19 18:47:52 UTC
We were not able to reproduce your problem. So please give us more information, that enables us to understand the problem.

If the request can be made with JMeter version 3.0, it might help to attach the headers, that have to be parsed by JMeter.
Comment 11 Frederic Girard 2017-04-20 08:56:47 UTC
jmeter 3.1 :

GET https://falcon-usr-rest.lotsys.corp/usr-gateway/oauth/authorize?client_id=xxx&response_type=code

GET data:


[no cookies]

Request Headers:
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko
Accept-Language: fr-FR
Accept: text/html, application/xhtml+xml, */*
Accept-Encoding: gzip, deflate
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Host: falcon-usr-rest.lotsys.corp

Response :

java.nio.charset.MalformedInputException: Input length = 1
	at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
	at org.apache.http.impl.io.AbstractSessionInputBuffer.handleDecodingResult(AbstractSessionInputBuffer.java:374)
	at org.apache.http.impl.io.AbstractSessionInputBuffer.appendDecoded(AbstractSessionInputBuffer.java:361)
	at org.apache.http.impl.io.AbstractSessionInputBuffer.lineFromReadBuffer(AbstractSessionInputBuffer.java:339)
	at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:258)
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:140)
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
	at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
	at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281)
	at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:259)
	at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:209)
	at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.receiveResponseHeader(MeasuringConnectionManager.java:212)
	at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:686)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:488)
	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:654)
	at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:413)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1166)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1155)
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:475)
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:418)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249)
	at java.lang.Thread.run(Thread.java:745)


Thread Name: ITF thread group 2-1
Sample Start: 2017-04-20 10:55:43 CEST
Load time: 384
Connect Time: 12
Latency: 0
Size in bytes: 2730
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 2730
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.nio.charset.MalformedInputException
Response message: Non HTTP response message: Input length = 1

Response headers:


HTTPSampleResult fields:
ContentType: 
DataEncoding: null




jmeter 3.0 :

GET https://falcon-usr-rest.lotsys.corp/usr-gateway/oauth/authorize?client_id=xxx&response_type=code

[no cookies]

Request Headers:
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko
Accept-Language: fr-FR
Accept: text/html, application/xhtml+xml, */*
Accept-Encoding: gzip, deflate
Host: falcon-usr-rest.lotsys.corp

No response, but a redirection :

Response headers:
HTTP/1.1 302 Déplacé Temporairement
Server: Apache-Coyote/1.1
Cache-Control: no-store
Location: https://vip-falcon-gtw-itf.lotsys.corp/itf-gateway/rest/itf/session?lottery=falcon-usr&code=XXX
Content-Language: fr-FR
Content-Length: 0
Date: Thu, 20 Apr 2017 08:48:25 GMT


HTTPSampleResult fields:
ContentType: 
DataEncoding: null


I can hardly be more explicite.
Comment 12 Felix Schumacher 2017-04-20 09:05:02 UTC
The first line in the response contains non asci characters. I am pretty sure, that this is not allowed and the cause of the error message.

I think we can look into this in more detail now.
Comment 13 Frederic Girard 2017-04-20 19:08:34 UTC
I think no request is sent. I couldn't find any trace of this request in my tomcat access log.
And even if a request was sent, the response has a content-length of zero.
Comment 14 Frederic Girard 2017-04-20 19:29:29 UTC
Since the first request specifies 'charset=UTF-8', I see no reason the header couldn't be read even with non-ASCII characters.
Comment 15 Felix Schumacher 2017-04-20 19:44:51 UTC
Maybe you could debug the network connection by setting  -Djavax.net.debug=all

That way you can see, what JMeter is sending and what the server is sending.
Comment 16 Philippe Mouawad 2017-05-27 22:36:35 UTC
(In reply to Felix Schumacher from comment #15)
> Maybe you could debug the network connection by setting 
> -Djavax.net.debug=all
> 
> That way you can see, what JMeter is sending and what the server is sending.

Would it be possible to uncomment in log4j2.xml:
    <!-- # Enable full wire + context logging -->
    <Logger name="org.apache.http" level="debug" />


And run the failing request then attach jmeter.log
Thanks
Comment 17 Philippe Mouawad 2017-08-27 18:15:32 UTC
Hello,
I am pretty sure as per Felix answer that problem comes from this line:
HTTP/1.1 302 Déplacé Temporairement

See:

https://stackoverflow.com/questions/4400678/what-character-encoding-should-i-use-for-a-http-header
Comment 18 Frederic Girard 2017-08-28 06:25:30 UTC
I cannot test it any more (I moved), but this is quite likely, I agree.
This would mean it is a real bug.
Comment 19 The ASF infrastructure team 2022-09-24 20:38:07 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4274