filestack / filestack-java

Official Java SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://filestack.com
Apache License 2.0
18 stars 18 forks source link

It has crash sometimes when uploading files #62

Closed youngliangzhang closed 5 years ago

youngliangzhang commented 6 years ago

Here is the log: io.reactivex.exceptions.UndeliverableException: java.io.IOException at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:349) at io.reactivex.internal.operators.flowable.FlowableCreate$BaseEmitter.onError(FlowableCreate.java:271) at io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual(FlowableCreate.java:75) at io.reactivex.Flowable.subscribe(Flowable.java:13041) at io.reactivex.Flowable.subscribe(Flowable.java:12987) at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run(FlowableSubscribeOn.java:82) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764) Caused by: java.io.IOException at com.filestack.internal.Upload.reduceChunkSize(Upload.java:113) at com.filestack.internal.UploadTransferFunc$2.onNetworkFail(UploadTransferFunc.java:108) at com.filestack.internal.RetryNetworkFunc.run(RetryNetworkFunc.java:53) at com.filestack.internal.RetryNetworkFunc.call(RetryNetworkFunc.java:36) at com.filestack.internal.UploadTransferFunc.uploadToS3(UploadTransferFunc.java:124) at com.filestack.internal.UploadTransferFunc.subscribe(UploadTransferFunc.java:41) at io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual(FlowableCreate.java:72) at io.reactivex.Flowable.subscribe(Flowable.java:13041) at io.reactivex.Flowable.subscribe(Flowable.java:12987) at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run(FlowableSubscribeOn.java:82) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)

shawnmaten commented 6 years ago

That stacktrace is a bit confusing but I'm seeing:

Caused by: java.io.IOException
at com.filestack.internal.Upload.reduceChunkSize(Upload.java:113)

So you're running an "intelligent" upload and it's finally throwing an exception once it's reduced the part size past the minimum allowed for "intelligent" uploads. What kind of internet connection are you running this on when it throws the exception?

youngliangzhang commented 6 years ago

I am not sure for internet connection because I got this log from Crash report service. This issue was happened on user's device.

shawnmaten commented 6 years ago

The code is intended to throw an exception if uploading a part of the smallest size fails over 5 times. So if that's what's happening for this user, then it's working as intended, and you should handle the exception. If you can reproduce the exception in conditions where it doesn't seem reasonable to fail this way, then maybe there's a bug in the upload code. It's possible there's a bug in the upload code, but with this info, I assume the user is just experiencing a bad or unavailable network connection.

shawnmaten commented 6 years ago

And by "bad network connection" I mean the connection is so bad we can't complete 32 KiB uploads.

youngliangzhang commented 6 years ago

I see. Thanks for your information

scana commented 5 years ago

Errors like this one will be replaced with ones that have more meaningful names in 1.0.0 release. Closing for now.