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

APFS fsevents #15683

Closed
adambowles opened this issue Sep 29, 2017 · 14 comments
Closed

APFS fsevents #15683

adambowles opened this issue Sep 29, 2017 · 14 comments
Labels
fs Issues and PRs related to the fs subsystem / file system. macos Issues and PRs related to the macOS platform / OSX.

Comments

@adambowles
Copy link

  • 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

@cjihrig
Copy link
Contributor

cjihrig commented Sep 29, 2017

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

@adambowles
Copy link
Author

> ulimit -n
256

Then same error reported on node scripts/test.js

@evanlucas
Copy link
Contributor

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

@Fishrock123 Fishrock123 added fs Issues and PRs related to the fs subsystem / file system. macos Issues and PRs related to the macOS platform / OSX. labels Sep 29, 2017
@bnoordhuis
Copy link
Member

Quite possibly related to libuv/libuv#387.

@bnoordhuis
Copy link
Member

@adambowles Can you check if libuv/libuv#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.

@adambowles
Copy link
Author

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

@bnoordhuis
Copy link
Member

To this repo.

@adambowles
Copy link
Author

Okay, I've patched and building atm

@adambowles
Copy link
Author

> ./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

@bnoordhuis
Copy link
Member

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.)

cjihrig added a commit to cjihrig/node that referenced this issue Oct 5, 2017
Refs: nodejs#15380
Refs: nodejs#15683
Fixes: nodejs#15394
Fixes: nodejs#15770
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Trott pushed a commit to Trott/io.js that referenced this issue Oct 5, 2017
PR-URL: nodejs#15745
Refs: nodejs#15380
Refs: nodejs#15683
Fixes: nodejs#15394
Fixes: nodejs#15770
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jbosse
Copy link

jbosse commented Oct 7, 2017

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 (facebook/react-native#10028) which fixed my problem by running brew install watchman

MylesBorins pushed a commit that referenced this issue Oct 7, 2017
PR-URL: #15745
Refs: #15380
Refs: #15683
Fixes: #15394
Fixes: #15770
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@adambowles
Copy link
Author

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

MylesBorins pushed a commit that referenced this issue Oct 11, 2017
PR-URL: #15745
Refs: #15380
Refs: #15683
Fixes: #15394
Fixes: #15770
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit to addaleax/ayo that referenced this issue Oct 12, 2017
PR-URL: nodejs/node#15745
Refs: nodejs/node#15380
Refs: nodejs/node#15683
Fixes: nodejs/node#15394
Fixes: nodejs/node#15770
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this issue Oct 17, 2017
PR-URL: #15745
Refs: #15380
Refs: #15683
Fixes: #15394
Fixes: #15770
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this issue Oct 25, 2017
PR-URL: #15745
Refs: #15380
Refs: #15683
Fixes: #15394
Fixes: #15770
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@targos
Copy link
Member

targos commented Jul 12, 2018

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

@apapirovski
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. macos Issues and PRs related to the macOS platform / OSX.
Projects
None yet
Development

No branches or pull requests

8 participants