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

Too Many file open error #117

Open
chetandhembre opened this issue May 26, 2015 · 5 comments
Open

Too Many file open error #117

chetandhembre opened this issue May 26, 2015 · 5 comments

Comments

@chetandhembre
Copy link

Hi guys ,

I am using code fetch from here and I just upgraded to my packages to later versions.

After starting server I am getting following error

Debug: internal, implementation, error 
    Error: Uncaught error: EMFILE, too many open files
    at globalTr (/Users/chetandhembre/project/examples/hapi-hbs/node_modules/moonboots_hapi/node_modules/moonboots/node_modules/browserify/index.js:546:43)
    at makeTransform (/Users/chetandhembre/project/examples/hapi-hbs/node_modules/moonboots_hapi/node_modules/moonboots/node_modules/browserify/node_modules/module-deps/index.js:250:21)
    at /Users/chetandhembre/project/examples/hapi-hbs/node_modules/moonboots_hapi/node_modules/moonboots/node_modules/browserify/node_modules/module-deps/index.js:225:9
    at Deps.getTransforms (/Users/chetandhembre/project/examples/hapi-hbs/node_modules/moonboots_hapi/node_modules/moonboots/node_modules/browserify/node_modules/module-deps/index.js:230:7)
    at /Users/chetandhembre/project/examples/hapi-hbs/node_modules/moonboots_hapi/node_modules/moonboots/node_modules/browserify/node_modules/module-deps/index.js:365:24
    at onresolve (/Users/chetandhembre/project/examples/hapi-hbs/node_modules/moonboots_hapi/node_modules/moonboots/node_modules/browserify/node_modules/module-deps/index.js:177:14)
    at /Users/chetandhembre/project/examples/hapi-hbs/node_modules/moonboots_hapi/node_modules/moonboots/node_modules/browserify/index.js:475:13
    at /Users/chetandhembre/project/examples/hapi-hbs/node_modules/moonboots_hapi/node_modules/moonboots/node_modules/browserify/node_modules/browser-resolve/index.js:254:13
    at /Users/chetandhembre/project/examples/hapi-hbs/node_modules/moonboots_hapi/node_modules/moonboots/node_modules/browserify/node_modules/resolve/lib/async.js:44:21
    at ondir (/Users/chetandhembre/project/examples/hapi-hbs/node_modules/moonboots_hapi/node_modules/moonboots/node_modules/browserify/node_modules/resolve/lib/async.js:187:3

Can any one help me here ?

@chetandhembre
Copy link
Author

Hey guys ,

I can reproduce bug.. And

at globalTr (node_modules/moonboots_hapi/node_modules/moonboots/node_modules/browserify/index.js:546:43)

This globalTr function is called multiple times in my case
I tried to install dependencies freshly multiple times but problem is still persists.

@fyockm
Copy link
Member

fyockm commented May 26, 2015

Try gruntjs/grunt#788 (comment)

@chetandhembre
Copy link
Author

Yeah .. I tried increasing ulimit but it is not helping much.. After some request it is throwing EMFILE.
I have one question why does browsify opening so much files (in my case 10480) ?
I am testing this after I restarted my system. and only browser tabs are open (max 10).

Interestingly when i revert browserify/resolve@e83630d commit all things looks fine.

Am I missing something here ?

@prust
Copy link

prust commented May 27, 2015

@chetandhembre: browserify/browserify#1003 also proposes increasing ulimit (to 2048), but if you're at 10480, then you'll need to go a lot higher. I'm not sure if that number of open files is excessive or expected.

At first I assumed it was excessive, given your report about it being far higher on the latest version of node-resolve, but after reading the issue that the latest version fixes (browserify/resolve#76), I realized it would be expected to be a lower number on the older (buggy) version.

Perhaps the best way to determine if it's a bug or not would be to examine the files that are open with and without the browserify/resolve@e83630d commit (maybe this article is helpful? I'm guessing you have OSX, maybe the "Unix" instructions will work?)

Usually node packages will use https://github.com/isaacs/node-graceful-fs if they're running into EMFILE errors. It handles a number of things, but its primary purpose is "fs with incremental backoff on EMFILE". If the large number of files is expected, it could be that node-resolve needs to use node-graceful-fs to gracefully handle it.

@chetandhembre
Copy link
Author

@prust thanks for such details response.. I will definitely use your suggestion. May be next weekend I will look into it again

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

3 participants