npkill
npkill copied to clipboard
Got "spawn cut EMFILE" on Ubuntu 18
Describe the bug
I tried npkill and I got following error after few seconds
To Reproduce
Steps to reproduce the behavior:
$ npkill
- OS: Ubuntu 18 LTS
- Version 0.4.3
Additional context ERROR:
throw er; // Unhandled 'error' event
^
Error: spawn cut EMFILE
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
I got the same error on osx 10.14.4 - (node v10.16.0)
Thank you very much for opening this report! I recently noticed that sometimes (personally, infrequently), that error is thrown.
Npkill on unix systems invokes 2 commands to determine the size for each of the results found. The cause seems to be due to an excess of simultaneous reading of files in that process.
I don't have much free time for now to be able to fix this, but here are two temporary solutions:
- Start the analysis in a directory with fewer files.
- By executing
ulimit -n 10480
the error should stop appearing (ATTENTION I have not tried it or know what adverse effects it could have)
We have released version 0.5.0 :confetti_ball: We have controlled many types of exceptions, including the mentioned one.
Could you tell me if you can already use npkill?
I imagine there will be directories that show their space as "--"
I guess the search cannot be completed. It stopped the search but search never completed successfully.
ulimit increases the number of open file handles you can have at one time. On OS X and certain Linux distros it is set to a lower value. If problems persist, try gradually increasing the number, or consider what other I/O intensive activities you may have going on.
@hhuseyinpay thanks for the reply! Even in that state, can you use it normally or suffer from some kind of malfunction?
In any case, we will investigate further and correct it soon.
In this time the related methods have undergone many changes, so it should not be a problem today. If it continues to be a problem, do not hesitate to reopen.