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 error. Not sure why. #229

Open
trusktr opened this issue Jan 9, 2018 · 7 comments
Open

ENOSPC error. Not sure why. #229

trusktr opened this issue Jan 9, 2018 · 7 comments

Comments

@trusktr
Copy link

trusktr commented Jan 9, 2018

I'm not sure why yet, but trying to use docpress is giving me a Node error ENOSPC which seems to be related to file watching. This is the stack:

Error: watch /home/trusktr/Downloads/src/trusktr+infamous/.docpress ENOSPC
    at _errnoException (util.js:1026:11)
    at FSWatcher.start (fs.js:1383:19)
    at Object.fs.watch (fs.js:1409:11)
    at createFsWatchInstance (/home/trusktr/Downloads/src/trusktr+infamous/node_modules/metalsmith-start/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/home/trusktr/Downloads/src/trusktr+infamous/node_modules/metalsmith-start/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/trusktr/Downloads/src/trusktr+infamous/node_modules/metalsmith-start/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/trusktr/Downloads/src/trusktr+infamous/node_modules/metalsmith-start/node_modules/chokidar/lib/nodefs-handler.js:407:19)
    at FSWatcher.<anonymous> (/home/trusktr/Downloads/src/trusktr+infamous/node_modules/metalsmith-start/node_modules/chokidar/lib/nodefs-handler.js:455:19)
    at FSWatcher.<anonymous> (/home/trusktr/Downloads/src/trusktr+infamous/node_modules/metalsmith-start/node_modules/chokidar/lib/nodefs-handler.js:460:16)
    at FSReqWrap.oncomplete (fs.js:154:5)

It happens only with the serve command, but the build command works just fine.

I could probably post a reproduction repo, but you'll probably not get the error. I'm on a little Chromebook. Any thoughts or suggestions on what to try?

@trusktr
Copy link
Author

trusktr commented Jan 9, 2018

I see:

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

$ lsof | grep inotify | wc -l
898

so it doesn't seem like the max file watches are exhausted. What else can I investigate?

@knownasilya
Copy link
Member

Which node/npm versions?

@trusktr
Copy link
Author

trusktr commented Jan 10, 2018

8.5.0 / 5.6.0

@trusktr
Copy link
Author

trusktr commented Jan 10, 2018

Weird thing is it was working before, then it stopped working, and a reboot doesn't fix it. I haven't changed the versions, and I've used exact versions in package.json.

Seems like something changed on my system.

@trusktr
Copy link
Author

trusktr commented Jan 10, 2018

A Meteor app is giving me a message:

=> It looks like a simple tweak to your system's configuration will make many tools (including this Meteor command) more efficient. To learn more,
   see https://github.com/meteor/meteor/wiki/File-Change-Watcher-Efficiency

So it seems there's something up with my system!

Somehow Meteor is able to keep working despite the message. Maybe there's some fallback that docpress can do too?

@trusktr
Copy link
Author

trusktr commented Jan 10, 2018

Looks like this helped solve the problem: https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers

Not sure exactly why (I mean I get that the file watch limit is raised, but not why the limit was hit in the first place, it's never happened before), and what the implications of this change are.

@trusktr
Copy link
Author

trusktr commented Jan 11, 2018

Based on what I discovered in #230, probably anything outside of the docs location (except for files that are referenced from files inside the docs location) should not be watched. This is probably what is causing the inotify issues (f.e. many files inside of node_modules).

@trusktr trusktr reopened this Jan 11, 2018
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

No branches or pull requests

2 participants