-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Error: watch EMFILE - 0.0.33 #974
Comments
@brandonparsons i am fairly confident you are missing a file/folder, broccoli tells the watcher to watch a nonexistent file and then boom. like the watcher should not be informed, or for some reason a file did exist but was removed for some reason... This isn't really enough information to go one, please provide steps to reproduce on master. Clearly a better error message is needed. |
|
bower install? Without more details or steps to reprouce its hard to help. Is suspect with some improved errors in broccoli filters and the watcher this problem could be made self obvious |
|
I guess I could try |
Have there been any changes in the way // All of this is added to the bottom of Brocfile.js
var pickFiles = require('ember-cli/node_modules/broccoli-static-compiler');
var mergeTrees = require('ember-cli/node_modules/broccoli-merge-trees');
var concatFiles = require('ember-cli/node_modules/broccoli-concat');
/* These are only compiled in development */
if (app.env !== 'production') {
// Used for faking responses in tests
app.import('vendor/route-recognizer/dist/route-recognizer.js');
app.import('vendor/FakeXMLHttpRequest/fake_xml_http_request.js');
app.import('vendor/pretender/pretender.js');
// https://github.com/aexmachina/ember-debug
app.import('vendor/ember-debug/ember-debug.js');
}
/* */
/* Additional Javascript libraries */
app.import('vendor/momentjs/moment.js');
app.import('vendor/ember-simple-auth/ember-simple-auth.js');
app.import('vendor/ember-google-analytics/ember-google-analytics.js');
app.import('vendor/ember-validations/index.js');
app.import('vendor/ember-forms/dist/ember_forms.js');
app.import('vendor/ember-spin-box/dist/ember-spin-box.js');
app.import('vendor/ember-date-picker/dist/ember-date-picker.js');
app.import('vendor/lodash/dist/lodash.min.js');
app.import('vendor/fastclick/lib/fastclick.js');
// Standard Bootstrap javascript
['transition.js', 'dropdown.js', 'collapse.js', 'modal.js', 'tooltip.js', 'popover.js'].forEach(function (path) {
var fullPath = 'vendor/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/' + path;
app.import(fullPath);
});
// Bootstrap for ember
// Careful adding additional modules here - some require full handlebars.js, and by default ember-cli only includes runtime in production
['bs-core.min.js', 'bs-modal.min.js', 'bs-label.min.js', 'bs-button.min.js', 'bs-basic.min.js', 'bs-popover.min.js', 'bs-progressbar.min.js'].forEach(function (path) {
var fullPath = 'vendor/ember-addons.bs_for_ember/dist/js/' + path;
app.import(fullPath);
});
/* */
/* Additional CSS (goes to vendor.css) */
app.import('vendor/alertify.js/themes/alertify.core.css');
app.import('vendor/alertify.js/themes/alertify.default.css');
app.import('vendor/ember-spin-box/dist/ember-spin-box.css');
app.import('vendor/ember-date-picker/dist/ember-date-picker.css');
app.import('vendor/font-awesome/css/font-awesome.min.css');
/* */
/* Import fontawesome fonts */
var fontawesome = pickFiles('vendor/font-awesome/', {
srcDir: '/fonts',
// files: isn't strictly necessary (if left out will load all files), but
// leaving in to be explicit.
files: [
'fontawesome-webfont.ttf',
'fontawesome-webfont.woff',
'fontawesome-webfont.eot',
'FontAwesome.otf',
'fontawesome-webfont.svg'
],
destDir: '/fonts'
});
/* */
/* Import alertify (this is an un-named AMD module, just load into the window.) */
/* In the future, ember-cli may handle un-named modules. */
var alertifyJS = pickFiles('vendor/alertify.js', {
srcDir: '/lib',
files: ['alertify.min.js'],
destDir: '/assets/vendor'
});
/* */
/* Import hello.js (this is an un-named AMD module, just load into the window.) */
/* In the future, ember-cli may handle un-named modules. */
var helloJS = pickFiles('vendor/hello', {
srcDir: '/dist',
files: ['hello.all.min.js'],
destDir: '/assets/vendor'
});
/* */
/* Import headroom.js (no AMD package, just load into the window.) */
var headroom = pickFiles('vendor', {
srcDir: '/',
files: ['headroom.min.js'],
destDir: '/assets/vendor'
});
/* */
/* */
module.exports = mergeTrees([
fontawesome,
alertifyJS,
helloJS,
headroom,
app.toTree() // module.exports = app.toTree();
]);
/* */ |
No dice either on |
broccolijs/broccoli-sane-watcher#8 should help a bit on watching missing files/folders. |
I tried hacking this into my I even did a Watcher.prototype.addWatchDir = function Watcher_addWatchDir(dir) {
if (this.watched[dir]) return;
console.log("Here!");
if (!fs.existsSync(dir)) {
throw new Error('Attempting to watch missing directory: ' + dir);
} I see the |
@brandonparsons when I've run into this kind of stuff, running |
Still errors out :( :(
Still fails. |
FWIW I get this using |
@brandonparsons We were also encountering the same issue on one of my coworkers setup. I was on 0.0.29 and they had 0.0.33. I went through the upgrade process with them and the first thing we noticed was that the I would recommend doing an Once we went through this process, everything worked correctly. I hope this helps! |
Hi @alvincrespo thanks for looking at this. I have done a full |
// Brocfile.js
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp({
name: require('./package.json').name,
minifyCSS: {
enabled: true,
options: {}
},
getEnvJSON: require('./config/environment')
});
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.
app.import({
development: 'vendor/ember-data/ember-data.js',
production: 'vendor/ember-data/ember-data.prod.js'
}, {
'ember-data': [
'default'
]
});
app.import('vendor/ic-ajax/dist/named-amd/main.js', {
'ic-ajax': [
'default',
'defineFixture',
'lookupFixture',
'raw',
'request',
]
});
// module.exports = app.toTree();
// //
// BKP-CUSTOM //
// //
var pickFiles = require('ember-cli/node_modules/broccoli-static-compiler');
var mergeTrees = require('ember-cli/node_modules/broccoli-merge-trees');
var concatFiles = require('ember-cli/node_modules/broccoli-concat');
/* These are only compiled in development */
if (app.env !== 'production') {
// Used for faking responses in tests
app.import('vendor/route-recognizer/dist/route-recognizer.js');
app.import('vendor/FakeXMLHttpRequest/fake_xml_http_request.js');
app.import('vendor/pretender/pretender.js');
// https://github.com/aexmachina/ember-debug
app.import('vendor/ember-debug/ember-debug.js');
}
/* */
/* Additional Javascript libraries */
app.import('vendor/momentjs/moment.js');
app.import('vendor/ember-simple-auth/ember-simple-auth.js');
app.import('vendor/ember-google-analytics/ember-google-analytics.js');
app.import('vendor/ember-validations/index.js');
app.import('vendor/ember-forms/dist/ember_forms.js');
app.import('vendor/ember-spin-box/dist/ember-spin-box.js');
app.import('vendor/ember-date-picker/dist/ember-date-picker.js');
app.import('vendor/lodash/dist/lodash.min.js');
app.import('vendor/fastclick/lib/fastclick.js');
// Standard Bootstrap javascript
['transition.js', 'dropdown.js', 'collapse.js', 'modal.js', 'tooltip.js', 'popover.js'].forEach(function (path) {
var fullPath = 'vendor/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/' + path;
app.import(fullPath);
});
// Bootstrap for ember
// Careful adding additional modules here - some require full handlebars.js, and by default ember-cli only includes runtime in production
['bs-core.min.js', 'bs-modal.min.js', 'bs-label.min.js', 'bs-button.min.js', 'bs-basic.min.js', 'bs-popover.min.js', 'bs-progressbar.min.js'].forEach(function (path) {
var fullPath = 'vendor/ember-addons.bs_for_ember/dist/js/' + path;
app.import(fullPath);
});
/* */
/* Additional CSS (goes to vendor.css) */
app.import('vendor/alertify.js/themes/alertify.core.css');
app.import('vendor/alertify.js/themes/alertify.default.css');
app.import('vendor/ember-spin-box/dist/ember-spin-box.css');
app.import('vendor/ember-date-picker/dist/ember-date-picker.css');
app.import('vendor/font-awesome/css/font-awesome.min.css');
/* */
/* Import fontawesome fonts */
var fontawesome = pickFiles('vendor/font-awesome/', {
srcDir: '/fonts',
// files: isn't strictly necessary (if left out will load all files), but
// leaving in to be explicit.
files: [
'fontawesome-webfont.ttf',
'fontawesome-webfont.woff',
'fontawesome-webfont.eot',
'FontAwesome.otf',
'fontawesome-webfont.svg'
],
destDir: '/fonts'
});
/* */
/* Import alertify (this is an un-named AMD module, just load into the window.) */
/* In the future, ember-cli may handle un-named modules. */
var alertifyJS = pickFiles('vendor/alertify.js', {
srcDir: '/lib',
files: ['alertify.min.js'],
destDir: '/assets/vendor'
});
/* */
/* Import hello.js (this is an un-named AMD module, just load into the window.) */
/* In the future, ember-cli may handle un-named modules. */
var helloJS = pickFiles('vendor/hello', {
srcDir: '/dist',
files: ['hello.all.min.js'],
destDir: '/assets/vendor'
});
/* */
/* Import headroom.js (no AMD package, just load into the window.) */
var headroom = pickFiles('vendor', {
srcDir: '/',
files: ['headroom.min.js'],
destDir: '/assets/vendor'
});
/* */
/* */
module.exports = mergeTrees([
fontawesome,
alertifyJS,
helloJS,
headroom,
app.toTree() // module.exports = app.toTree();
]);
/* */ // package.json
{
"name": "myapp",
"version": "0.0.0",
"private": true,
"directories": {
"doc": "doc",
"test": "test"
},
"scripts": {
"start": "ember server",
"build": "ember build",
"test": "ember test"
},
"repository": "https://bitbucket.org/myapp",
"engines": {
"node": ">= 0.10.0"
},
"author": "Brandon Parsons",
"license": "",
"devDependencies": {
"ember-cli": "0.0.33",
"originate": "0.1.5",
"broccoli-ember-hbs-template-compiler": "^1.5.0",
"express": "^4.1.1",
"body-parser": "^1.2.0",
"glob": "^3.2.9",
"broccoli-coffee": "^0.1.0",
"broccoli-sass": "^0.1.4"
}
} |
@brandonparsons Can you paste in your bower.json as well? |
// bower.json
{
"name": "myapp",
"dependencies": {
"handlebars": "~1.3.0",
"jquery": "^1.11.1",
"qunit": "~1.12.0",
"ember-qunit": "~0.1.5",
"ember": "1.5.1",
"ember-data": "1.0.0-beta.8",
"ember-resolver": "~0.1.1",
"ic-ajax": "~1.x",
"loader": "stefanpenner/loader.js#1.0.0",
"ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.2",
"ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2",
"ember-qunit-notifications": "^0.0.1",
"ember-cli-test-loader": "rjackson/ember-cli-test-loader#0.0.2",
"pretender": "~0.0.5",
"bootstrap-sass-official": "~3.1.1+2",
"fastclick": "~1.0.1",
"ember-simple-auth": "~0.4.0",
"alertify.js": "~0.3.11",
"ember-google-analytics": "*",
"ember-addons.bs_for_ember": "~0.7.0",
"lodash": "~2.4.1",
"hello": "~0.2.6",
"ember-debug": "~0.3.0",
"ember-validations": "http://builds.dockyard.com.s3.amazonaws.com/ember-validations/ember-validations-latest.js",
"ember-forms": "brandonparsons/ember-forms",
"ember-date-picker": "~0.0.4",
"momentjs": "~2.6.0"
}
} |
v0.0.34 (just released) may provide better errors for you |
Thanks @stefanpenner - I will try that out tonight when I get home. |
@stefanpenner @alvincrespo @rjackson No go on $ ember server
version: 0.0.34
Livereload server on port 35729
Serving on http://0.0.0.0:4200
fs.js:1051
throw errnoException(process._errno, 'watch');
^
Error: watch EMFILE
at errnoException (fs.js:1019:11)
at FSWatcher.start (fs.js:1051:11)
at Object.fs.watch (fs.js:1076:11)
at Watcher.watchdir (/Users/brandon/projects/erp/ember/new-version-ember-app/node_modules/ember-cli/node_modules/broccoli-sane-watcher/node_modules/sane/index.js:184:20)
at Walker.EventEmitter.emit (events.js:98:17)
at /Users/brandon/projects/erp/ember/new-version-ember-app/node_modules/ember-cli/node_modules/broccoli-sane-watcher/node_modules/sane/node_modules/walker/lib/walker.js:69:16
at Object.oncomplete (fs.js:107:15) A fresh, brand-new app works just fine in |
@brandonparsons - Generally, EMFILE means too many files (see article). It is possible that we are keeping more file handles around with the new How many files are in your project? (preferably broken down by |
Total: 22904 |
Interesting tidbit - the app will build without error |
yes, the stack trace indicate that the |
@brandonparsons - Update to 0.0.34 and try |
Yep that works without error. I'll leave it up to you if you want to close this for now, or keep it open for reference. Thanks for the suggestion! I was really hoping to upgrade to 0.0.3x to get the fingerprinting and split asset files 👍 |
so, we shouldn't be watching node_modules at all. |
@stefanpenner - We aren't. That was just a breakdown of files in project I believe. |
Yeah - i just counted up the files in some of the (what I assumed to be relevant) directories. |
Sane has been tested on super massive facebook code bases, so i am wondering if that is the problem. @rjackson we actually use sane for both polling, and watching. -> 52ebf62 If we can demonstrate an repro issue with sane @amasad will likely be interested in knowing. @brandonparsons is there a way to share this project with us privately? |
Are any of the projects that this is failing on open source? so I can try debugging |
@WMeldon can you open an issue on broccoli re: that? |
@amasad unfortunately most OSS ember-cli projects are tiny, and likely don't suffer from it. Honestly neither do any of my larger apps. I suspect some large graph can be created in a demo app. I'll see if i can through together an example app this evening. @WMeldon maybe you have time before me? maybe @lukemelia or @krisselden have an example? |
@stefanpenner I'll give it a shot today and let you know if I make any progress. But I've tried bloating todos and I couldn't replicate it. Might have better luck now that I understand some of this stuff better though. |
Wouldn't this be related to the OSX simultaneous opened files limit ? (Example : https://github.com/Banno/grunt-coffeeify/issues/6) I've had the same issue when adding ckeditor as a dependency and trying to move its folder user pickFiles and mergeTrees. |
The issue for me was doing Doing |
Is there any way we can use pickFiles without watching the folder we picked from ? We usually do not modify vendor files after we updated bower and launched the server so watching those seems like wasting resources, doesn't it ? |
in https://github.com/stefanpenner/ember-cli/blob/master/lib/broccoli/ember-app.js#L145 // do not watch vendor/ by default
vendor: unwatchedTree(this.project.pathTo('vendor')), Can confirm this works (provided you add broccoli-unwatched-tree to package.json): var unwatchedTree = require('broccoli-unwatched-tree');
var testSuite = pickFiles(unwatchedTree('vendor'), {
srcDir: '/',
files: [...],
destDir: '/assets'
});
module.exports = mergeTrees([app.toTree(), testSuite]); |
This doesn't work for me :(
As long as ckeditor is picked and merged, I can't launch the server without adding |
It shouldn't.. You don't have an |
I have 3 imports for 3 .js files inside the ckeditor tree but I don't import the whole tree :
But if I comment those, it works. I don't understand, when I import one .js file it watches the containing folder ? |
Just stumbled across this...encountered the same thing with ckeditor |
Having the same issue on OSX 10.9 but the same branch on my Ubuntu machine works fine. I'm using ember-cli 0.0.40 and pickFiles set to only a selected few vendor libs. |
bumping the ulimit fixes it. We have to find some time to align broccoli + sane better to resolve this. |
hmm, ulimit was unlimited on both systems but a couple of restarts on OSX and the build stopped complaining, I know a bit unintelligent but this issue seems intermittent in nature. |
I ran into this issue yesterday. 2014-09-11 10:37 ember 34170 CarbonCore . framework FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21) Using 'ember server --watcher=polling' makes it go away. I'm using ember-cli 0.0.40 |
@ritesh83 - Please update to the latest version, many things have been fixed. We really cannot help much with issues on older versions. |
Hi Robert, Thanks for the reply. Actually I had updated to 0.0.44 and ran into the same problem but I was also getting an error with my bootstrap file: So I reverted back to 0.0.40. It doesn't happen with a new ember-cli project. So there must be something in our Brocfile.js thats breaking things. I can post my Brocfile here or on a separate appropriate thread if you want. At this point things are working with the '--watcher=polling" option and version 0.0.40, so its fine for now. |
Seems like you are rewhatcing the route directory |
@stefanpenner Can you link to line numbers in ember-cli repo where this is happening? Maybe I can help with a patch. |
@shwoodard i don't think its in ember-cli proper rather a custom broccoli filter or misconfigured/misbehaving add-on. The meta-issue is sane watcher and broccoli are slightly mis-aligned. Sane actually guards against this if used correctly, but broccoli has no concept of top-level root (which is what sane needs to guard against this) (cc @amasad, you should sanity check my above paragraph) |
between broccoli improvements and watchman, we should be fine here. |
@stefanpenner I'm still getting this on |
@thejchap please review the watchman branch and PR. Also providing no other information makes your comment entirely un-actionable for me. |
Linking to said pr for other people who encounter this prior to it being merged: #2458 |
ah thanks for the link. Me and my team have been running with that branch for that last week or two, and its been great. I have some cleanup to do and but it will make it out in the next release. |
Awesome. Yup just switched over and it seems to be working great. Thanks for the work. Using it every day |
I've started getting the following error on upgrade from
0.0.28
to0.0.33
.I'm not sure if this is related to #513, but I don't think it has anything to do with #901 as I haven't installed anything by the name of
ace-builds
.The text was updated successfully, but these errors were encountered: