Forum Discussion

DannyW1's avatar
DannyW1
Explorer | Level 3
6 years ago

InterruptedIOException and NetworkIOException

My app crashes randomly and I do not know what cause the error.   I'm using RxJava2 to get the file list.

Here is the crash log

 

Caused by: com.dropbox.core.NetworkIOException
        at com.dropbox.core.DbxRequestUtil.startPostRaw(DbxRequestUtil.java:284)
        at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:146)
        at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:330)
        at com.dropbox.core.v2.DbxRawClientV2.executeRetriableWithRefresh(DbxRawClientV2.java:351)
        at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:137)
        at com.dropbox.core.v2.files.DbxUserFilesRequests.listFolder(DbxUserFilesRequests.java:2082)
        at com.dropbox.core.v2.files.DbxUserFilesRequests.listFolder(DbxUserFilesRequests.java:2132)
        at com.quirklogic.sdk.storage.dropbox.DropBoxFolder.lambda$list$0$DropBoxFolder(DropBoxFolder.java:109)
        at com.quirklogic.sdk.storage.dropbox.DropBoxFolder$$Lambda$0.call(Unknown Source)
        at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:44)
        at io.reactivex.Single.subscribe(Single.java:3220) 
        at io.reactivex.internal.operators.single.SingleMap.subscribeActual(SingleMap.java:34) 
        at io.reactivex.Single.subscribe(Single.java:3220) 
        at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89) 
        at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:571) 
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) 
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152) 
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) 
        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) 
     Caused by: java.io.InterruptedIOException
        at com.android.okio.Deadline.throwIfReached(Deadline.java:56)
        at com.android.okio.Okio$1.write(Okio.java:67)
        at com.android.okio.RealBufferedSink.flush(RealBufferedSink.java:154)
        at com.android.okhttp.internal.http.HttpConnection.flush(HttpConnection.java:130)
        at com.android.okhttp.internal.http.HttpTransport.flushRequest(HttpTransport.java:73)
        at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:626)
        at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:388)
        at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332)
        at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:500)
        at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
        at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
        at com.dropbox.core.http.StandardHttpRequestor.toResponse(StandardHttpRequestor.java:50)
        at com.dropbox.core.http.StandardHttpRequestor.access$100(StandardHttpRequestor.java:29)
        at com.dropbox.core.http.StandardHttpRequestor$Uploader.finish(StandardHttpRequestor.java:186)
        at com.dropbox.core.DbxRequestUtil.startPostRaw(DbxRequestUtil.java:279)
        at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:146) 
        at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:330) 
        at com.dropbox.core.v2.DbxRawClientV2.executeRetriableWithRefresh(DbxRawClientV2.java:351) 
        at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:137) 
        at com.dropbox.core.v2.files.DbxUserFilesRequests.listFolder(DbxUserFilesRequests.java:2082) 
        at com.dropbox.core.v2.files.DbxUserFilesRequests.listFolder(DbxUserFilesRequests.java:2132) 
        at com.quirklogic.sdk.storage.dropbox.DropBoxFolder.lambda$list$0$DropBoxFolder(DropBoxFolder.java:109) 
        at com.quirklogic.sdk.storage.dropbox.DropBoxFolder$$Lambda$0.call(Unknown Source) 
        at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:44) 
        at io.reactivex.Single.subscribe(Single.java:3220) 
        at io.reactivex.internal.operators.single.SingleMap.subscribeActual(SingleMap.java:34) 
        at io.reactivex.Single.subscribe(Single.java:3220) 
        at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89) 
        at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:571) 
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) 
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:237) 

3 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    Based on the stack here, it looks like this is an issue reading data from the network. Do you know if there is any reason the network connection that the app is using may be getting disrupted? E.g., was the connection disconnected or interrupted, or might there be any software, such as a proxy, firewall, anti-virus, etc., that may be interfering? 

    If this is random network unreliability, you may want to implement some more error handling/retrying, as that can be unpredictable.

  • DannyW1's avatar
    DannyW1
    Explorer | Level 3
    6 years ago

    Thanks Greg.  Internet connection is fine.  The error does not happen everytime.  It is just random.  It usually happens when I do alot of file list and get a file and repeat that process.

    This happens on different devices too and on different wifi network.

     

    Is there a way to trap the crash?

    This is what i'm doing in RxJava2

     

                return Single.fromCallable(() -> DropBoxAuth.getInstance().getDbxClient().files().listFolder(query))
                        .map(result -> { ... }
    
    

    The crash is inside fromCallable().  Could it be RxJava?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    Can you elaborate on what you mean when you say you "do alot of file list"? How many API calls are you making at a time? If you're making a large number of calls, you may be overloading your system or network connection, in which case you should try reducing how many operations you run at a time, as that might be causing this.

    Anyway, yes, the Dropbox SDK throws a 'NetworkIOException' when this occurs, so you can `catch` that exception type to handle these failures.

    I can't provide insight or support for RxJava2 though, as that's made by a third party.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!