JDK-8262294 : java/net/httpclient/ProxyAuthDisabledSchemes.java fails with HTTP/1.1 parser received no bytes
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 11,18,21
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2021-02-24
  • Updated: 2023-07-21
  • Resolved: 2023-03-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21 b17Fixed
Related Reports
Relates :  
Relates :  
Description
Extract from the log:

...

FINE [Feb 24, 8:57:20.620455000] sun.net.httpserver.ServerImpl$Exchange run: Exchange request line: POST /foo/ HTTP/1.1
FINE [Feb 24, 8:57:20.622015000] sun.net.httpserver.ServerImpl logReply: POST /foo/ HTTP/1.1 [200  OK] ()
FINE [Feb 24, 8:57:20.630632000] sun.net.httpserver.ServerImpl$Exchange run: Exchange request line: POST /foo/ HTTP/1.1
FINE [Feb 24, 8:57:20.632156000] sun.net.httpserver.ServerImpl logReply: POST /foo/ HTTP/1.1 [200  OK] ()
FINE [Feb 24, 8:57:20.639300000] sun.net.httpserver.ServerImpl$Exchange run: no request line: closing
java.lang.RuntimeException: Unexpected exception: java.io.IOException: HTTP/1.1 header parser received no bytes
	at DigestEchoClient.testBasic(DigestEchoClient.java:455)
	at DigestEchoClient.main(DigestEchoClient.java:281)
	at ProxyAuthDisabledSchemes.main(ProxyAuthDisabledSchemes.java:54)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes
	at java.net.http/jdk.internal.net.http.common.Utils.wrapWithExtraDetail(Utils.java:304)
	at java.net.http/jdk.internal.net.http.Http1Response$HeadersReader.onReadError(Http1Response.java:665)
	at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.checkForErrors(Http1AsyncReceiver.java:297)
	at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.flush(Http1AsyncReceiver.java:263)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SynchronizedRestartableTask.run(SequentialScheduler.java:175)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:147)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:198)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	... 1 more
Caused by: java.io.IOException: connection closed locally
	at java.net.http/jdk.internal.net.http.SocketTube.signalClosed(SocketTube.java:157)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.close(PlainHttpConnection.java:277)
	at java.net.http/jdk.internal.net.http.ConnectionPool.cleanup(ConnectionPool.java:479)
	at java.net.http/jdk.internal.net.http.ConnectionPool$CleanupTrigger.triggerCleanup(ConnectionPool.java:502)
	at java.net.http/jdk.internal.net.http.ConnectionPool$CleanupTrigger.onNext(ConnectionPool.java:518)
	at java.net.http/jdk.internal.net.http.ConnectionPool$CleanupTrigger.onNext(ConnectionPool.java:487)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.read(SocketTube.java:844)
	at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowTask.run(SocketTube.java:175)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:198)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:271)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:224)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.handleSubscribeEvent(SocketTube.java:690)
	at java.net.http/jdk.internal.net.http.AsyncTriggerEvent.handle(AsyncTriggerEvent.java:54)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:815)

Comments
Changeset: 2d607c9c Author: Daniel JeliƄski <djelinski@openjdk.org> Date: 2023-03-30 05:15:19 +0000 URL: https://git.openjdk.org/jdk/commit/2d607c9cd19bec5d4a90cb4760fba3cf83bcf982
30-03-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13224 Date: 2023-03-29 10:45:22 +0000
29-03-2023

Last sighting was caused by: [NoAuth Server Filter]:DigestEchoServer[PID=128,PORT=57243]:HTTP_1_1:http:SERVER:BASICSERVER: Unexpected exception while handling request: java.io.IOException: Expect: [100-Continue, 100-Continue] java.io.IOException: Expect: [100-Continue, 100-Continue] at DigestEchoServer$AbstractHttpFilter.doFilter(DigestEchoServer.java:762) at jdk.httpclient.test.lib.common.HttpServerAdapters$HttpTestFilter$1.doFilter(HttpServerAdapters.java:495) at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:101) at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:835) at jdk.httpserver/sun.net.httpserver.ServerImpl$DefaultExecutor.execute(ServerImpl.java:204) at jdk.httpserver/sun.net.httpserver.ServerImpl$Dispatcher.handle(ServerImpl.java:567) at jdk.httpserver/sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:533) at java.base/java.lang.Thread.run(Thread.java:1623) Not sure yet how expect header could be added twice. We could modify the httpclient to set "Expect: 100-continue" using setSystemHeader instead of addSystemHeader, but that would only mask the issue.
28-03-2023

Here's a log file snippet for the jdk-21+7-475-tier2 sighting: java/net/httpclient/ProxyAuthDisabledSchemes.java TestServer(1): finished java.lang.RuntimeException: Unexpected exception: java.io.IOException: HTTP/1.1 header parser received no bytes at DigestEchoClient.testBasic(DigestEchoClient.java:453) at DigestEchoClient.main(DigestEchoClient.java:277) at ProxyAuthDisabledSchemes.main(ProxyAuthDisabledSchemes.java:48) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:578) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125) at java.base/java.lang.Thread.run(Thread.java:1623) Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes at java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:909) at java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:133) at DigestEchoClient.testBasic(DigestEchoClient.java:438) ... 6 more Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes at java.net.http/jdk.internal.net.http.common.Utils.wrapWithExtraDetail(Utils.java:351) at java.net.http/jdk.internal.net.http.Http1Response$HeadersReader.onReadError(Http1Response.java:574) at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.checkForErrors(Http1AsyncReceiver.java:302) at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.flush(Http1AsyncReceiver.java:268) at java.net.http/jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:205) at java.net.http/jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149) at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ... 1 more Caused by: java.io.IOException: An established connection was aborted by the software in your host machine at java.base/sun.nio.ch.SocketDispatcher.read0(Native Method) at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:46) at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:340) at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:306) at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:269) at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:425) at java.net.http/jdk.internal.net.http.SocketTube.readAvailable(SocketTube.java:1178) at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.read(SocketTube.java:841) at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowTask.run(SocketTube.java:181) at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230) at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:303) at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:256) at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.signalReadable(SocketTube.java:782) at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$ReadEvent.signalEvent(SocketTube.java:965) at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowEvent.handle(SocketTube.java:253) at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(HttpClientImpl.java:1390) at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(HttpClientImpl.java:1335) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:1335) JavaTest Message: Test threw exception: java.lang.RuntimeException: Unexpected exception: java.io.IOException: HTTP/1.1 header parser received no bytes JavaTest Message: shutting down test
25-01-2023