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

网络正常情况下DioError [DioErrorType.RECEIVE_TIMEOUT] #575

Closed
1 task
ShshyDevooo opened this issue Nov 25, 2019 · 3 comments
Closed
1 task

网络正常情况下DioError [DioErrorType.RECEIVE_TIMEOUT] #575

ShshyDevooo opened this issue Nov 25, 2019 · 3 comments

Comments

@ShshyDevooo
Copy link

New Issue Checklist

  • I have searched for a similar issue in the project and found none

Issue Info

Info Value
Platform Name ios
Platform Version e.g. 1.5.0 / 12.0 / 9.0
Dio Version 3.0.6
Android Studio / Xcode Version e.g. Android Studio 3.3.2 / Xcode 10.2.1
Repro rate e.g. all the time (100%) / sometimes x% / only once
Repro with our demo prj
Demo project link

Issue Description and Steps

正常网络情况下下载文件。服务器正常响应,并返回数据。dio能够正常请求,但是会马上抛出DioErrorType.RECEIVE_TIMEOUT异常。下面是请求日志和抓包截图

'2019-11-25 11:05:41.029721+0800 Runner[2127:1361742] flutter: *** Request ***
2019-11-25 11:05:41.030279+0800 Runner[2127:1361742] flutter: uri: http://serverpathbalabala
2019-11-25 11:05:41.030376+0800 Runner[2127:1361742] flutter: method: GET
2019-11-25 11:05:41.030636+0800 Runner[2127:1361742] flutter: responseType: ResponseType.stream
2019-11-25 11:05:41.030923+0800 Runner[2127:1361742] flutter: followRedirects: true
2019-11-25 11:05:41.031154+0800 Runner[2127:1361742] flutter: connectTimeout: 5000
2019-11-25 11:05:41.031387+0800 Runner[2127:1361742] flutter: receiveTimeout: 20000
2019-11-25 11:05:41.031766+0800 Runner[2127:1361742] flutter: extra: {}
2019-11-25 11:05:41.032036+0800 Runner[2127:1361742] flutter: headers:
2019-11-25 11:05:41.032296+0800 Runner[2127:1361742] flutter: content-type: application/json; charset=utf-8
2019-11-25 11:05:41.034007+0800 Runner[2127:1361742] flutter: DeviceType: Iphone6
2019-11-25 11:05:41.035334+0800 Runner[2127:1361742] flutter:
2019-11-25 11:05:41.341540+0800 Runner[2127:1361742] flutter: *** Response ***
2019-11-25 11:05:41.341915+0800 Runner[2127:1361742] flutter: uri: http://192.168.6.229:8080/telemedicine-server/file/security/visit/3144462
2019-11-25 11:05:41.342109+0800 Runner[2127:1361742] flutter: statusCode: 200
2019-11-25 11:05:41.342300+0800 Runner[2127:1361742] flutter: headers:
2019-11-25 11:05:41.342476+0800 Runner[2127:1361742] flutter: connection: close
2019-11-25 11:05:41.342815+0800 Runner[2127:1361742] flutter: content-type: application/octet-stream;charset=UTF-8
2019-11-25 11:05:41.343135+0800 Runner[2127:1361742] flutter: date: Mon, 25 Nov 2019 03:05:40 GMT
2019-11-25 11:05:41.343418+0800 Runner[2127:1361742] flutter: transfer-encoding: chunked
2019-11-25 11:05:41.343491+0800 Runner[2127:1361742] flutter: server: Apache-Coyote/1.1
2019-11-25 11:05:41.343771+0800 Runner[2127:1361742] flutter: Response Text:
2019-11-25 11:05:41.344359+0800 Runner[2127:1361742] flutter: Instance of 'ResponseBody'
2019-11-25 11:05:41.344410+0800 Runner[2127:1361742] flutter:
2019-11-25 11:05:41.377176+0800 Runner[2127:1361742] flutter: download file:2220/-1
2019-11-25 11:05:41.492829+0800 Runner[2127:1361742] [VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: DioError [DioErrorType.RECEIVE_TIMEOUT]: Receiving data timeout[20000ms]
#0 DioForNative.download. (package:dio/src/entry/dio_for_native.dart:211:9)

#1 _rootRunUnary (dart:async/zone.dart:1132:38)
#2 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#3 _FutureListener.handleError (dart:async/future_impl.dart:155:20)
#4 Future._propagateToListeners.handleError (dart:async/future_impl.dart:690:47)
#5 Future._propagateToListeners (dart:async/future_impl.dart:711:24)
#6 Future._completeError (dart:async/future_impl.dart:530:5)
#7 Future.timeout. (dart:async/future_impl.dart:781:16)
#8 _rootRunBinary (dart:async/zone.dart:1144:38)
#9 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#10 _FutureListener.handleError (dart:async/future_impl.dart:151:20)
#11 Future._propagateToListeners.handleError (dart:async/future_impl.dart:690:47)
#12 Future._propagateToListeners (dart:async/future_impl.dart:711:24)
#13 Future._completeError (dart:async/future_impl.dart:530:5)
#14 Future._asyncCompleteError. (dart:async/future_impl.dart:578:7)
#15 _rootRun (dart:async/zone.dart:1124:13)
#16 _CustomZone.run (dart:async/zone.dart:1021:19)
#17 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#18 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:963:23)
#19 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#20 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)'
TIM截图20191125112040

@stale
Copy link

stale bot commented Dec 25, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

@stale stale bot added the stale label Dec 25, 2019
@stale stale bot closed this as completed Jan 1, 2020
@technolion
Copy link

I can also reproduce this issue. It seems to be the case that downloading works, but after the defined receive timeout is reached the timeout exception is thrown.
I am also using transfer-encoding: chunked on the server.

@Calvin2274
Copy link

Same here. suddenly happened

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

3 participants