Skip to content

If downloading dart sdk fails, cache is left in a bad state: FileSystemException: Cannot open file, path = '.../flutter/bin/cache/dart-sdk/version' #15552

Closed

Description

@xster

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

Activity

  1. added
    c: crashStack traces logged to the console
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Mar 15, 2018
  2. adammendoza commented on May 8, 2018

    @adammendoza

    Same here. Any fix?

  3. added this to the milestone on Jan 18, 2019
  4. jonahwilliams commented on Jun 25, 2019

    @jonahwilliams
    Contributor

    Perhaps we could download the dart sdk to temp and only copy it to bin cache once it is done

  5. xster commented on Jun 26, 2019

    @xster
    MemberAuthor

    Sure, seems reasonable.

  6. changed the title [-]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'[/+] on Jan 24, 2020
  7. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  8. removed this from the milestone on Aug 17, 2020
  9. altafkhan8719 commented on Apr 1, 2021

    @altafkhan8719

    Same here. Any fix?

  10. Codered81 commented on Apr 10, 2021

    @Codered81

    I was able to resolve this issue by copying the 'version' file from the parent directory to this directory.

  11. added
    tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.
    on Jun 30, 2025
  12. github-actions commented on Sep 4, 2026

    @github-actions

    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.

  13. locked as resolved and limited conversation to collaborators on Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consoleteam-toolOwned by Flutter Tool teamtoolAffects 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.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions