You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[flutter_tools] Unhandled String exception when VM service connection closes before HTTP header completion (HttpException) #191178
In Flutter 3.47.0 telemetry, an unhandled String exception during VM Service connection establishment emerged as a top crash signature.
During application launch or debugger attach, if the remote socket resets before HTTP headers are received, dart:io throws HttpException. The connection error was formatted as a raw String and passed to Completer.completeError(), which bypassed on Exception catch blocks in callers and crashed the tool.
Telemetry Profile
Release: Flutter 3.47.0 (Top 10 crasher)
Signature: String-3df63b7a
Error Output
String: failed to connect to http://127.0.0.1:63745/TjwUKCgX5S8=/ HttpException: Connection closed before full header was received, uri = http://127.0.0.1:63745/TjwUKCgX5S8=/ws
Root Cause
In packages/flutter_tools/lib/src/vmservice.dart, _defaultOpenChannel only caught WebSocketException and SocketException for retries, omitting io.HttpException. Transient socket resets during handshake failed immediately without retries.
In packages/flutter_tools/lib/src/resident_runner.dart (FlutterDevice.connect), connection failures were passed to completer.completeError('failed to connect to $vmServiceUri $e', st) as a raw String.
Callers (ColdRunner, HotRunner) use on Exception catch (...), which does not catch String, allowing the error to propagate unhandled to the top level.
Proposed Fix
Add on io.HttpException to _defaultOpenChannel retry loop in vmservice.dart.
Complete error completers in FlutterDevice.connect with typed Exception objects instead of String.
Track isConnecting and error state on stream closure in ResidentRunner.connect.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[flutter_tools] Handle HttpException during VM service connection
[flutter_tools] Handle HttpException during VM service connection (fl…
[stable] [flutter_tools] Handle HttpException during VM service conne…
github-actions commentedon Sep 2, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.