dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.09k stars 1.56k forks source link

Exception from analysis server (running from VSCode / Dart Code), FileSystemException: Directory watcher closed unexpectedly #38853

Closed escamoteur closed 4 years ago

escamoteur commented 4 years ago

What I was doing

Just loaded a new project, jumped via F12 into vector2.dart and was navigating there through code by F12 and Alt + <- ->

Versions

Analyzer Info

The analyzer was launched using the arguments:

C:\Entwicklung\flutter\bin\cache\dart-sdk\bin\snapshots\analysis_server.dart.snapshot
--client-id=Dart-Code.dart-code
--client-version=3.5.1
--enable-completion-model

Exception (fatal)

Failed to handle request: {id: 6, method: analysis.setAnalysisRoots, params: {excluded: [], included: [C:\Entwicklung\projects\Aaronia\trunk\Sources\RTSAMobileDev\aartos, C:\Entwicklung\projects\Aaronia\trunk\Sources\RTSAMobileDev\packages\rtsa_map]}, clientRequestTime: 1570888657966}

FileSystemException: Directory watcher closed unexpectedly, path = 'C:\Entwicklung\projects\Aaronia\trunk\Sources\RTSAMobileDev\aartos'
#0      _FileSystemWatcher._listenOnSocket.<anonymous closure> (dart:io-patch/file_patch.dart:307:11)
#1      _ExpandStream._handleData (dart:async/stream_pipe.dart:248:23)
#2      _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:164:13)
#3      _rootRunUnary (dart:async/zone.dart:1136:13)
#4      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#5      _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#6      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#7      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#8      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:764:19)
#9      _StreamController._add (dart:async/stream_controller.dart:640:7)
#10     _StreamController.add (dart:async/stream_controller.dart:586:5)
#11     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1384:35)
#12     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:890:18)
#13     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#14     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#15     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#16     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)

Diagnostics requested after the error occurred are:

[
    {
        "name": "C:\\Entwicklung\\projects\\Aaronia\\trunk\\Sources\\RTSAMobileDev\\packages\\rtsa_map\\example\\rtsa_map_test",
        "explicitFileCount": 1,
        "implicitFileCount": 778,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "C:\\Entwicklung\\projects\\Aaronia\\trunk\\Sources\\RTSAMobileDev\\packages\\rtsa_map",
        "explicitFileCount": 21,
        "implicitFileCount": 757,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "C:\\Entwicklung\\projects\\Aaronia\\trunk\\Sources\\RTSAMobileDev\\aartos",
        "explicitFileCount": 61,
        "implicitFileCount": 2214,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    }
]
devoncarew commented 4 years ago

Possible related to https://github.com/dart-lang/sdk/issues/37233.

keertip commented 4 years ago

@stereotype441, could you take a look at this and see if there needs to be changes made to the analyzer. Seeing quite a few reports with this exception in bleeding edge.

srawlins commented 4 years ago

Reported as recently as Dart 2.6.1.

MichaelRFairhurst commented 4 years ago

This was fixed in https://github.com/dart-lang/watcher/pull/75 plus https://dart-review.googlesource.com/c/sdk/+/125765

I am closing, but if we see this occur again with a newer SDK we can reopen.

a-siva commented 4 years ago

@MichaelRFairhurst apparently this issue was seen again with Dart 2.7.0 so I am reopening this issue for investigation.

MichaelRFairhurst commented 4 years ago

Closing, none of those 2.7 versions include the fix.

a-siva commented 4 years ago

@MichaelRFairhurst can you indicate which version of the Dart SDK has the fix, if none of the 2.7 versions has a fix maybe we need to cherry pick this fix and make a release.

RB-93 commented 2 years ago

The same issue occurs in Dart SDK 2.17.3.

Socket error: FileSystemException: Directory watcher closed unexpectedly

Flutter Doctor output: flutter doctor -v [√] Flutter (Channel stable, 3.0.2, on Microsoft Windows [Version 10.0.19044.1706], locale en-IN) • Flutter version 3.0.2 at C:\Users\rohit\Documents\Flutter SDK\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision cd41fdd495 (9 days ago), 2022-06-08 09:52:13 -0700 • Engine revision f15f824b57 • Dart version 2.17.3
• DevTools version 2.12.2

Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at C:\Users\rohit\AppData\Local\Android\sdk • Platform android-32, build-tools 31.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) • All Android licenses accepted.

[√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.15) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools • Visual Studio Build Tools 2019 version 16.11.32510.428 • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] VS Code (version 1.68.0) • VS Code at C:\Users\rohit\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.42.0

[√] Connected device (4 available) • Moto Z2 Play (mobile) • 192.168.29.253:5555 • android-arm • Android 8.0.0 (API 26) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.1706] • Chrome (web) • chrome • web-javascript • Google Chrome 102.0.5005.63 • Edge (web) • edge • web-javascript • Microsoft Edge 102.0.1245.41

[√] HTTP Host Availability • All required HTTP hosts are available

• No issues found!

vssocketerror

devoncarew commented 2 years ago

@RB-93 - can you file a new issue? What you're seeing is almost certainly a different problem - this was closed several years ago. Thanks!