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
java.io.EOFException at okio.RealBufferedSource.require(RealBufferedSource.java:60) when body is empty when 404 error status #3646
Comments
This isn't a reproducible bug or something that looks like it requires a fix in OkHttp (yet). Can you please post on stackoverflow with a reproducible test case, or at least your client code. Please include in your stackoverflow post whether it fails the same way, with or without HttpLoggingInterceptor. |
我也老是出现这个异常 急求解决 |
Google Translate: "I also always appear this exception urgently needed to solve" @shuaimango can you link to your post on stackoverflow? |
Hi, The responseBody.contentLength is -1 in this case. Anyhow a -1 contentLength should not be logged, so I suggest to insert another check at HTTPLoggingInterceptor line 238 Workaround is not to log the Response BODY. |
Can you report the bug to the maintainers of the Microsoft PowerBI API? Their API is wrong. |
@swankjesse I'm not sure about it. It's a response to a POST request. The method hasBody(Response response) in okhttp3.internal.http.HttpHeaders returns true if the response code is 200. In case of a 200 response with empty body (Content-Length: 0) shouldn't it return false? Full header: |
The content-encoding is not Gzip because it doesn’t have the required 10-byte Gzip header. |
Getting the same issue on a 202 No Content with a zero length response body |
@kngmat004 you should report the problem to whoever hosts the server. If it's the same as above it's a bug. If you really need to handle it in the client, because the server can't be fixed, consider using a network interceptor to change headers to work around it. If you think it's a bug in OkHttp please provide a reproducible example. |
Dear community!
Could you please help me with my bug?
There is response, request and an exception in logs below. I expect 404 code response but my tests failed because of weird exception.
I replaced url and token in logs with dummy values.
logs:
The text was updated successfully, but these errors were encountered: