-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fatal error: spawn EMFILE #788
Comments
|
@shama I'm not sure what is meant by file descriptors. The concept confuses me. I am on OSX where this is happening. So a couple of questions
From the way you're answering, it doesn't sound like there's a good solution for this? Thanks for helping me understand. |
@farmersmc the first thing you should do when encountering a problem is try googling the error. This has been answered many times before: https://www.google.no/search?q=Fatal+error%3A+spawn+EMFILE |
@sindresorhus Of course, I did this and didn't see any relevant answers to my problem, only a couple which actually had patches submitted to fix the issue in NodeJS or something else. And because I didn't see anything relevant, I had no basis to understand what was going on. Which is why I asked for help here wondering if it wasn't just me. |
To both @sindresorhus and @shama, I've looked around the web for help and answers to what my problem is but most answers are too vague for me to understand or doesn't really go into what's happening. What I'm reading is that having "too many files open" seems to be what most people are saying but what does this mean? In my code editor? And what does the number |
@farmersmc There are many ways a file descriptor can be opened, read this on what a file descriptor is: http://en.wikipedia.org/wiki/File_descriptor It is technically a security "feature" as to prevent any process from opening too many and crashing your system. For some reason that limit was set to Most of the time So the simple answer is we're doing what we can to avoid this error but the easiest solution is to simply increase your limit. I recommend temporarily (only for your open terminal session) by doing The other solution is to try and open less file descriptors by making sure your matching patterns ( |
@shama Thank you very much for your detailed explanation! It made lots of sense and your last paragraph triggered something that, I think, helped me find the solution to this problem. In the Yeoman generated Gruntfile.js, I noticed that the Compass watch was set to see only Sass files on the root level of the What I thought would solve the problem was to change this: grunt.initConfig({
yeoman: yeomanConfig,
watch: {
compass: {
files: [
'<%= yeoman.app %>/styles/*.{scss,sass}'
]
}
}
}); to this: grunt.initConfig({
yeoman: yeomanConfig,
watch: {
compass: {
files: [
'<%= yeoman.app %>/styles/*.{scss,sass}',
'<%= yeoman.app %>/styles/**/*.{scss,sass}',
'<%= yeoman.app %>/styles/**/**/*.{scss,sass}',
'<%= yeoman.app %>/styles/**/**/**/*.{scss,sass}'
]
}
}
}); So you can see each level of directories I was adding thinking that was the only way to work with files on that level of folders. What I found out after asking around is that I didn't need more than one level of grunt.initConfig({
yeoman: yeomanConfig,
watch: {
compass: {
files: [
'<%= yeoman.app %>/styles/**/*.s{c,a}ss'
]
}
}
}); What I also had no idea about was the fact that when I make changes to Gruntfile.js or other root level files, I must always restart So, considering this solution, I have gone to the Yeoman project to suggest changing the default by updating the Compass watch section. Hopefully it'll be accepted and added to the project. |
Thought I'd mention that the recommended value of |
@sindresorhus just so you know, this issue is now the top post when you google that error message. So your google link is self-referential. |
my ulimit is unlimited, so I don't think that's the issue for me... is there a limit in grunt or possibly compass? I'm also using compass compilation and it crashes for me every minute or two. |
@arcreative my ulimit was set to |
ok, my ulimit was not really set to unlimited. |
Per one of the referencing issues, I found that http://unix.stackexchange.com/questions/108174/how-to-persist-ulimit-settings-in-osx-mavericks works perfectly (until i run two instances of grunt watch 😀). |
Sometimes that change on the limits, don't resolve the issue. so, it's possible do a double check, about what files/folder need to be watched, maybe you can omit some folders, for example: if use bower link in a big projects is common to have the EMFILE error. |
I am building a site using the Yeoman Beta 4 setup with the latest versions of everything.
After using
grunt server
for a while to build my project, and this happens at least once or more daily, I get an error that kills my session and forces me to restart.Fatal error: spawn EMFILE
I've noticed the last two times this has happened that this error occurs right after it tries running the
compass:server
task.Luckily, it doesn't appear to corrupt anything or mess with my files, but it's an annoying issue that continuously pops up and forces me to restart the server.
Does anyone else experience a similar problem?
The text was updated successfully, but these errors were encountered: