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

IllegalStateException: closed : HttpLoggingInterceptor.kt:248 #8307

Closed
pankajtalaviya97 opened this issue Mar 28, 2024 · 1 comment
Closed
Labels
bug Bug in existing code stackoverflow Referred to stackoverflow

Comments

@pankajtalaviya97
Copy link

getting below exception and crashed my app

Fatal Exception: java.lang.IllegalStateException
closed
okio.RealBufferedSource.request (RealBufferedSource.kt:206)
okhttp3.logging.HttpLoggingInterceptor.intercept (HttpLoggingInterceptor.kt:248)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp (RealCall.kt:201)
okhttp3.internal.connection.RealCall$AsyncCall.run (RealCall.kt:517)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)

@pankajtalaviya97 pankajtalaviya97 added the bug Bug in existing code label Mar 28, 2024
@yschimke
Copy link
Collaborator

Dupe of #5783 and #6106

I don’t think this is an OkHttp bug. If you close a stream and then attempt to read it, that’s an IllegalStateException. My expectation here is some other interceptor is closing the response body.

Please provide a repro, or ask on a site like stackoverflow.

@yschimke yschimke added the stackoverflow Referred to stackoverflow label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in existing code stackoverflow Referred to stackoverflow
Projects
None yet
Development

No branches or pull requests

2 participants