getDirectoryContents:openDirStream: resource exhausted (Too many open files)
I keep getting this error whenever I do a change to my files.
My public folder is still the default one, I haven't done any major changes.
What could be causing this error?
Below is my
wasp start
log.
5 Replies
Hi @abiroot. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The error message
getDirectoryContents:openDirStream: resource exhausted (Too many open files)
is related to the limit of open files that your system allows at a given time. This limit can be reached if Wasp is watching too many files, which can happen if there are a lot of files in your project or if there are redundant watches.
In Wasp, there are several processes that watch files: Wasp itself watches your source files, nodemon
watches the generated server files, and vite
watches generated client files. All these processes are spawned by the wasp start
command, and they all count towards the limit of open files source (https://discord.com/channels/686873244791210014/1212533517360177253).
A temporary solution to this problem is to increase the limit of open files in your system. You can do this by running the command ulimit -n 10000
source (https://discord.com/channels/686873244791210014/1212533517360177253).
However, the Wasp team is aware of this issue and is working on a fix to reduce the number of watched files and avoid hitting the limit source (https://github.com/wasp-lang/wasp/issues/1844). You can follow the progress on this issue on the Wasp GitHub page.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @abiroot, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Can open files in my IDE cause this? I use Visual Studio code, and currently I have about 10 files open.
But this never happened before in previous environments, I have a Apple M2 Pro with 16 GB of rams
Hey @abiroot, thanks for opening the new thread with this question to avoid polluting the old one.
Let's continue here
Anyway, do you mind sharing the project so I can try it out?
Hey @sodic thank you for your support as always!
It got solved by itself after doing a
wasp clean
Very strange, but thanks for reporting!