Repository navigation
Description
Summary
In Flutter 3.47.5 (7 days post-release), SessionNotCreatedException at parseW3cResponse (package:webdriver/src/handler/w3c/utils.dart-9abe6b17) is the #6 tool crasher, accounting for 112 crashes (7.3% of Top 10 crashes, 3.7% of all crashes) during flutter drive.
Stack Trace & Error Message
SessionNotCreatedException (500): session not created: DevToolsActivePort file doesn't exist
(Also observed with Safari WebDriver timeouts: SessionNotCreatedException (500): Could not create a session: The session timed out while connecting to a Safari instance.)
#0 parseW3cResponse (package:webdriver/src/handler/w3c/utils.dart:81)
#1 W3cSessionHandler.parseCreateResponse (package:webdriver/src/handler/w3c/session.dart:19)
#2 InferSessionHandler.parseCreateResponse (package:webdriver/src/handler/infer_handler.dart:106)
#3 AsyncRequestClient.send (package:webdriver/src/common/request_client.dart:96)
<asynchronous suspension>
#4 createDriver (package:webdriver/async_core.dart:62)
<asynchronous suspension>
#5 WebDriverService.startTest (package:flutter_tools/src/drive/web_driver_service.dart:200)
<asynchronous suspension>
#6 DriveCommand.runCommand (package:flutter_tools/src/commands/drive.dart:387)
Root Cause Analysis
In WebDriverService.startTest (packages/flutter_tools/lib/src/drive/web_driver_service.dart:199-219), async_io.createDriver(...) only catches SocketException:
try {
webDriver = await async_io.createDriver(
uri: Uri.parse('http://localhost:$driverPort/'),
desired: getDesiredCapabilities(...),
);
} on SocketException catch (error) {
_logger.printTrace('$error');
throwToolExit(
'Unable to start a WebDriver session for web testing.\n'
'Make sure you have the correct WebDriver server (e.g. chromedriver) running at $driverPort.\n'
'For instructions on how to obtain and run a WebDriver server, see:\n'
'https://flutter.dev/to/integration-test-on-web\n',
);
}When the WebDriver server (chromedriver, safaridriver, geckodriver) is reachable over TCP but fails to launch or connect to the browser instance (e.g., Chrome crashes on launch without --no-sandbox / DevToolsActivePort file doesn't exist, browser/driver version mismatch, or Safari automation session timeout), package:webdriver throws WebDriverException (SessionNotCreatedException), which escapes uncaught as a tool crash.
Expected Behavior
WebDriverService.startTest should catch async_io.WebDriverException (or SessionNotCreatedException) and call throwToolExit with the underlying WebDriver error message rather than crashing flutter_tools.
Related Issues & PRs
- Prior closed/locked issues: [tool_crash] SessionNotCreatedException #185032, [tool_crash] SessionNotCreatedException #183363, [tool_crash] SessionNotCreatedException #177981, [tool_crash] SessionNotCreatedException #174195, SessionNotCreatedException thrown from
flutter drivecommand #169006, [web:tests] safaridriver intermittently fails to create a WebDriver session #163790
Activity
Exit cleanly when the WebDriver server cannot create a session
[flutter_tools] Exit cleanly when the WebDriver server cannot create …
[flutter_tools] Exit cleanly when the WebDriver server cannot create …
[flutter_tools] Exit cleanly when the WebDriver server cannot create …
github-actions commentedon Nov 4, 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.