New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileSystemException: Directory watcher closed unexpectedly #3150
Comments
We can't unfortunately do much about this error - if you are seeing it regularly you can try using the |
@jakemac53 |
We are just handling an exception from your file system so it is a bit hard to say exactly what the issue is, but you may have ran out of file handles or something like that. It is possible that rebooting your computer could fix it also... maybe some rogue process somewhere is hogging a lot of file handles. |
Thank you very much for the feedback, I will check your suggestions |
Actually thinking more on this... @annagrin did we just release a webdev version that allows for higher parallelism when serving files? Maybe that is what is causing you to run out of file handles. |
@insinfo I think that change was specific to the mode that webdev uses for build_runner, could you try running normal standalone build_runner: |
@jakemac53 I took the test several times. As can be seen in the log, the error only occurs the second time. PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 856ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 457ms
[INFO] Caching finalized dependency graph completed, took 553ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[INFO] Deleting previous outputs in `build` completed, took 22ms
[INFO] Creating merged output dir `build` completed, took 781ms
[INFO] Succeeded after 4.3s with 0 outputs (0 actions)
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 932ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 438ms
[INFO] Caching finalized dependency graph completed, took 533ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[INFO] Deleting previous outputs in `build` completed, took 205ms
[SEVERE]
[SEVERE] You have hit a bug in build_runner
[SEVERE] Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
[SEVERE]
[SEVERE]
[SEVERE] FileSystemException: Directory watcher closed unexpectedly, path = 'd:\mydartprojects\cmpop\cmpop_browser'
[SEVERE] dart:isolate _RawReceivePortImpl._handleMessage
[SEVERE]
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 753ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 424ms
[INFO] Caching finalized dependency graph completed, took 543ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[INFO] Deleting previous outputs in `build` completed, took 21ms
[INFO] Creating merged output dir `build` completed, took 725ms
[INFO] Writing asset manifest completed, took 6ms
[INFO] Succeeded after 4.2s with 0 outputs (0 actions)
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 738ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 436ms
[INFO] Caching finalized dependency graph completed, took 555ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[SEVERE]
[SEVERE]
[SEVERE] You have hit a bug in build_runner
[SEVERE] Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
[SEVERE]
[SEVERE]
[SEVERE] FileSystemException: Directory watcher closed unexpectedly, path = 'd:\mydartprojects\cmpop\cmpop_browser'
[SEVERE] dart:isolate _RawReceivePortImpl._handleMessage
[SEVERE]
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 753ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 424ms
[INFO] Caching finalized dependency graph completed, took 543ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[INFO] Deleting previous outputs in `build` completed, took 21ms
[INFO] Creating merged output dir `build` completed, took 725ms
[INFO] Writing asset manifest completed, took 6ms
[INFO] Succeeded after 4.2s with 0 outputs (0 actions)
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 738ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 436ms
[INFO] Caching finalized dependency graph completed, took 555ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[SEVERE]
[SEVERE]
[SEVERE] You have hit a bug in build_runner
[SEVERE] Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
[SEVERE]
[SEVERE]
[SEVERE] FileSystemException: Directory watcher closed unexpectedly, path = 'd:\mydartprojects\cmpop\cmpop_browser'
[SEVERE] dart:isolate _RawReceivePortImpl._handleMessage
[SEVERE]
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 753ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 424ms
[INFO] Caching finalized dependency graph completed, took 543ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[INFO] Deleting previous outputs in `build` completed, took 21ms
[INFO] Creating merged output dir `build` completed, took 725ms
[INFO] Writing asset manifest completed, took 6ms
[INFO] Succeeded after 4.2s with 0 outputs (0 actions)
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 738ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 436ms
[INFO] Caching finalized dependency graph completed, took 555ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[SEVERE]
[SEVERE]
[SEVERE] You have hit a bug in build_runner
[SEVERE] Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
[SEVERE]
[SEVERE]
[SEVERE] FileSystemException: Directory watcher closed unexpectedly, path = 'd:\mydartprojects\cmpop\cmpop_browser'
[SEVERE] dart:isolate _RawReceivePortImpl._handleMessage
[SEVERE]
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 753ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 424ms
[INFO] Caching finalized dependency graph completed, took 543ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[INFO] Deleting previous outputs in `build` completed, took 21ms
[INFO] Creating merged output dir `build` completed, took 725ms
[INFO] Writing asset manifest completed, took 6ms
[INFO] Succeeded after 4.2s with 0 outputs (0 actions)
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 738ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 436ms
[INFO] Caching finalized dependency graph completed, took 555ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[SEVERE]
[SEVERE]
[SEVERE] You have hit a bug in build_runner
[SEVERE] Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
[SEVERE]
[SEVERE]
[SEVERE] FileSystemException: Directory watcher closed unexpectedly, path = 'd:\mydartprojects\cmpop\cmpop_browser'
[SEVERE] dart:isolate _RawReceivePortImpl._handleMessage
[SEVERE]
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 753ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 424ms
[INFO] Caching finalized dependency graph completed, took 543ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[INFO] Deleting previous outputs in `build` completed, took 21ms
[INFO] Creating merged output dir `build` completed, took 725ms
[INFO] Writing asset manifest completed, took 6ms
[INFO] Succeeded after 4.2s with 0 outputs (0 actions)
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 738ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 436ms
[INFO] Caching finalized dependency graph completed, took 555ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[SEVERE]
[SEVERE]
[SEVERE] You have hit a bug in build_runner
[SEVERE] Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
[SEVERE]
[SEVERE]
[SEVERE] FileSystemException: Directory watcher closed unexpectedly, path = 'd:\mydartprojects\cmpop\cmpop_browser'
[SEVERE] dart:isolate _RawReceivePortImpl._handleMessage
[SEVERE]
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 753ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 424ms
[INFO] Caching finalized dependency graph completed, took 543ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[INFO] Deleting previous outputs in `build` completed, took 21ms
[INFO] Creating merged output dir `build` completed, took 725ms
[INFO] Writing asset manifest completed, took 6ms
[INFO] Succeeded after 4.2s with 0 outputs (0 actions)
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 738ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 436ms
[INFO] Caching finalized dependency graph completed, took 555ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[SEVERE]
[SEVERE]
[SEVERE] You have hit a bug in build_runner
[SEVERE] Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
[SEVERE]
[SEVERE]
[SEVERE] FileSystemException: Directory watcher closed unexpectedly, path = 'd:\mydartprojects\cmpop\cmpop_browser'
[SEVERE] dart:isolate _RawReceivePortImpl._handleMessage
[SEVERE]
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 753ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 424ms
[INFO] Caching finalized dependency graph completed, took 543ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[INFO] Deleting previous outputs in `build` completed, took 21ms
[INFO] Creating merged output dir `build` completed, took 725ms
[INFO] Writing asset manifest completed, took 6ms
[INFO] Succeeded after 4.2s with 0 outputs (0 actions)
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 738ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 436ms
[INFO] Caching finalized dependency graph completed, took 555ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[SEVERE]
[SEVERE]
[SEVERE] You have hit a bug in build_runner
[SEVERE] Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
[SEVERE]
[SEVERE]
[SEVERE] FileSystemException: Directory watcher closed unexpectedly, path = 'd:\mydartprojects\cmpop\cmpop_browser'
[SEVERE] dart:isolate _RawReceivePortImpl._handleMessage
[SEVERE]
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 753ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 424ms
[INFO] Caching finalized dependency graph completed, took 543ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[INFO] Deleting previous outputs in `build` completed, took 21ms
[INFO] Creating merged output dir `build` completed, took 725ms
[INFO] Writing asset manifest completed, took 6ms
[INFO] Succeeded after 4.2s with 0 outputs (0 actions)
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 738ms
[INFO] Checking for updates since last build completed, took 1.2s
[INFO] Running build completed, took 436ms
[INFO] Caching finalized dependency graph completed, took 555ms
[INFO] Reading manifest at build\.build.manifest completed, took 0ms
[SEVERE]
[SEVERE]
[SEVERE] You have hit a bug in build_runner
[SEVERE] Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
[SEVERE]
[SEVERE]
[SEVERE] FileSystemException: Directory watcher closed unexpectedly, path = 'd:\mydartprojects\cmpop\cmpop_browser'
[SEVERE] dart:isolate _RawReceivePortImpl._handleMessage
[SEVERE] I noticed that in the command "webdev serves" the problem does not occur, and also that in linux the problem does not occur |
That is very odd indeed that it is happening with |
Re-opening as that seems like a different issue, maybe |
I downgraded dart 2.12 to 2.10 and ran some more tests and saw that with dart 2.10 the problem does not occur |
in Dart 2.13.4 the problem persists |
I think that probably this is related to your version solve (you likely got a very different set of packages in 2.10). |
@annagrin I do think this is most likely related to the recent asset server change, given the timing and description. |
Looking! |
We released dwds 11.1.2, but webdev from @insinfo I tried to repro the failure in @jakemac53 On windows,
And finishes successfully. Looks like the build tries to run something built with another SDK version in a isolate - do you know what it might be? |
That is normal output from pub after updating your sdk (its a bit weird but... 🤷♂️ ) |
If we aren't pulling down the latest asset server changes @annagrin then you probably don't need to investigate much further yourself (its also fairly unlikely you will be able to actually reproduce the issue). |
@jakemac53 I don't know if it helps but I thought the watcher should restart on this failure, according to the fix for dart-lang/sdk#38853. Not sure if something changed there... |
@annagrin Did you run on a clean windows virtual machine? Or on a working machine? I ran it on three working windows 10 computers, one Version 20H2 build 19042.1110 and two other Version 21H1 build 19043.1110 and they all had the same problem. dart version 2.13.4 It's strange because in dart 2.10 this problem doesn't happen Apparently this problem had been resolved, but it seems to have returned from dart 2.12. the strangest thing is that on the first run it goes well, but on the second time I run "webdev build" the problem occurs |
it was resolved in the dart-lang/watcher, which just restarted the watcher recursively as infinitum. But I does not seem to restart here, I am not sure why.
Yeah I have seen something like that with |
Update: brushed up on |
forgot to anser this:
I run it on my windows laptop. I will try to repro now that I have your code. |
@insinfo I can very predictably repro the issue on my windows laptop using your code. There are no dart processes left in between runs, so it looks like the issue is not due to webdev setup. @jakemac53 I think the issue might be in the build_runner after all. |
So one difference with @insinfo If you delete the output directory (defaults to |
yes, deleting the directory every time it compiles, the error doesn't occur PS D:\MyDartProjects\cmpop\cmpop_browser> rm -r .\build\
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 728ms
[INFO] Checking for updates since last build completed, took 1.1s
[INFO] Running build completed, took 406ms
[INFO] Caching finalized dependency graph completed, took 509ms
[INFO] Creating merged output dir `build` completed, took 1.0s
[INFO] Writing asset manifest completed, took 4ms
[INFO] Succeeded after 4.3s with 0 outputs (0 actions)
PS D:\MyDartProjects\cmpop\cmpop_browser> rm -r .\build\
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 735ms
[INFO] Checking for updates since last build completed, took 1.1s
[INFO] Running build completed, took 414ms
[INFO] Caching finalized dependency graph completed, took 507ms
[INFO] Creating merged output dir `build` completed, took 621ms
[INFO] Writing asset manifest completed, took 3ms
[INFO] Succeeded after 3.9s with 0 outputs (0 actions)
PS D:\MyDartProjects\cmpop\cmpop_browser> rm -r .\build\
PS D:\MyDartProjects\cmpop\cmpop_browser> webdev build
[INFO] Reading cached asset graph completed, took 729ms
[INFO] Checking for updates since last build completed, took 1.1s
[INFO] Running build completed, took 420ms
[INFO] Caching finalized dependency graph completed, took 513ms
[INFO] Creating merged output dir `build` completed, took 1.1s
[INFO] Writing asset manifest completed, took 5ms
[INFO] Succeeded after 4.4s with 0 outputs (0 actions)
|
Ok, so it seems like the problem is to do with that I don't know what would cause this to not occur on older sdks though. |
The fix that was done in watcher just restarted it forever, but it seems like it does not anymore in this example. I wonder if something changed in the watcher or the use of it... |
@jakemac53 Is it possible to configure the watcher in build_daemon not to monitor that directory? |
It isn't practical to unfortunately, no. We can't exclude certain dirs from the watcher. And we have to watch the root dir of the package to detect file/directory changes at that level. |
@jakemac53 I've got a theory - could it be this change: #2505
I've tried to verify that by using my local build clone but got stuck in dependency resolution loop.... |
Should we just be ignoring these errors? If we did, would the watcher would just restart? |
I think so... but it would be nice to test:) |
#3167 https://github.com/insinfo/app
name: turismo_browser
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com
environment:
sdk: '>=2.10.0 <3.0.0'
dependencies:
angular: ^6.0.0
angular_components: ^1.0.2
angular_router: ^2.0.0
angular_forms: ^3.0.0
sembast_web: ^1.2.0
angular_recaptcha: ^0.1.5
stream_transform: #^0.0.19
sass_builder: any
intl: '>=0.16.1 < 0.17.9'
uuid: '>=2.2.2 < 3.0.9'
crossplat_objectid: ^2.1.4
#dio: ^3.0.10
http: '>=0.12.2 < 0.13.5'
quiver: ^2.1.5
turismo_core:
path: ../turismo_core
dependency_overrides:
build_runner:
git:
url: https://github.com/dart-lang/build.git
ref: backport-watcher-fix
path: build_runner
dev_dependencies:
angular_test: ^3.0.0
build_runner: ^1.10.4
build_test: ^1.3.0
build_web_compilers: ^2.12.0
pedantic: ^1.9.2
test: ^1.15.4
build_runner: ^1.10.4 |
Related: dart-lang/webdev#1362 |
I did backport this to an earlier version of build_runner yes (version |
Has this version 1.11.1+1 been published? |
Yes |
FileSystemException: Directory watcher closed unexpectedly
pubspec.yaml
The text was updated successfully, but these errors were encountered: