dio icon indicating copy to clipboard operation
dio copied to clipboard

I/flutter (10204): HTTP/2 error: Stream error: Stream was terminated by peer (errorCode: 1).

Open iamriajul opened this issue 7 years ago • 14 comments

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).

iamriajul avatar Sep 29 '19 17:09 iamriajul

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)

ellie-me avatar Oct 14 '19 20:10 ellie-me

It seems to be an issue when using uppercase in the headers. See https://github.com/dart-lang/http/issues/1361

cirediew avatar Oct 18 '19 09:10 cirediew

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[bot] avatar Nov 17 '19 10:11 stale[bot]

Same here.

JCKodel avatar Mar 26 '20 03:03 JCKodel

Same here.

virskor avatar Apr 12 '20 14:04 virskor

it is still an issue that needs to be solved

ellie-me avatar Apr 21 '20 16:04 ellie-me

Same here

kitmoovup avatar Jul 23 '20 06:07 kitmoovup

same here

xellDart avatar Aug 20 '20 21:08 xellDart

it's still an issue

FrantisekGazo avatar Oct 14 '20 07:10 FrantisekGazo

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

pcqpcq avatar Feb 01 '21 08:02 pcqpcq

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'
}

johannespn avatar Feb 05 '21 13:02 johannespn

same here. any updates ?

andrew-ares avatar May 29 '21 08:05 andrew-ares

issue is still happning

mouryaavadhesh avatar Feb 22 '22 11:02 mouryaavadhesh

Still an issue

xrr2016 avatar Mar 04 '22 05:03 xrr2016