-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
Error: ENFILE: file table overflow and Too many open files in system #4672
Comments
Can you share your tsconfig? |
tsconfig.json
tsconfig.node.json
tsconfig.app.json
project based on: https://github.com/TailAdmin/vue-tailwind-admin-dashboard |
I have the same issue. I found too many '/tmp/vue-named-pipe-2.0.28-inferred-0' in lsof. |
I have the same issue on my system, but hadn't managed to track it down as far as you have. It just seems that it only happens when I'm doing development and have the app running with Once the problem occurs, I have to restart my machine, so haven't been able to gather any particular data about it apart from that general observation. The general suggestion seems to be to increase the maxfiles and maxfilesperproc settings, but I'm hesitant to do that without understanding the cause of the problem, and what the settings need to be. |
I think all you'll get is a little more time between problems occurring because file descriptors keep getting bigger and not smaller. When the maxfiles and maxfilesperproc limits are reached, you will again experience problems with the operating system. |
I just started experiencing this. I thought it had to do with a Chrome update, but perhaps it was the VS Code and/or Extension Updates. |
I too have started experiencing this a few weeks ago and found out it has something to do with the Vue - Official extension. I've made some tests and here are my findings, maybe it helps the devs to pinpoint the issue. My setup:
When I navigate through a .vue file, for every arrow key that I press, or selection that I make, a few new file descriptors are opened by two Code Helper (plugin) processes. Also, if I resize the VSCode window while the .vue file is the active file, the number of opened files descriptors grows by a dozen per second. One of the plugin processes opens files named: /tmp/vue-named-pipe-2.1.2-inferred-1 I happens only if the Vue - Official extension is enabled. As soon as I disable the extension, all the file descriptors are closed. How I tested it
ConclusionAt least in my case, it doesn't have anything to do with running the project or "npm run dev". It is enough to have a .vue file (even if it's empty) in the foreground and select something in it or resize the VSCode window, in order for the file descriptor count to grow. If the number of opened file descriptors gets high enough (10000+), it begins to return errors when saving files and eventually other apps in the system start crashing. If I disable the Vue - Official extension, all the files descriptors are closed and everything gets back to normal. Temporary solutionFor now, I made a habit of disabling and enabling the Vue - Official extension every now and then. I hope this helps. |
Thanks @peroneu that helps. We're investigating |
@johnsoncodehk wow, that was fast. Much appreciated! |
I installed the version linked to by @johnsoncodehk and I just ran into the same issue again. |
Today I have updated the extension to v. 2.1.4, which I assume includes the fix from the file linked above. The update did indeed do something, but it doesn't solve the issue. Resizing the VSCode window doesn't increase the number of file descriptors anymore, but navigating through the file with the arrow keys does. Another thing is that before, there were 2 processes, each with a similar number of files opened. Now, there are 3 processes, and one of them is always approximately the sum of the other too. I have no idea if this means anything... :)
The first number is the output from "lsof" and the second is the process id. Just doing Select All, then Esc for 10 times opens about 90 new file descriptors. After a couple of hours of work, I ended up with almost 40,000 file descriptors opened. The solution to disable and enable the extension still works, but it would be great to have it fixed. @davidmatter @johnsoncodehk If there's anything else you'd like me to test, please let me know. Thanks! |
@peroneu that's strange, I can't reproduce it anymore since 2.1.4. The number of open files is quite steady on my end. I think @johnsoncodehk wanted to have another look at the pipe code anyways. Are you using any kind of special extensions by any chance? Anything that integrates with the tsserver or the vue ecosystem? |
I can't reproduce it, but I fixed the possible potential problem at 8064338. Can you try the following version to see if it solves the problem? |
Thanks a lot! I have built the extension from the commit above and it seems that it does indeed solve the issue for good. After about one hour of work I didn't get any superfluous file descriptors. Great job!
|
@peroneu thank you for confirming! The fix has been released for 2.1.6, if you still have problems please let me know. |
I'm still running into this periodically. It's way less than before, but something is still awry. Seems that when I'm in the deep of making lots of changes I eventually run into the ENFILE error. |
For me, after a couple of days of work without restarting the extension, these are the top file counts. I guess something still isn't totally right, but it's much better than before.
|
I had the same issue and v2.1.6 did nothing on my side. I finally discovered that my project was lacking a However I am wondering if this is a bug... I know that we are supposed to have this file in a Vue project but I think that Volar used to work without it and, for sure, Vetur is OK without it. Reproducing the issue is easy:
Thanks to @cyberz and @peroneu for the hints given here for debugging! |
@johnsoncodehk let's have another look at this |
As another data point on this, since the update I have not encountered the problem (thank you so much!), but then my project is typescript with a tsconfig, so I can't verify whether the problem still exists in other scenarios. Down to a maximum of 93 open files per instance instead of the previous hundreds or more. |
Vue - Official extension or vue-tsc version
v2.0.28
VSCode version
1.92.0
Vue version
3.3.11
TypeScript version
5.3.3
System Info
Steps to reproduce
While working on a project once a day I have next errors:
"ENFILE: file table overflow ..."
and as result "Too many open files in system"
Random apps crash and won't launch
First I checked applications that opened a lot of files:
lsof -n +c 0 | cut -f1 -d' ' | uniq -c | sort | tail
result:
For display PID instead of application name:
lsof -n +c 0 | sed -E 's/^[^ ]+[ ]+([^ ]+).*$/\1/' | uniq -c | sort | tail
result:
Process info:
ps aux | grep 92363
result:
92363 0.0 0.4 1596757920 62368 ?? S 2:44PM 0:58.75 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Users/alex/.vscode/extensions/vue.volar-2.0.28/server.js --node-ipc --clientProcessId=92229
Kill process:
sudo kill 92363
Check opened files again:
lsof -n +c 0 | cut -f1 -d' ' | uniq -c | sort | tail
result:
What is expected?
What is actually happening?
Once a day I have next errors:
"ENFILE: file table overflow ..."
and and as result "Too many open files in system"
Random apps crash and won't launch
Link to minimal reproduction
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: