question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EOFException when there is no HTTP response

See original GitHub issue

I am getting the following exception when the server is down and there is no response for the request.

java.io.IOException: unexpected end of stream on Connection{rh7v-intel64-90-java-stress-4.marklogic.com:8000, proxy=DIRECT hostAddress=rh7v-intel64-90-java-stress-4.marklogic.com/172.18.132.248:8000 cipherSuite=none protocol=http/1.1}
	at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:205)
	at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:75)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	at com.burgstaller.okhttp.AuthenticationCacheInterceptor.intercept(AuthenticationCacheInterceptor.java:45)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
	at okhttp3.RealCall.execute(RealCall.java:69)
	at com.marklogic.client.impl.OkHttpServices.sendRequestOnce(OkHttpServices.java:674)
	... 13 more
Caused by: java.io.EOFException: \n not found: limit=0 content=…
	at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:227)
	at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSurce.java:211)
	at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
	... 32 more

Capturing the trace in wireshark shows that the request has been sent but the server doesn’t respond, not even a status code. In that case, I am getting this exception which is very misleading. It would be good to have a more appropriate exception for cases where there is no response from the server. Thanks.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sammeffordcommented, Oct 6, 2017

Thanks, Yuri and Jesse, for the due diligence.

0reactions
Kolyallcommented, Feb 15, 2018

@sammefford @vivekmuniyandi how did you resolve the issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to avoid EOFException for an empty HTTP response from ...
If responseStream.available() > 0 is not an option, it means that the stream actually contains something, but that stream seems to be incomplete...
Read more >
How to Fix the EOFException in Java.io - Rollbar
EOFException is a checked exception in Java that occurs when an end of file or end of stream is reached unexpectedly during input....
Read more >
Response.java
When all modules have handled the response then the HTTPResponse * fills in its ... the message length of the response if either...
Read more >
Web service with no records fails with error as below:
I want to make use of choice Property to decide if or not data is present in source/web service. But it throws below...
Read more >
EOFException (Java Platform SE 7 ) - Oracle Help Center
Signals that an end of file or end of stream has been reached unexpectedly during input. This exception is mainly used by data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found