Open neiled opened 7 years ago
yarn
gave me
yarn install v0.17.8
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
error ENFILE: file table overflow, open '/Users/bgrosse/Library/Caches/Yarn/npm-source-map-0.2.0-dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d/.yarn-metadata.json'
error ENFILE: file table overflow, open '/Users/bgrosse/Library/Caches/Yarn/npm-fsevents-1.0.14-558e8cc38643d8ef40fe45158486d0d25758eee4/.yarn-metadata.json'
error ENFILE: file table overflow, open '/Users/bgrosse/Library/Caches/Yarn/npm-bcrypt-pbkdf-1.0.0-3ca76b85241c7170bf7d9703e7b9aa74630040d4/.yarn-metadata.json'
error ENFILE: file table overflow, open '/Users/bgrosse/Library/Caches/Yarn/npm-ecc-jsbn-0.1.1-0fc73a9ed5f0d53c38193398523ef7e543777505/.yarn-metadata.json'
error ENFILE: file table overflow, open '/Users/bgrosse/Library/Caches/Yarn/npm-jodid25519-1.0.2-06d4912255093419477d425633606e0e90782967/.yarn-metadata.json'
error ENFILE: file table overflow, open '/Users/bgrosse/Library/Caches/Yarn/npm-jsbn-0.1.0-650987da0dd74f4ebf5a11377a2aa2d273e97dfd/.yarn-metadata.json'
error ENFILE: file table overflow, open '/Users/bgrosse/Library/Caches/Yarn/npm-tweetnacl-0.14.3-3da382f670f25ded78d7b3d1792119bca0b7132d/.yarn-metadata.json'
███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 178/1242^
and it just hangs there forever.
Running yarn cache clean
fixed the issue for me.
I'm frequently running into this issue working on a project with a ton of npm dependencies. I see that the onUnexpectedError
handler in the cli module attempts to open more files. Could that be problematic if the unexpected error is a file table overflow?
I think this is an OS X issue: https://github.com/reactioncommerce/reaction-cli/issues/11#issuecomment-246740634
LMK if increasing the limit fixes your problem.
Increasing the limit definitely fixes the file table overflow issue, but it seems like yarn could still avoid hanging when this issue comes up. I modified the onUnexpectedError
method to return before opening those additional files and it looks like it fixes the hanging problem and spits out the correct "file table overflow" message before exiting.
@joeporpeglia - ah, that's great! Can you submit a PR?
I'd be happy to! Should we try to fail gracefully here or just spit out the file table overflow message? It doesn't seem like we can write out to yarn-error.log
, which is the typical flow for onUnexpectedError
.
@joeporpeglia oh yeah, that's tricky. I'd say put the code writing the error log in a try-catch block and report the error from that on the console along with the original one. Special casing for tabl overflow makes sense but there may be other errors like ENOSPC, EROFS etc. that would prevent us from writing the file.
@BYK I must have had my machine in a very specific state the other day because I'm having trouble reproducing the issue now 😞. If you think it's still worth wrapping those IO operations in onUnexpectedError
in a try/catch I can PR the changes: https://github.com/yarnpkg/yarn/compare/master...joeporpeglia:handle-file-table-overflow.
Try this sudo launchctl limit maxfiles 16384 16384 && ulimit -n 16384
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
No other node instances running.
Installed yarn
Ran
in existing project - ALL OK Running
What is the expected behavior?
Please mention your node.js, yarn and operating system version.
MacOS: 10.12.2 (16C67)
Node: 7.4.0
Package file this failed on: