Repository navigation
If downloading dart sdk fails, cache is left in a bad state: FileSystemException: Cannot open file, path = '.../flutter/bin/cache/dart-sdk/version' #15552
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consoleteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.Issues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
Get a new flutter version, run flutter, ctrl-c as soon as Downloading Dart SDK from Flutter engine xxxx... appears.
I ended up in a state where
Building flutter tool...
Unhandled exception:
FileSystemException: Cannot open file, path = '.../flutter/bin/cache/dart-sdk/version' (OS Error: No such file or directory, errno = 2)
#0 _File.throwIfError (dart:io/file_impl.dart:628)
#1 _File.openSync (dart:io/file_impl.dart:472)
#2 _File.readAsBytesSync (dart:io/file_impl.dart:532)
#3 _File.readAsStringSync (dart:io/file_impl.dart:577)
#4 readTextFile (package:pub/src/io.dart:153)
#5 _getVersion (package:pub/src/sdk.dart:44)
#6 version (package:pub/src/sdk.dart:32)
#7 version (package:pub/src/sdk.dart:32)
#8 PubCommandRunner.runCommand (package:pub/src/command_runner.dart:159)
<asynchronous suspension>
#9 PubCommandRunner.run (package:pub/src/command_runner.dart:116)
<asynchronous suspension>
#10 main (file:///b/build/slave/Mac_Engine/build/src/third_party/dart/third_party/pkg/pub/bin/pub.dart:8)
#11 _startIsolate.<anonymous closure> (dart:isolate-patch/dart:isolate/isolate_patch.dart:277)
#12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)
Error: Unable to pub upgrade flutter tool. Retrying in five seconds...
Unhandled exception:
FileSystemException: Cannot open file, path = '.../flutter/bin/cache/dart-sdk/version' (OS Error: No such file or directory, errno = 2)
#0 _File.throwIfError (dart:io/file_impl.dart:628)
#1 _File.openSync (dart:io/file_impl.dart:472)
#2 _File.readAsBytesSync (dart:io/file_impl.dart:532)
#3 _File.readAsStringSync (dart:io/file_impl.dart:577)
#4 readTextFile (package:pub/src/io.dart:153)
#5 _getVersion (package:pub/src/sdk.dart:44)
#6 version (package:pub/src/sdk.dart:32)
#7 version (package:pub/src/sdk.dart:32)
#8 PubCommandRunner.runCommand (package:pub/src/command_runner.dart:159)
<asynchronous suspension>
#9 PubCommandRunner.run (package:pub/src/command_runner.dart:116)
<asynchronous suspension>
#10 main (file:///b/build/slave/Mac_Engine/build/src/third_party/dart/third_party/pkg/pub/bin/pub.dart:8)
#11 _startIsolate.<anonymous closure> (dart:isolate-patch/dart:isolate/isolate_patch.dart:277)
#12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)
Error: Unable to pub upgrade flutter tool. Retrying in five seconds...
permanently until I rm -rf bin/cache
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consoleteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.Issues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Activity
adammendoza commentedon May 8, 2018
Same here. Any fix?
jonahwilliams commentedon Jun 25, 2019
Perhaps we could download the dart sdk to temp and only copy it to bin cache once it is done
xster commentedon Jun 26, 2019
Sure, seems reasonable.
[-]FileSystemException: Cannot open file, path = '.../flutter/bin/cache/dart-sdk/version'[/-][+]If downloading dart sdk fails, cache is left in a bad state: FileSystemException: Cannot open file, path = '.../flutter/bin/cache/dart-sdk/version'[/+]altafkhan8719 commentedon Apr 1, 2021
Same here. Any fix?
Codered81 commentedon Apr 10, 2021
I was able to resolve this issue by copying the 'version' file from the parent directory to this directory.
tools: Extract Dart SDK to temp directory before moving to final loca…
github-actions commentedon Sep 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.