Skip to content

RPCError: _createDevFS: (-32603) Internal error _createDevFS: Unexpected exception:PathNotFoundException: Creation of temporary directory failed #148115

Closed

Description

@KaneForYu

Steps to reproduce

1.open project with vscode
2.'flutter run' with vscode terminal

Expected results

i hope vscdoe running app and Hot refresh

Actual results

app is running ,but vscode terminal report crash

Code sample

Code sample
Details

Logs

Flutter crash report.
Please report a bug at https://github.com/flutter/flutter/issues.

command

flutter run --no-enable-impeller

exception

RPCError: _createDevFS: (-32603) Internal error
_createDevFS: Unexpected exception:PathNotFoundException: Creation of temporary directory failed, path = '~/Library/Developer/CoreSimulator/Devices/9C4C4804-B47D-4414-B71F-032FD83825F3/data/Containers/Data/Application/9A51BEFB-A515-4E88-A179-C0CE82A6D6B7/tmp' (OS Error: No such file or directory, errno = 2)
#0      _checkForErrorResponse (dart:io/common.dart:55:9)
#1      _Directory.createTemp.<anonymous closure> (dart:io/directory_impl.dart:152:7)
<asynchronous suspension>
#2      createTempDirCallback (dart:vmservice_io:190:16)
<asynchronous suspension>
#3      DevFS._createDevFS (dart:_vmservice/devfs.dart:182:21)
<asynchronous suspension>
#4      VMService._routeRequestImpl (dart:_vmservice:811:16)
<asynchronous suspension>
#5      VMService.routeRequest (dart:_vmservice:774:22)
<asynchronous suspension>
#0      new _OutstandingRequest (package:vm_service/src/vm_service.dart:1928:45)
#1      VmService._call (package:vm_service/src/vm_service.dart:2493:21)
#2      VmService.callServiceExtension (package:vm_service/src/vm_service.dart:2464:14)
#3      FlutterVmService.createDevFS (package:flutter_tools/src/vmservice.dart:1133:20)
#4      DevFS.create (package:flutter_tools/src/devfs.dart:516:61)
#5      FlutterDevice.setupDevFS (package:flutter_tools/src/resident_runner.dart:393:19)
#6      HotRunner._initDevFS (package:flutter_tools/src/run_hot.dart:449:23)
#7      HotRunner.attach (package:flutter_tools/src/run_hot.dart:266:41)
<asynchronous suspension>
#8      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:753:27)
<asynchronous suspension>
#9      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1297:27)
<asynchronous suspension>
#10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#11     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#12     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:339:9)
<asynchronous suspension>
#13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#14     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:285:5)
<asynchronous suspension>
#15     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:115:9)
<asynchronous suspension>
#16     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#17     main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>

flutter doctor

�[32m[✓]�[39m Flutter (Channel stable, 3.13.9, on macOS 14.2 23C64 darwin-arm64, locale zh-Hans-CN)
    �[32m•�[39m Flutter version 3.13.9 on channel stable at ~/Documents/sdk/flutter
    �[32m•�[39m Upstream repository https://github.com/flutter/flutter.git
    �[32m•�[39m Framework revision d211f42860 (7 months ago), 2023-10-25 13:42:25 -0700
    �[32m•�[39m Engine revision 0545f8705d
    �[32m•�[39m Dart version 3.1.5
    �[32m•�[39m DevTools version 2.25.0
    �[32m•�[39m Pub download mirror https://pub.flutter-io.cn
    �[32m•�[39m Flutter download mirror https://storage.flutter-io.cn

�[32m[✓]�[39m Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    �[32m•�[39m Android SDK at ~/Library/Android/sdk
    �[32m•�[39m Platform android-34-ext11, build-tools 34.0.0
    �[32m•�[39m ANDROID_HOME = ~/Library/Android/sdk
    �[32m•�[39m Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    �[32m•�[39m Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    �[32m•�[39m All Android licenses accepted.

�[32m[✓]�[39m Xcode - develop for iOS and macOS (Xcode 15.3)
    �[32m•�[39m Xcode at /Applications/Xcode.app/Contents/Developer
    �[32m•�[39m Build 15E204a
    �[32m•�[39m CocoaPods version 1.15.0

�[32m[✓]�[39m Chrome - develop for the web
    �[32m•�[39m Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

�[32m[✓]�[39m Android Studio (version 2023.3)
    �[32m•�[39m Android Studio at /Applications/Android Studio.app/Contents
    �[32m•�[39m Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    �[32m•�[39m Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    �[32m•�[39m Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

�[32m[✓]�[39m VS Code (version 1.89.0)
    �[32m•�[39m VS Code at ~/Downloads/Visual Studio Code.app/Contents
    �[32m•�[39m Flutter extension version 3.88.0

�[32m[✓]�[39m Connected device (3 available)
    �[32m•�[39m iPhone 15 Pro Max (mobile) • 9C4C4804-B47D-4414-B71F-032FD83825F3 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-4
      (simulator)
    �[32m•�[39m macOS (desktop)            • macos                                • darwin-arm64   • macOS 14.2 23C64 darwin-arm64
    �[32m•�[39m Chrome (web)               • chrome                               • web-javascript • Google Chrome 124.0.6367.156

�[32m[✓]�[39m Network resources
    �[32m•�[39m All expected network resources are available.

�[32m•�[39m No issues found!

Flutter Doctor output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.9, on macOS 14.2 23C64 darwin-arm64, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.89.0)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

Activity

  1. added
    in triage
    on May 10, 2024
  2. huycozy commented on May 10, 2024

    @huycozy
    Member

    Hi @KaneForYu
    Do you see this issue every time running project or just once? If it's every time, could you check if it occurs on a new Flutter project or only on your project?

  3. added
    waiting for response
    on May 10, 2024
  4. KaneForYu commented on May 11, 2024

    @KaneForYu
    Author

    hi @huycozy This issue occurred when I upgraded my project from flutter3.0.0 to flutter3.0.03.13.9, but it won't occur when I build a new test project.

  5. removed
    waiting for response
    on May 11, 2024
  6. huycozy commented on May 12, 2024

    @huycozy
    Member

    Thanks for checking it on a new project. To confirm the steps, did the crash occur when you triggered hot reload/hot restart or just run project? Does the crash disappear or persist on your project?

    #0 new _OutstandingRequest (package:vm_service/src/vm_service.dart:1928:45)

    I checked this LOC in vm_service.dart#L1775-L1782:

    final request = _OutstandingRequest<T>(method);
    _outstandingRequests[request.id] = request;
    Map m = {
      'jsonrpc': '2.0',
      'id': request.id,
      'method': method,
      'params': args,
    };

    And also the error code at vm_service.dart#L1938-L1939:

      /// Internal JSON-RPC error.
      kInternalError(code: -32603, message: 'Internal JSON-RPC error')

    It could be version change issue (jsonrpc?). So if you see the issue persists on the latest Flutter stable channel 3.19.6, please share the new stack trace.

  7. added
    waiting for response
    on May 12, 2024
  8. jixiaoyong commented on May 17, 2024

    @jixiaoyong

    Hello, I also ran into a similar problem today when I tried run project.

    NSApplicationDelegate.applicationSupportsSecureRestorableState:.
    Finished with error: _createDevFS: (-32603) Internal error
    _createDevFS: Unexpected exception:PathNotFoundException: Creation of temporary directory failed, path = '/Users/username/Library/Containers/io.github.username.appname/Data/tmp' (OS Error: No such file or directory, errno = 2)
    

    After manually creating the missing directory (tmp) it runs successfully again.

    Here are the details:

    • I am running a flutter project on MacOS 14.5
    • This project has run succeeded before
    • Part of the directory exists, only the tmp directory is missing. Some information about the directory:
      drwx------@ 4 username staff 128 May 17 16:17 /Users/username/Library/Containers/io.github.username.appname
    • The xxx.app has been created after this PathNotFoundException was thrown and can run as expected if I manually open it
    • This happened on both flutter 3.16.8 and 3.22.0
    • After I created tmp, and tried to run the project again, the project ran successfully and created some directories like this(cloud_clipboard is my app name):
    └── tmp
        └── cloud_clipboardcr8cI6
            └── cloud_clipboard
    
    • Once I delete the tmp directory, this exception happens again. After deleting the entire directory /Users/username/Library/Containers/io.github.username.appname and trying to run the project, it ran successfully.

    Hope this information can help you in some way.

    Here is the full log when I try to run my project:

    Launching lib/main.dart on macOS in debug mode...
    Building macOS application...
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:macOS, arch:arm64, id:000xxxxx-000xxxxxxxxxxxxx, name:My Mac }
    { platform:macOS, arch:x86_64, id:000xxxxx-000xxxxxxxxxxxx, name:My Mac }
    ✓ Built build/macos/Build/Products/Debug/cloud_clipboard.app
    [IMPORTANT:flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalSkia.mm(66)] Using the Skia rendering backend (Metal).
    2024-05-17 16:12:40.616 cloud_clipboard[13920:3521729] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
    Finished with error: _createDevFS: (-32603) Internal error
    _createDevFS: Unexpected exception:PathNotFoundException: Creation of temporary directory failed, path = '/Users/username/Library/Containers/io.github.username.appname/Data/tmp' (OS Error: No such file or directory, errno = 2)
    #0      _checkForErrorResponse (dart:io/common.dart:55:9)
    #1      _Directory.createTemp.<anonymous closure> (dart:io/directory_impl.dart:147:7)
    <asynchronous suspension>
    #2      createTempDirCallback (dart:vmservice_io:202:16)
    <asynchronous suspension>
    #3      DevFS._createDevFS (dart:_vmservice/devfs.dart:182:21)
    <asynchronous suspension>
    #4      VMService._routeRequestImpl (dart:_vmservice:811:16)
    <asynchronous suspension>
    #5      VMService.routeRequest (dart:_vmservice:774:22)
    <asynchronous suspension>
    #6      WebSocketClient.post (dart:vmservice_io/vmservice_server.dart:64:3)
    <asynchronous suspension>
    
    the Dart compiler exited unexpectedly.
    Lost connection to device.
    
    

    flutter doctor:

    % flutter doctor                                                                                                                                                                                 
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 3.22.0, on macOS 14.5 23F79 darwin-arm64, locale en-US)
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    [✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    [✓] Chrome - develop for the web
    [✓] IntelliJ IDEA Community Edition (version 2024.1.1)
    [✓] VS Code (version 1.89.1)
    [✓] Connected device (3 available)
    [✓] Network resources
    
    ! Doctor found issues in 1 category.
    
  9. github-actions commented on Jun 2, 2024

    @github-actions

    Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
    If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
    Thanks for your contribution.

  10. github-actions commented on Jun 16, 2024

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

  11. locked as resolved and limited conversation to collaborators on Jun 16, 2024
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

    in triagewaiting for response

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions