Node: APFS fsevents

Created on 29 Sep 2017  Â·  14Comments  Â·  Source: nodejs/node

  • Version: 8.6.0
  • Platform: macOS 10.13 High Sierra
  • Subsystem:
> node scripts/test.js

2017-09-29 14:14 node[35183] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2017-09-29 14:14 node[35183] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: Error watching file for changes: EMFILE
    at _errnoException (util.js:1019:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1360:9)

Jest failing to watch files on APFS filesystem

fs macos

Most helpful comment

@jbosse Thanks, brew install watchman got my tests to run

All 14 comments

Does increasing the maximum number of file descriptors (ulimit -n) make any difference?

> ulimit -n
256

Then same error reported on node scripts/test.js

You will probably need to set maxfiles via launchctl before calling ulimit -n. Something like:

$ sudo launchctl limit maxfiles 2000 2000 && ulimit -n 2000
$ ulimit -n

should show 2000. IIRC the default max fds on macOS is 256

Quite possibly related to https://github.com/libuv/libuv/issues/387.

@adambowles Can you check if https://github.com/libuv/libuv/pull/1572 makes a difference?

curl -L https://github.com/libuv/libuv/pull/1572.patch | git am --directory=deps/uv to apply, followed by ./configure && make -j8 to (re)build.

I'm not sure where I should be applying that patch @bnoordhuis

To this repo.

Okay, I've patched and building atm

> ./node -v
v9.0.0-pre
> cd ../project && ../node/node scripts/test.js
2017-10-02 11:38 node[63244] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2017-10-02 11:38 node[63244] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: Error watching file for changes: EMFILE
    at _errnoException (util.js:1021:13)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1369:9)

So yeah, same error output

Okay, thanks. Errno -22 is EINVAL but it's anybody's guess why that happens.

It's happening inside FSEvents.framework but whether that's because of a bug in node/libuv or the framework, I can't say (and have no way to reproduce, let alone debug.)

I don't really understand all this low level stuff. I found this issue while searching for this error message trying to get react-native run-ios running on a new High Sierra install. FWIW @adambowles in tracking the problem I found another repo issue thread (https://github.com/facebook/react-native/issues/10028) which fixed my problem by running brew install watchman

@jbosse Thanks, brew install watchman got my tests to run

Is this still an issue? If yes, can we do something about it on the Node or libuv side?

Doesn't seem like anyone knows what to do here so I'm going to close this out. It's not even clear if this is a Node.js issue. Please do feel free to reopen if you feel that I've made a mistake — just trying to keep the issue tracker a bit tidier.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fanjunzhi picture fanjunzhi  Â·  3Comments

danialkhansari picture danialkhansari  Â·  3Comments

danielstaleiny picture danielstaleiny  Â·  3Comments

srl295 picture srl295  Â·  3Comments

addaleax picture addaleax  Â·  3Comments