Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "User limit of inotify watches reached". ExtReact build

Tags:

I installed ExtReact, with examples. When I run

npm start 

I get an error:

ERROR in [@extjs/reactor-webpack-plugin]: Error: [ERR] BUILD FAILED [ERR] com.sencha.exceptions.BasicException: User limit of inotify watches  reached [ERR] [ERR] Total time: 13 seconds  [ERR] /home/user/project/build/ext-react/build.xml:101:  com.sencha.exceptions.BasicException: User limit of inotify watches reached [ERR] A log is available in the file "/home/user/project/build/ext- react/sencha-error-20171027.log" 

How to fix this error?

like image 945
Sizuji Avatar asked Nov 02 '17 12:11

Sizuji


People also ask

What is Inotify watch limit?

inotify requires kernel resources (memory and processor) for each file it tracks. As a result, the Linux kernel limits the number of file watchers that each user can register. The default settings vary according to the host system distribution; on Ubuntu 20.04 LTS, the default limit is 8,192 watches per instance.

How do I know if I have Inotify installed?

You can use sysctl fs. inotify. max_user_watches to check current value. Use tail -f to verify if your OS does exceed the inotify maximum watch limit.

What is Proc Sys FS Inotify Max_user_watches?

inotify. max_user_watches define user limits on the number of inotify resources and inotify file watches. If these limits are reached, you may experience processes failing with error messages related to the limits, for example: ENOSPC: System limit for number of file watchers reached...


1 Answers

Why?

Programs that sync files such as dropbox, git etc use inotify to notice changes to the file system. The limit can be see by -

cat /proc/sys/fs/inotify/max_user_watches 

For me, it shows 100000. When this limit is not enough to monitor all files inside a directory it throws this error.


Increasing the amount of inotify watchers(Short version):

If you are running Debian, RedHat, or another similar Linux distribution, run the following in a terminal:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p 

If you are running ArchLinux, run the following command instead (see here for why):

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system 

Then paste it in your terminal and press on enter to run it.


Technical details:

Listen uses inotify by default on Linux to monitor directories for changes. It's not uncommon to encounter a system limit on the number of files you can monitor. For example, Ubuntu Lucid's (64bit) inotify limit is set to 8192.

You can get your current inotify file watch limit by executing:

$ cat /proc/sys/fs/inotify/max_user_watches 

When this limit is not enough to monitor all files inside a directory, the limit must be increased for Listen to work properly.

You can set a new limit temporary with:

$ sudo sysctl fs.inotify.max_user_watches=524288 $ sudo sysctl -p 

If you like to make your limit permanent, use:

$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf $ sudo sysctl -p 

You may also need to pay attention to the values of max_queued_events and max_user_instances if Listen keeps on complaining.

Source: https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers

like image 53
Aniket Thakur Avatar answered Oct 12 '22 15:10

Aniket Thakur