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 when decompressing large chunked content #1971

Open
Jeetah opened this issue Dec 2, 2024 · 0 comments
Open

IllegalStateException when decompressing large chunked content #1971

Jeetah opened this issue Dec 2, 2024 · 0 comments
Labels

Comments

@Jeetah
Copy link

Jeetah commented Dec 2, 2024

When Logbook tries to log chunked gzipped content it leads to the exception below.

Description

Does not happen if removing GzipInterceptor - but of course then the compressed content is logged.

Expected Behavior

Chunked content should be logged up to given max-body-length.

Actual Behavior

`java.lang.IllegalStateException: closed

at okio.RealBufferedSource.request(RealBufferedSource.kt:206)
at okio.RealBufferedSource.require(RealBufferedSource.kt:202)
at okio.GzipSource.consumeHeader(GzipSource.kt:104)
at okio.GzipSource.read(GzipSource.kt:62)
at okio.Buffer.writeAll(Buffer.kt:1303)
at okio.RealBufferedSource.readByteArray(RealBufferedSource.kt:239)
at okhttp3.ResponseBody.bytes(ResponseBody.kt:124)
at org.zalando.logbook.okhttp.RemoteResponse$Offering.buffer(RemoteResponse.java:85)
at org.zalando.fauxpas.ThrowingFunction.apply(ThrowingFunction.java:19)
at java.base/java.util.concurrent.atomic.AtomicReference.updateAndGet(AtomicReference.java:210)
at org.zalando.logbook.okhttp.RemoteResponse.buffer(RemoteResponse.java:192)
at org.zalando.logbook.okhttp.RemoteResponse.toResponse(RemoteResponse.java:183)
at org.zalando.logbook.okhttp.LogbookInterceptor.intercept(LogbookInterceptor.java:32)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
at feign.okhttp.OkHttpClient.execute(OkHttpClient.java:176)
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:100)
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:70)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:99)`

Steps to Reproduce

Us OkHttpClient 3 with both recommended interceptors:
.addNetworkInterceptor(LogbookInterceptor(logbook)) .addNetworkInterceptor(GzipInterceptor())

Context

Cannot process chunked large content when logging is active.

Your Environment

  • Version used: logbook-okhttp 3.9.0
@Jeetah Jeetah added the Bug label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant