Tools: Fatal error occurred: Error: EMFILE: too many open files

Created on 27 Feb 2020  ·  4Comments  ·  Source: rome/tools

Description:

OSX 10.15.1
Node v12.14.1

Tried to follow the steps in CONTRIBUTING.md but keep running into a too many open files error.

I see the Adding project /... line for about a second and then the error pops up.

Steps To Reproduce

  1. Cloned the repo
❯ git clone [email protected]:facebookexperimental/rome.git
Cloning into 'rome'...
...
Updating files: 100% (8958/8958), done.

❯ cd rome
  1. Ran the help command
❯ scripts/dev-rome --help
⚠ Disk caching has been disabled due to the ROME_CACHE=0 environment variable ⚠
✖ Fatal error occurred: Error: EMFILE: too many open files, watch
  at
  FSEvent.onchange (internal/fs/watchers.js:123:27)
internal/modules/cjs/loader.js:796
    throw err;
    ^

Error: Cannot find module '/tmp/rome-dev/index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
    at Function.Module._load (internal/modules/cjs/loader.js:686:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
  1. Tried again with ROME_CACHE=1
❯ ROME_CACHE=1 scripts/dev-rome --help
⚠ Disk caching has been disabled due to the ROME_CACHE=0 environment variable ⚠
✖ Fatal error occurred: Error: EMFILE: too many open files, watch
  at
  FSEvent.onchange (internal/fs/watchers.js:123:27)
internal/modules/cjs/loader.js:796
    throw err;
    ^

Error: Cannot find module '/tmp/rome-dev/index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
    at Function.Module._load (internal/modules/cjs/loader.js:686:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
  1. Same with build-release
❯ ./scripts/build-release dist
⚠ Disk caching has been disabled due to the ROME_CACHE=0 environment variable ⚠
✖ Fatal error occurred: Error: EMFILE: too many open files, watch
  at
  FSEvent.onchange (internal/fs/watchers.js:123:27)
internal/modules/cjs/loader.js:796
    throw err;
    ^

Error: Cannot find module '/tmp/rome-dev/index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
    at Function.Module._load (internal/modules/cjs/loader.js:686:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Expected Results

Expected to see rome help

confirmed

Most helpful comment

Thanks for the report! Looks like a lot of others were experiencing this with macos on the Discord. I develop on Linux so took a wild guess from the stacktrace that it was something to do with file watching and had a look and found 0bd48c3c6f3e926b2c840dc7937b83632b1f5a5e. I've been told this fixes it, let me know if it doesn't!

All 4 comments

Thanks for the report! Looks like a lot of others were experiencing this with macos on the Discord. I develop on Linux so took a wild guess from the stacktrace that it was something to do with file watching and had a look and found 0bd48c3c6f3e926b2c840dc7937b83632b1f5a5e. I've been told this fixes it, let me know if it doesn't!

I applied the patch but still having same issue. Also, increased my maxfiles limit.

❯ launchctl limit maxfiles
    maxfiles    64000          524288

It worked! Had to change the compiled file. My bad 🤦🏽‍♂️

👍 works for me! Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

linvain picture linvain  ·  4Comments

sebmck picture sebmck  ·  4Comments

yoshixmk picture yoshixmk  ·  4Comments

RaviVaranasi picture RaviVaranasi  ·  5Comments

arslivinski picture arslivinski  ·  5Comments