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

IOException: ID1ID2: actual 0x00000a3c != expected 0x00001f8b #299

Closed
sm-tester opened this issue Apr 5, 2017 · 11 comments
Closed

IOException: ID1ID2: actual 0x00000a3c != expected 0x00001f8b #299

sm-tester opened this issue Apr 5, 2017 · 11 comments

Comments

@sm-tester
Copy link

-06 00:08:29.085 5471-17106/com.takeal.stm D/OkHttp: --> POST http://www.takeal.com/api/mobile/register http/1.1
04-06 00:08:29.085 5471-17106/com.takeal.stm D/OkHttp: Content-Type: application/x-www-form-urlencoded
04-06 00:08:29.099 5471-17106/com.takeal.stm D/OkHttp: Content-Length: 196
04-06 00:08:29.104 5471-17106/com.takeal.stm D/OkHttp: first_name=Mr.boyfox&last_name=go
04-06 00:08:29.109 5471-17106/com.takeal.stm D/OkHttp: --> END POST (196-byte body)
04-06 00:08:34.880 5471-17106/com.takeal.stm D/OkHttp: <-- 200 OK http://www.takeal.com/api/mobile/register (5771ms)
04-06 00:08:34.880 5471-17106/com.takeal.stm D/OkHttp: Server: nginx
04-06 00:08:34.880 5471-17106/com.takeal.stm D/OkHttp: Date: Wed, 05 Apr 2017 19:08:33 GMT
04-06 00:08:34.881 5471-17106/com.takeal.stm D/OkHttp: Content-Type: application/json; charset=utf-8
04-06 00:08:34.881 5471-17106/com.takeal.stm D/OkHttp: Transfer-Encoding: chunked
04-06 00:08:34.881 5471-17106/com.takeal.stm D/OkHttp: Connection: keep-alive
04-06 00:08:34.881 5471-17106/com.takeal.stm D/OkHttp: Set-Cookie: ci_sessions=91prv7u7k7m8fblif6n94trkc9; expires=Wed, 05-Apr-2017 21:08:28 GMT; Max-Age=7200; path=/; HttpOnly
04-06 00:08:34.881 5471-17106/com.takeal.stm D/OkHttp: Expires: Thu, 19 Nov 1981 08:52:00 GMT
04-06 00:08:34.881 5471-17106/com.takeal.stm D/OkHttp: Cache-Control: no-store, no-cache, must-revalidate
04-06 00:08:34.881 5471-17106/com.takeal.stm D/OkHttp: Pragma: no-cache
04-06 00:08:34.882 5471-17106/com.takeal.stm D/OkHttp: Vary: Accept-Encoding
04-06 00:08:34.882 5471-17106/com.takeal.stm D/OkHttp: X-Frame-Options: SAMEORIGIN
04-06 00:08:34.882 5471-17106/com.takeal.stm D/OkHttp: X-Content-Type-Options: nosniff
04-06 00:08:34.882 5471-17106/com.takeal.stm D/OkHttp: X-Xss-Protection: 1; mode=block
04-06 00:08:34.883 5471-17106/com.takeal.stm W/System.err: java.io.IOException: ID1ID2: actual 0x00000a3c != expected 0x00001f8b
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at okio.GzipSource.checkEqual(GzipSource.java:205)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at okio.GzipSource.consumeHeader(GzipSource.java:120)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at okio.GzipSource.read(GzipSource.java:73)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at okio.RealBufferedSource.request(RealBufferedSource.java:66)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:238)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at okhttp3.RealCall.execute(RealCall.java:63)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at retrofit2.OkHttpCall.execute(OkHttpCall.java:174)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall.execute(ExecutorCallAdapterFactory.java:89)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at com.takeal.stm.fragments.authregpages.RegisterPage$10.run(RegisterPage.java:556)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
04-06 00:08:34.884 5471-17106/com.takeal.stm W/System.err:     at java.lang.Thread.run(Thread.java:818)
04-06 00:22:56.637 5471-31392/com.takeal.stm D/OkHttp: --> GET http://www.takeal.com/api/mobile/check/username/b http/1.1
04-06 00:22:56.637 5471-31392/com.takeal.stm D/OkHttp: --> END GET
04-06 00:22:56.839 5471-31392/com.takeal.stm W/System.err: java.net.SocketException: Socket closed
04-06 00:22:56.839 5471-31392/com.takeal.stm W/System.err:     at libcore.io.IoBridge.isConnected(IoBridge.java:226)
04-06 00:22:56.839 5471-31392/com.takeal.stm W/System.err:     at libcore.io.IoBridge.connectErrno(IoBridge.java:171)
04-06 00:22:56.839 5471-31392/com.takeal.stm W/System.err:     at libcore.io.IoBridge.connect(IoBridge.java:122)
04-06 00:22:56.839 5471-31392/com.takeal.stm W/System.err:     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183)
04-06 00:22:56.839 5471-31392/com.takeal.stm W/System.err:     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:456)
04-06 00:22:56.839 5471-31392/com.takeal.stm W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
04-06 00:22:56.839 5471-31392/com.takeal.stm W/System.err:     at java.lang.reflect.Method.invoke(Method.java:372)
04-06 00:22:56.839 5471-31392/com.takeal.stm W/System.err:     at com.splunk.mint.network.util.Delegator.invoke0(Delegator.java:47)
04-06 00:22:56.839 5471-31392/com.takeal.stm W/System.err:     at com.splunk.mint.network.util.Delegator.invoke(Delegator.java:39)
04-06 00:22:56.839 5471-31392/com.takeal.stm W/System.err:     at com.splunk.mint.network.socket.MonitoringSocketImpl.connect(MonitoringSocketImpl.java:179)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at java.net.Socket.connect(Socket.java:882)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.platform.AndroidPlatform.connectSocket(AndroidPlatform.java:63)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:220)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:146)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:186)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:121)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:100)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
04-06 00:22:56.840 5471-31392/com.takeal.stm W/System.err:     at com.takeal.stm.services.LoginInterseptor.intercept(LoginInterseptor.java:20)
04-06 00:22:56.841 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
04-06 00:22:56.841 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
04-06 00:22:56.841 5471-31392/com.takeal.stm W/System.err:     at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:212)
04-06 00:22:56.841 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
04-06 00:22:56.841 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
04-06 00:22:56.841 5471-31392/com.takeal.stm W/System.err:     at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179)
04-06 00:22:56.841 5471-31392/com.takeal.stm W/System.err:     at okhttp3.RealCall$AsyncCall.execute(RealCall.java:129)
04-06 00:22:56.841 5471-31392/com.takeal.stm W/System.err:     at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
04-06 00:22:56.841 5471-31392/com.takeal.stm W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
04-06 00:22:56.841 5471-31392/com.takeal.stm W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
04-06 00:22:56.841 5471-31392/com.takeal.stm W/System.err:     at java.lang.Thread.run(Thread.java:818)
@JakeWharton
Copy link
Collaborator

0x0a3c is a newline followed by < which indicates your server is returning uncompressed data (likely HTML) despite advertising that the response has been gzipped.

@JakeWharton
Copy link
Collaborator

Or, put another way, this isn't an Okio or OkHttp problem but likely a problem with the server you're talking to. You can set the Accept-Encoding: identity header on your requests to work around the broken server if you don't control it.

@sm-tester
Copy link
Author

ok, thank you for definition @JakeWharton!

@kuno
Copy link

kuno commented Sep 28, 2017

@JakeWharton

Sorry, We have the same problem in our project. The backend team said that no problem on their side.

On the app side, we have a lot of network interceptors adding to okhttp client. Is this might be the cuase ?

@benebun
Copy link

benebun commented Nov 15, 2017

@JakeWharton same problem here: Server switched from not gzipped to gzipped and the GzipSource.checkEqual() throws an exception because the local cache it compares hasn't been gzipped. Is this expected behaviour?
Edit: Additional information: Server is nginx which switches to a weak etag when enabling Gzip which doesn't seem to bust the cache.
A comment would be nice whether you think this is a problem with the app, the server or this library. Thank you!

@sokarcreative
Copy link

sokarcreative commented Nov 17, 2017

@JakeWharton Same problem

@nuwanchamara
Copy link

I sent header Accept-Encoding: identity. It solved my problem. I used Android Fast Networking Library for download PDF files from server. Somehow without sending the above-mentioned header, it worked before. Suddely got exception in file downloading. I have no idea about the root cause. But adding Accept-Encoding: identity it worked.

@710399346
Copy link

I sent header Accept-Encoding: identity. It solved my problem. I used Android Fast Networking Library for download PDF files from server. Somehow without sending the above-mentioned header, it worked before. Suddely got exception in file downloading. I have no idea about the root cause. But adding Accept-Encoding: identity it worked.

thank you

@dsp55335
Copy link

Accept-Encoding: identity solved the issue. Thanks @JakeWharton

@sankartringapps
Copy link

Anyone who face this issue, check if something wrong with any of your interceptors before adding Accept-Encoding: identity. For me, I was using AndroidSnooper library for logging network calls and that (interceptor from library) was causing the issue.

@ndungudedan
Copy link

If this happens on production and you happen to be using proguard, try disabling it first and then test the app again to check if this issue gets resolved.
For instance, the following release configuration resolved the issue after commenting out proguard settings. Maybe not the best advise but it is a starting point.

buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
//            proguardFiles getDefaultProguardFile(
//                    'proguard-android-optimize.txt'),
//                    'proguard-rules.pro'
        }
    }

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