-
Notifications
You must be signed in to change notification settings - Fork 849
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
EACCES when renaming folder that is being watched from nodejs #3395
Comments
this does not work for me// settings.json
{
"remote.WSL.fileWatcher.polling": true
} but this is helped// settings.json
{
"files.watcherExclude": {
"**/**/*": true
}
} |
@qwabra I tried your approach and even that doesn't work. I tried:
then
then both. None of this works for me. Can anyone please help? |
This is pretty annoying... for now I just close VS code since the file watcher has a lock on the files, do file work in terminal or file explorer and reopen when done with |
Why is the workaround from #3395 (comment) not explicitly stated in the VS Code docs section about known WSL limitations? It should note that all workspace files must be excluded from being watched otherwise the problem will persist… |
you can just open
it can be set locally(use workspace settings) |
something is fundamentally broken here. while having my remote-wsl workspace open in vscode, i get the following in a command prompt:
that means the windows kernel has every single one of the files in my workspace open. i have the following in my
|
Thank you. This also solved my problem in installing go tools on WSL. |
// settings.json (located in %appdata%/code/user/settings.json) After saving it, restart VsCode. |
Retry rename on EACCES This PR retries `rename` upon getting `EACCES`. I've included data about how many retries are likely necessary. On my system (WSL1 Ubuntu 20.04, omitting hardware details), the `EACCES` issue makes it impossible to use esy to install any of the Dream examples or use Dream's quick start. As the data below shows, every installation is expected to fail with `EACCES`, if it is not worked around. The underlying `EACCES` issue seems to be a long-standing problem on WSL1 (microsoft/WSL#1529, microsoft/WSL#3395), and I think we do have to work around it in esy. I'm not sure what is causing the `EACCES` exactly. I think there are two main classes of possibilities: - Self-interaction between esy's opened file descriptors and `rename`. I think the self-interaction is due to WSL rather than Lwt or another library. Since I compiled esy on WSL, it is using Lwt's Unix (rather than Windows) C code. Since the Unix code seems to work fine on Linux and Mac, this suggests a WSL issue. - Interaction between esy and file indexers or other proceses running on the system. I'm not sure if that's a WSL issue or not, but I've never had to be aware of such processes when doing renames in Cygwin or elsewhere. I built esy with this patch under WSL and ran clean `esy install`s in Dream's [full-stack ReScript](https://github.com/aantron/dream/tree/03e4d37cb5f5f638707479cd46105e2ee2b1df0e/example/w-fullstack-rescript#readme) example, using this script: ```sh #!/bin/bash export PATH="/home/antron/code/attic/esy/_build/install/default/bin:$PATH" export ESY__PREFIX="/home/antron/code/dream/dream/example/w-fullstack-rescript/esy-prefix" export OCAMLRUNPARAM=b RUN=1 while true do rm -rf esy-prefix _esy esy.lock lib node_modules/ package-lock.json echo echo "RUN $RUN" which esy esy install # --verbosity debug if [ $? != 0 ] then exit fi RUN=$((RUN+1)) done ``` The example was checked out into NTFS. The system was freshly restarted, and VSCode (or anything similar) was not running. I used a version of this patch with a print showing the number of attempts before `rename` succeeds, and got the following results from 5 runs: ``` 1 attempt: 802 2 attempts: 52 3 attempts: 12 4 attempts: 3 5 attempts: 1 total: 870 ``` Based on this, I naively estimated that if a `rename` needs more than 1 attempt, the number of attempts needed decays by a factor of 4 at each step. I set the limit on the number of attempts naively to 8, thus expecting one failure in about 500 `esy install` attempts of the Dream ReScript example, under all these simplified assumptions. The delay between attempts is (over) one second, so this means that upon legitimate `EACCES`, users will have to wait eight seconds to get an error message. I think there are two ways to address this: - Fall back to recursive copy rather than retrying `rename` when `rename` fails. Do we have a recursive copy available in esy or its dependencies? Is it fine to leave the source directory intact? - Detect WSL and retry only on WSL. Waiting for 8 seconds is still a much better user experience than failure to install at all, so the PR will still be an improvement, without, in this case, harming Linux or Mac users. We could also add a message, shown in case we finally fail with `EACCES` on WSL, giving users a hint about potential VSCode or other watchers, and what else they can try to solve the problem. Closes #1363. Probably fixes #1097, some of the reports after the first one. Probably fixes #1083. Probably fixes #593, but I haven't looked into non-WSL Windows yet. Probably fixes aantron/dream#63. cc @bryphe, @rizo, @jordwalke, @iMplode-nZ, @a-c-sreedhar-reddy, @srirajshukla, @andreypopp
Hello, File -> Preferences -> Settings Hope I am not repeating someone else answer :) |
Microsoft Windows [Version 10.0.17134.112]
I am trying to use
chokidar
, a popular nodejs file system watcher library.Whenever I use chokidar to listen for file system changes, I can no longer rename folders that lie within the folder being watched.
npm install chokidar
mkdir test
echo hello > test/test.txt
repro.js
:WSL (Ubuntu 18.04):
Ubuntu 18.04:
I don't think it is terribly important (other colleagues are able to reproduce with other node versions), but I am using nodejs
v8.11.3
The text was updated successfully, but these errors were encountered: