I/flutter (10204): HTTP/2 error: Stream error: Stream was terminated by peer (errorCode: 1).
Issue Info
| Info | Value | |
|---|---|---|
| Platform Name | flutter / ios / android | |
| Platform Version | 9.0 | |
| Dio Version | ^3.0.2 | |
| Android Studio | Android Studio 3.5 | |
| Repro rate | all the time (100%) | |
| Repro with our demo prj | no |
Issue Description and Steps
After adding:
Dio(BaseOptions(
responseType: ResponseType.json
))..httpClientAdapter = Http2Adapter(ConnectionManager())
Error in Console:
I/flutter (10204): HTTP/2 error: Stream error: Stream was terminated by peer (errorCode: 1).
I can confirm having this issue as well, I tried doing multiple HTTP requests to a different set of APIs with no avail :(
the stack trace is as follows:
ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: DioError [DioErrorType.DEFAULT]: HTTP/2 error: Stream error: Stream was terminated by peer (errorCode: 1).
E/flutter (14143): #0 DioMixin._dispatchRequest (package:dio/src/dio.dart:942:7)
E/flutter (14143): <asynchronous suspension>
E/flutter (14143): dart-lang/http#1342 DioMixin._request._interceptorWrapper.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:dio/src/dio.dart:828:37)
E/flutter (14143): dart-lang/http#1343 DioMixin.checkIfNeedEnqueue (package:dio/src/dio.dart:1099:22)
E/flutter (14143): dart-lang/http#1344 DioMixin._request._interceptorWrapper.<anonymous closure>.<anonymous closure> (package:dio/src/dio.dart:825:22)
E/flutter (14143): dart-lang/http#1345 new Future.<anonymous closure> (dart:async/future.dart:176:37)
E/flutter (14143): dart-lang/http#1346 _rootRun (dart:async/zone.dart:1120:38)
E/flutter (14143): dart-lang/http#1347 _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter (14143): dart-lang/http#1348 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
E/flutter (14143): dart-lang/http2#8 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
E/flutter (14143): dart-lang/http2#9 _rootRun (dart:async/zone.dart:1124:13)
E/flutter (14143): dart-lang/http2#10 _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter (14143): dart-lang/http2#11 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
E/flutter (14143): dart-lang/http2#12 Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:21:15)
E/flutter (14143): dart-lang/http2#13 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)
E/flutter (14143): dart-lang/http#1349 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
E/flutter (14143): dart-lang/http2#15 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
It seems to be an issue when using uppercase in the headers. See https://github.com/dart-lang/http/issues/1361
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.
Same here.
Same here.
it is still an issue that needs to be solved
Same here
same here
it's still an issue
fix with lower case on headers. thanks to @cirediew
It seems to be an issue when using uppercase in the headers. See dart-lang/http#1361
I have the same issue. Tried making headers all lower case, didn't work though. I can narrow the error down to using pseudo headers such as:
{
':authority': 'www.google.com',
':method': 'GET',
':path': '/',
':scheme': 'https'
}
same here. any updates ?
issue is still happning
Still an issue