Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOFException when okio tries to log a body on a 204 http response #125

Closed
deionalims opened this issue Mar 10, 2015 · 7 comments
Closed

Comments

@deionalims
Copy link

Hello.

I have this problem that I've been trying to fix for days. Okio tries to log a body on a 204 http response and it ends up in a EOFException.
I'm out of ideas. Any help would be really appreciated.


<--- HTTP 204 https://some.url/
Server: nginx
Date: Tue, 10 Mar 2015 12:38:53 GMT
Content-Type: text/html
Connection: keep-alive
Cache-Control: private, must-revalidate
pragma: no-cache
expires: -1
Set-Cookie: flash_bag=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; httponly
X-Varnish: 391643738
OkHttp-Selected-Protocol: http/1.1
OkHttp-Sent-Millis: 1425991132134
OkHttp-Received-Millis: 1425991132581

9098-9332/com.comuto D/Retrofit﹕ java.io.EOFException
            at okio.RealBufferedSource.require(RealBufferedSource.java:64)
            at okio.GzipSource.consumeHeader(GzipSource.java:114)
            at okio.GzipSource.read(GzipSource.java:73)
            at okio.RealBufferedSource$1.read(RealBufferedSource.java:298)
            at retrofit.Utils.streamToBytes(Utils.java:43)
            at retrofit.Utils.readBodyToBytesIfNecessary(Utils.java:81)
            at retrofit.RestAdapter.logAndReplaceResponse(RestAdapter.java:483)
            at retrofit.RestAdapter.access$500(RestAdapter.java:107)
            at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:338)
@JakeWharton
Copy link
Member

This behavior has nothing to do with Okio, and you already commented on the bug which is filed on Retrofit.

@deionalims
Copy link
Author

This is your comment from the bug filled on Retrofit:
"If there is a problem with a library (which I'm doubtful of) it would be in OkHttp or potentially even in Okio."
Reading the stacktrace I assumed this was okio. That's why I also filled a bug here.

@JakeWharton
Copy link
Member

square/retrofit#735

@kenorb
Copy link

kenorb commented Mar 23, 2016

Could be a proxy configuration issue (e.g. Varnish), which can unset/delete your cookies. See similar thing for Drupal.

@arenaq
Copy link

arenaq commented Jan 18, 2017

Couldn't this be simply caused by terminated connection? Or it would throw a different exception?

@sergicastellsague
Copy link

Just in case this helps somebody in the future, I had the same issue when trying to use Charles at the same time.
The issue was not actually caused by Charles but Android Emulator.
You have the option to set the proxy through the Side panel of Emulator. Don't do it! Do it as if it was a real device, open settings, press WiFi and set it there.

@houdangui1985
Copy link

We are facing the similar EOF exception: java.io.eofexception at okio.realbufferedsource.require .
It happens randomly on Windows Android Emulator, but not Macbook Android Emulator, compared with calling same api with same account.

Our working environment has a sophisticated internal network setting for security reason. I doubt it is because of some wifi proxy setting. but cannot find the exact reason yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants