-
Notifications
You must be signed in to change notification settings - Fork 71
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
Visual Studio Code is unable to watch for file changes in this large workspace" (error ENOSPC) #29
Comments
I got the solution by following this instruction: https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc Hope this help. |
For Ubuntu users : |
The problem is that as VS code is being sandboxed this wasn't working. May someone confirm if this isn't the case anymore? |
I follow the vs code instruction, |
I can confirm that this is still the case. I'm pretty good at following instructions and I couldn't resolve it with the "Please follow the instructions link to resolve this issue." |
Here tooo |
I have updated after that executed after doing this step also when I execute I'm totally clueless!!! whats going on here:( |
Hola Chicos, al parecer en linux funciona un poco diferente entonces en lugar de todo lo demás expuesto pueden probar con escribir en su terminal el comando: echo fs.inotify.max_user_watches = 524288 | sudo tee -a /etc/sysctl.conf y luego el comando: sudo sysctl -p luego para verificar escribir el comando: cat/proc/sys/fs/inotify/max_user_watches Espero que les sirva. Para mas informacion https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers |
@rajatkd I had to execute the following command on a RHEL 7.5 box:
|
You have to relaunch the app to have the new |
I have never seen this before I just recently upgraded my linux box to Mint 19.2 and installed VSCode. Reading the instructions here, I see that typing this should give me that max number of files that can be watched:
The answer I get is 8192. But the number of files in my workspace is 4! So why am I getting this message? I don't understand why I'd have to increase the file limit to 524288 in order to get rid of this notification. |
I have the exact same behaviour. I do not have sudo rights on my machine, and I don't think it should be needed to enable file change monitoring of small workspaces. |
Please execute this command echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p It'll solve your issue |
Please use this, it'll solve echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p |
I ran into this issue because I had a Python venv with Jupyter and Matplotlib, which already gives 10k+ files in the .venv folder, exceeding the default maximum of 8192 watches. So I added |
Genious, thank you! I did not think about vscode also having file watchers on the venv. Perhaps if there was some way to see a list of the files being watched, not just the total number of files, one could more easily make decisions of what to put in files.watcherExclude. |
|
u wrote clode .....and it should be close |
Is there a way to list all the files being watched so we can tweak our "files.watcherExclude" config? |
For Ubuntu or Linux Mint please open your terminal and put this command
|
Really Works |
Thank you!! |
Yes I face the same problem but finally it worked |
Well, we are not allowed to edit systcl.conf file neither to change its permissions. Any clue? |
Solved the issue by running with sudo but still its 8192 |
I was doing a silly mistake it worked thanks |
hey! it's solves the problem just for Ubuntu. what can do Mac-users? |
Try this - |
@gerrgg, Thanks! |
I'd be good to have venv/ added as default to unwatch, I don't see why not seeing node_modules is already included by default. |
I can confirm @apsrcreatix 's fix works, but ever since I increased the file watch limit, both Chromium and VSCode (and spotify) will periodically freeze. (Usually for 10-15 seconds every few minutes or so). It's made my system completely unusable. |
@nightduck as it was mentioned before by @agaeb it is better to focus on resolving root cause rather than consequences. The reason is that virtual environment includes all the libraries that you need in virtual environment folder (5000+ files under /bin/lib based on number and size of modules that were installed). VSCode then tries to track changes in all of them as a result. Under normal circumstances you couldn't care less about those changes. Fix does not require changing system settings, as most of the time your projects do not have thousands of files. In my case I needed to tryout Django, 200 files max, rest of those ~5700 were in venv folder (other ~2300 were watched by Baloo File Indexing). So I just excluded venv folder as described here (the "Another option is" paragraph). After excluding entire virtual environment folder and running this neat script, I can easily see that VSCode watches only few files I am interested in. Hope this helps. |
@gerrgg Thank You Very Much |
sysctl: cannot stat /proc/sys/fs/notify/max_user_watches: No such file or directory This is what I get |
The instructions here didn't directly fix this error for me when I had three projects opened in three visual studio code windows, I also had to close one visual studio code window together with the project that was opened in it. So this error only disappeared after following the instructions here and closing one VS Code window so that I only had two projects opened in three windows instead of three projects opened in three windows. |
Starting from version 5.11, Linux kernel logic got updated to compute a dynamic default value for As a datapoint, on a workstation with 8GiB of RAM this now gives ~60k max user-watches. |
what can do Mac-users? |
@HL2222 just check solution I provided on 7th December 2020. Don't focus on alternating OS rather focus on letting VSCode know that it does not have to watch all the files in your workspace. It's rarely the case that you need all of them watched. |
I really wish I could understand how this work, because it's not working for me. At first I had like 13K files in workspace. My No matter what I do, nothing works. I did: "files.watcherExclude": {
"**/.env/**": true,
"**/.venv/**": true,
"**/env/**": true,
"**/venv/**": true,
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/samples/**": true,
"**/_temp/**": true,
"**/.mypy_cache/**": true, # trying to exclude it
"**/.mypy_cache/*/**": true # I frankly don't know the diff
}, Then I even deleted the Some details.
Just wondering if symlinks may play a role here. This ticket issue was opened 5 years ago! |
Apparently it needs this line
fs.inotify.max_user_watches=524288
added to /etc/sysctl.confThe text was updated successfully, but these errors were encountered: