question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Fetch - FATAL EXCEPTION: OkHttp Dispatcher

See original GitHub issue

I haven’t figured out a way to reproduce this. But this happens once in a while using fetch(). I’m trying to find a way to reproduce. Will update the issue then. This is the trace I’m getting. Does this ring a bell for anyone?

E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
     Process: com.company.app, PID: 4508
     java.lang.IllegalStateException: closed
          at okio.RealBufferedSink.write(RealBufferedSink.java:39)
          at okio.ForwardingSink.write(ForwardingSink.java:35)
          at com.facebook.react.modules.network.ProgressRequestBody$1.write(ProgressRequestBody.java:58)
          at okio.RealBufferedSink.flush(RealBufferedSink.java:216)
          at com.facebook.react.modules.network.ProgressRequestBody.writeTo(ProgressRequestBody.java:48)
          at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:47)
          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
          at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
          at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
          at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
          at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)
          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
          at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
          at okhttp3.RealCall.access$100(RealCall.java:33)
          at okhttp3.RealCall$AsyncCall.execute(RealCall.java:120)
          at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
          at java.lang.Thread.run(Thread.java:818)

Additional Information

  • React Native version: 0.37
  • Platform: Android
  • Operating System: MacOs

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
abrantes01commented, Apr 18, 2017

Same issue here… Do you guys have any news on this ?

5reactions
litingjun2015commented, Feb 24, 2017

I can reproduce it:


let url = APIs.DUANG_LOGIN;  
        console.log(url);
        console.log(formData);

        response = await fetch(url, {
                    method: 'POST',
                    headers: {
                        'Accept': 'application/json',
                        'Content-Type': 'multipart/form-data',
                    },
                    body: formData
                    });
        data = await response.json();
        console.log(data);


Fist Call:
-----------------------------------------------------------------------------------------------------------------------------D/wpa_supplicant( 1146): wlan0: Control interface command 'SIGNAL_POLL'
I/ReactNativeJS(19589): https://open.duangwifi.cn/v1/site/login
I/ReactNativeJS(19589): { _parts: [ [ 'username', 'demo' ], [ 'password', '123456' ] ] }

E/ReactNativeJS(19589): [TypeError: Network request failed]
E/unknown:React(19589): Network request failed, stack:
E/unknown:React(19589): onerror@193:13650
E/unknown:React(19589): value@185:1505
E/unknown:React(19589): value@184:6892
E/unknown:React(19589): value@184:3493
E/unknown:React(19589): <unknown>@184:9942
E/unknown:React(19589): value@76:1364
E/unknown:React(19589): value@30:2818
E/unknown:React(19589): <unknown>@30:1053
E/unknown:React(19589): d@30:127
E/unknown:React(19589): value@30:1025
--------------------------------------------------------------------------------------------------

Second Call:
--------------------------------------------------------------------------------------------------
I/ReactNativeJS(19589): https://open.duangwifi.cn/v1/site/login
I/ReactNativeJS(19589): { _parts: [ [ 'username', 'demo' ], [ 'password', '123456' ] ] }

E/AndroidRuntime(19589): FATAL EXCEPTION: OkHttp Dispatcher
E/AndroidRuntime(19589): Process: com.duanglink.bizappv3, PID: 19589
E/AndroidRuntime(19589): java.lang.IllegalStateException: closed
E/AndroidRuntime(19589):       	at okio.RealBufferedSink.write(RealBufferedSink.java:39)
E/AndroidRuntime(19589):       	at okio.ForwardingSink.write(ForwardingSink.java:35)
E/AndroidRuntime(19589):       	at com.facebook.react.modules.network.ProgressRequestBody$1.write(ProgressRequestBody.java:58)
E/AndroidRuntime(19589):       	at okio.RealBufferedSink.flush(RealBufferedSink.java:216)
E/AndroidRuntime(19589):       	at com.facebook.react.modules.network.ProgressRequestBody.writeTo(ProgressRequestBody.java:48)
E/AndroidRuntime(19589):       	at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:47)
E/AndroidRuntime(19589):       	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
E/AndroidRuntime(19589):       	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
E/AndroidRuntime(19589):       	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
E/AndroidRuntime(19589):       	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
E/AndroidRuntime(19589):       	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
E/AndroidRuntime(19589):       	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
E/AndroidRuntime(19589):       	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
E/AndroidRuntime(19589):       	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
E/AndroidRuntime(19589):       	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
E/AndroidRuntime(19589):       	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)
E/AndroidRuntime(19589):       	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
E/AndroidRuntime(19589):       	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
E/AndroidRuntime(19589):       	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
E/AndroidRuntime(19589):       	at okhttp3.RealCall.access$100(RealCall.java:33)
E/AndroidRuntime(19589):       	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:120)
E/AndroidRuntime(19589):       	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
E/AndroidRuntime(19589):       	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/AndroidRuntime(19589):       	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/AndroidRuntime(19589):       	at java.lang.Thread.run(Thread.java:818)
I/octvm_klo( 3003): klo lock
I/WtEventController( 1599): Receive am_crash event for pid: 19589
W/ActivityManager(  855):   Force finishing activity com.duanglink.bizappv3/.MainActivity
Read more comments on GitHub >

github_iconTop Results From Across the Web

FATAL EXCEPTION: OkHttp Dispatcher - java - Stack Overflow
This is caused by using different versions of OkHttp. Ensure all your dependencies from com.squareup.okhttp3 are using the same version.
Read more >
AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher ...
I had this issue while doing a fetch() call using Authorisation headers. The dependencies listed in this issue are working for Android 10,...
Read more >
FATAL EXCEPTION: OkHttp Dispatcher (Example) - Treehouse
Hi! I've got this issue with FATAL EXCEPTION: OkHttp Dispatcher and null object reference ... Everything was fine until constructor ...
Read more >
Dispatcher - OkHttp
Square's meticulous HTTP client for the JVM, Android, and GraalVM. ... Each dispatcher uses an ExecutorService to run calls internally.
Read more >
Retrofit + okHttp使用中遇到的FATAL EXCEPTION - Steemit
Retrofit + okHttp使用中遇到的FATAL EXCEPTION: OkHttp Dispatcher问题 ... 开始因为下面还有OutOfMemoryError 的错,怀疑是视频有问题检查,视频文件正常大小有110M,虽然 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found