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

Error: watch ENOSPC on 0.15 (running inside Docker) #739

Open
siboulet opened this issue Jul 29, 2015 · 17 comments
Open

Error: watch ENOSPC on 0.15 (running inside Docker) #739

siboulet opened this issue Jul 29, 2015 · 17 comments

Comments

@siboulet
Copy link

I can no longer use forever inside Docker container after updating to 0.15. I have plenty of space left, not sure why I'm getting ENOSPC.

Rolling back to 0.14.2 works.

Jul 29 14:23:34 coreos docker[12137]: events.js:85
Jul 29 14:23:34 coreos docker[12137]: throw er; // Unhandled 'error' event
Jul 29 14:23:34 coreos docker[12137]: ^
Jul 29 14:23:34 coreos docker[12137]: Error: watch ENOSPC
Jul 29 14:23:34 coreos docker[12137]: at exports._errnoException (util.js:746:11)
Jul 29 14:23:34 coreos docker[12137]: at FSWatcher.start (fs.js:1172:11)
Jul 29 14:23:34 coreos docker[12137]: at Object.fs.watch (fs.js:1198:11)
Jul 29 14:23:34 coreos docker[12137]: at createFsWatchInstance (/usr/src/app/node_modules/forever/node_modules/forever-monitor/node_modules/chokidar/lib/nodefs-handler.js:37:15)
Jul 29 14:23:34 coreos docker[12137]: at setFsWatchListener (/usr/src/app/node_modules/forever/node_modules/forever-monitor/node_modules/chokidar/lib/nodefs-handler.js:80:15)
Jul 29 14:23:34 coreos docker[12137]: at EventEmitter.NodeFsHandler._watchWithNodeFs (/usr/src/app/node_modules/forever/node_modules/forever-monitor/node_modules/chokidar/lib/nodefs-handler.js:228:14)
Jul 29 14:23:34 coreos docker[12137]: at EventEmitter.NodeFsHandler._handleFile (/usr/src/app/node_modules/forever/node_modules/forever-monitor/node_modules/chokidar/lib/nodefs-handler.js:255:21)
Jul 29 14:23:34 coreos docker[12137]: at EventEmitter.<anonymous> (/usr/src/app/node_modules/forever/node_modules/forever-monitor/node_modules/chokidar/lib/nodefs-handler.js:468:21)
Jul 29 14:23:34 coreos docker[12137]: at FSReqWrap.oncomplete (fs.js:95:15)
@indexzero
Copy link
Member

This feels like a chokidar issue. I'm going to reach out there and see what's up.

@indexzero
Copy link
Member

Also @siboulet are you sure the container has enough space as well?

@siboulet
Copy link
Author

@indexzero thanks for the follow up. Absolutely sure I have sufficient disk space. I initially though it was a space issue but it really isn't. Simply changing the forever version and restarting (the same container) works.

@indexzero
Copy link
Member

Can you show me a df -h from inside the container? As I understand it the disk allocated to the container is different than the disk on the machine itself. Trying to figure this out accordingly.

@siboulet
Copy link
Author

@indexzero I checked multiple time already, trust me, it's not a disk space issue. Also checked df -i for the inodes. I have plenty of space left (several GB). I don't have time to set a test for this right now, but I'm using the official Node image here: https://registry.hub.docker.com/_/node/

@indexzero
Copy link
Member

Ok. Seems like it could be a ulimit issue: paulmillr/chokidar#322 (comment)

@210ToNy210
Copy link

@brycereynolds
Copy link

@210ToNy210 does that version contain a patch? It looks like that has been merged with main right? Anyhow I'm using the latest forever (0.15.1) and am also running into the same error as OP. I also confirm enough space is available. In my case though forever works if I am not watching.

This is my full command which works fine locally but inside docker blows up.

forever -w --watchDirectory $PWD -c 'node --harmony' app/server.development.js --seneca.log=plugin:collection --seneca.print.tree --seneca.log=level:info,level:fatal --seneca.log=plugin:transport,regex:cmd.listen

Without watch forever works as expected. With watch after about 10 seconds it dies.

@brycereynolds
Copy link

And somehow I didn't follow that link by @indexzero before posting. Looks like watch has already been picked up on...

@pappacena
Copy link

+1

@FelikZ
Copy link

FelikZ commented Sep 7, 2015

Rollback to @0.14.2 helps

@poldridge
Copy link

+1

@abenevaut
Copy link

abenevaut commented Oct 22, 2016

I got an error, maybe related to this one, when i use the watcher :

events.js:154
      throw er; // Unhandled 'error' event
      ^

Error: watch /project/current/node_modules/nyc/node_modules/lodash/fp/split.js ENOSPC
    at exports._errnoException (util.js:893:11)
    at FSWatcher.start (fs.js:1313:19)
    at Object.fs.watch (fs.js:1341:11)
    at createFsWatchInstance (/usr/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/usr/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleFile (/usr/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:255:21)
    at FSWatcher.<anonymous> (/usr/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:473:21)
    at FSReqWrap.oncomplete (fs.js:82:15)

@DeekshaPandit
Copy link

@42antoine
Did you find any fix for this?
I am getting the same error when compiling Angular2 Application.

@Jazzepi
Copy link

Jazzepi commented Mar 2, 2018

Has anyone here tried upping the number of inotify watchers? You have to do it inside of the host, and then the docker container will have the same number. You can't modify this value from inside the docker container for security reasons AFAIK.

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

In jestjs/jest#3254 @maraisr did some research for another problem.

There's also a great post here if you want to know how to see your current inotify watcher value, and see how many are being used at any given time.

https://unix.stackexchange.com/questions/13751/kernel-inotify-watch-limit-reached

@chpio
Copy link

chpio commented Jul 17, 2019

im getting Error: EACCES: permission denied, watch '/proc/kmsg'

forever --watch /app/server.js

warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
error: Could not read .foreverignore file.
error: ENOENT: no such file or directory, open '/.foreverignore'
error: restarting script because unlinkDir changed
error: Forever detected script was killed by signal: SIGKILL
error: Script restart attempt #1
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: EACCES: permission denied, watch '/proc/kmsg'
    at FSWatcher.start (internal/fs/watchers.js:165:26)
    at Object.watch (fs.js:1258:11)
    at createFsWatchInstance (/usr/local/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/usr/local/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:255:21)
    at FSWatcher.<anonymous> (/usr/local/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:473:21)
    at FSReqWrap.oncomplete (fs.js:154:5)
Emitted 'error' event at:
    at FSWatcher._handleError (/usr/local/lib/node_modules/forever/node_modules/chokidar/index.js:257:10)
    at createFsWatchInstance (/usr/local/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:39:5)
    at setFsWatchListener (/usr/local/lib/node_modules/forever/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    [... lines matching original stack trace ...]
    at FSReqWrap.oncomplete (fs.js:154:5)

and also some unintended behavior restarting script because unlinkDir changed

@chpio
Copy link

chpio commented Jul 17, 2019

WTF... it's watching everything, even without --watchDirectory, are you kidding?

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