Skip to content
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

ENOSPC: System limit for number of file watchers reached #128

Open
gagan-bansal opened this issue Nov 26, 2022 · 2 comments · May be fixed by #129
Open

ENOSPC: System limit for number of file watchers reached #128

gagan-bansal opened this issue Nov 26, 2022 · 2 comments · May be fixed by #129

Comments

@gagan-bansal
Copy link

What version of markserv are you using?

1.17.4
Tried with livereload 0.9.3 also, getting same error.

What OS are you using?

Ubuntu 18.04

What web browser are you using? (Browser name and specific version please)

Firefox 107

Expected result

Launch README.md in browser (http://localhost:8642/README.md)

Actual result

It seems livereload or chokidar not ignoring the folder 'node_modules'.

markserv README.md

  Markserv   boot: starting Markserv...
  Markserv   address: http://localhost:8642
  Markserv   path: /home/gaganb/projects/dev-repos/geojson2svg/README.md
  Markserv   livereload: communicating on port: 35729
  Markserv   process: your pid is: 16681
  Markserv   stop: press [Ctrl + C] or type "sudo kill -9 16681"
    GitHub   Contribute on Github - github.com/markserv
  Markserv   upgrade: checking for upgrade...
  Markserv   markdown: /home/gaganb/projects/dev-repos/geojson2svg/README.md
(node:16681) Warning: .then() only accepts functions but was passed: [object String]
(Use `node --trace-warnings ...` to show where the warning was created)
Error: ENOSPC: System limit for number of file watchers reached, watch '/home/gaganb/projects/dev-repos/geojson2svg/node_modules/split/test/try_catch.asynct.js'
    at FSWatcher.<computed> (internal/fs/watchers.js:218:26)
    at Object.watch (fs.js:1582:34)
    at createFsWatchInstance (/home/gaganb/projects/dev-repos/geojson2svg/node_modules/chokidar/lib/nodefs-handler.js:119:15)
    at setFsWatchListener (/home/gaganb/projects/dev-repos/geojson2svg/node_modules/chokidar/lib/nodefs-handler.js:166:15)
    at NodeFsHandler._watchWithNodeFs (/home/gaganb/projects/dev-repos/geojson2svg/node_modules/chokidar/lib/nodefs-handler.js:331:14)
    at NodeFsHandler._handleFile (/home/gaganb/projects/dev-repos/geojson2svg/node_modules/chokidar/lib/nodefs-handler.js:395:23)
    at NodeFsHandler._addToNodeFs (/home/gaganb/projects/dev-repos/geojson2svg/node_modules/chokidar/lib/nodefs-handler.js:637:21)

Steps to reproduce issue

Ubuntu default (or on my system) value for watch file is

cat /proc/sys/fs/inotify/max_user_watches
8129

When I set number of max watch file as 100000 then there was no error.

sudo sysctl -w fs.inotify.max_user_watches=100000

So to reproduce, check in system the inotify value of max_user_watches and change to less number.

Thank you for such a wonderful package I use this in every project.

@rauaap rauaap linked a pull request Jun 11, 2023 that will close this issue
@rauaap
Copy link

rauaap commented Jun 11, 2023

Added a pull request that fixes the problem. Hope it helps.

@gagan-bansal
Copy link
Author

Thank you @rauaap Your pull request solves the issue.

Please check if your pull request is merged or not as there is no activity in this repo for last 4 years. Other wise I would recommend you can publish from your repo as markserv2. Please also try to merge all other pending pull requests.

This tool is really helpful for quick check of markdown pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants