Error: ENOSPC: System limit for number of file watchers reached



 Hi There,

Today during development I face an issue that never happened with me, then I googled and resolved the issue, So I thought I should share with you all.

Error: ENOSPC: System limit for the number of file watchers reached

Task: 

    I had to create an image in docker, the application is in React.js. The interesting thing is that it was working on development machine but when I run a container on UAT, then I got error like "Error: ENOSPC: System limit for the number of file watchers reached"

After a lot of effort, I found a solution. 

Modify the number of system monitoring files

In Ubuntu

sudo gedit /etc/sysctl.conf

Add a line at the bottom

fs.inotify.max_user_watches=524288

Then save and exit!

to check it:
sudo sysctl -p
Then it is solved!

Thats only for today, Will come up with a more interesting solution.

No comments

Powered by Blogger.