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

"ENOENT: no such file or directory" when deleting a file #86

Closed
denchen opened this issue Nov 30, 2016 · 23 comments
Closed

"ENOENT: no such file or directory" when deleting a file #86

denchen opened this issue Nov 30, 2016 · 23 comments

Comments

@denchen
Copy link

denchen commented Nov 30, 2016

I'm not sure this is the right module to open this issue against, but recently I started getting ENOENT: no such file or directory whenever I delete a file in my Ember app tree while ember serve is running.

For example, if I have a global-message-service component, and I run:

% rm -r app/pods/global-message-service

I then see this:

file deleted pods/global-message-service
file deleted pods/global-message-service/service.js
The Broccoli Plugin: [Funnel: Funnel: Filtered App] failed with:
Error: ENOTEMPTY: directory not empty, rmdir '/Users/denchen/git/my-app/tmp/funnel-output_path-ZFVAFCmr.tmp/pods/global-message-service/'
  at Error (native)
  at Object.fs.rmdirSync (fs.js:758:18)
  at Funnel.applyPatch [as _applyPatch] (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/broccoli-funnel/index.js:346:10)
  at Funnel.<anonymous> (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/broccoli-funnel/index.js:318:10)
  at Array.forEach (native)
  at Funnel.processFilters (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/broccoli-funnel/index.js:317:11)
  at Funnel.build (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/broccoli-funnel/index.js:233:10)
  at /Users/denchen/git/my-app/node_modules/ember-cli/node_modules/broccoli-funnel/node_modules/broccoli-plugin/read_compat.js:61:34
  at tryCatch (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:538:12)
  at invokeCallback (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:553:13)
  at publish (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:521:7)
  at flush (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:2373:5)
  at nextTickCallbackWith0Args (node.js:420:9)
  at process._tickCallback (node.js:349:13)

The broccoli plugin was instantiated at: 
  at Funnel.Plugin (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/broccoli-funnel/node_modules/broccoli-plugin/index.js:7:31)
  at new Funnel (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/broccoli-funnel/index.js:57:10)
  at EmberApp._filterAppTree (/Users/denchen/git/my-app/node_modules/ember-cli/lib/broccoli/ember-app.js:679:31)
  at EmberApp._processedAppTree (/Users/denchen/git/my-app/node_modules/ember-cli/lib/broccoli/ember-app.js:793:54)
  at EmberApp.appAndDependencies (/Users/denchen/git/my-app/node_modules/ember-cli/lib/broccoli/ember-app.js:1063:10)
  at EmberApp.javascript (/Users/denchen/git/my-app/node_modules/ember-cli/lib/broccoli/ember-app.js:1199:34)
  at EmberApp.toArray (/Users/denchen/git/my-app/node_modules/ember-cli/lib/broccoli/ember-app.js:1604:10)
  at EmberApp.toTree (/Users/denchen/git/my-app/node_modules/ember-cli/lib/broccoli/ember-app.js:1626:30)
  at module.exports (/Users/denchen/git/my-app/ember-cli-build.js:83:14)
  at CoreObject.module.exports.Task.extend.setupBroccoliBuilder (/Users/denchen/git/my-app/node_modules/ember-cli/lib/models/builder.js:74:19)
  at CoreObject.module.exports.Task.extend.init (/Users/denchen/git/my-app/node_modules/ember-cli/lib/models/builder.js:54:10)
  at CoreObject.superWrapper [as init] (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/core-object/lib/assign-properties.js:32:18)
  at CoreObject.Class (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/core-object/core-object.js:32:33)
  at CoreObject.module.exports.Task.extend.run (/Users/denchen/git/my-app/node_modules/ember-cli/lib/tasks/serve.js:15:19)
  at /Users/denchen/git/my-app/node_modules/ember-cli/lib/commands/serve.js:75:24
  at tryCatch (/Users/denchen/git/my-app/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:538:12)

Deleting the file first instead of the directory also triggers the error. Deleting tmp/ & dist/ before I start the server seems to have no effect.

I can't be sure, but I think the errors started happening when I did a fresh npm install of my Ember app recently. Just to verify it's not a bug I recently introduced on my side, I did a git checkout of my code from late September, did a fresh npm install, and I still see this issue. I see broccoli-funnel has updated recently, which is why I decided to open the issue here.

Any ideas?

@hjdivad
Copy link
Contributor

hjdivad commented Nov 30, 2016

@denchen if you're able to provide a minimally reproducible scenario (eg against an ember new app) that would be great.

If not, can you post the output from npm ls?

Thanks

@hjdivad
Copy link
Contributor

hjdivad commented Nov 30, 2016

@denchen something to try

npm ls fs-tree-diff. If this gives you either 0.5.4 or 0.5.5 can you check to see if you still get your error with 0.5.3?

@denchen
Copy link
Author

denchen commented Nov 30, 2016

@hjdivad I have a minimally(?) reproducible repo here:

https://github.com/denchen/broken-ember-app

This repo was generated from ember init, but using my app's package.json, bower.json, and ember-cli-build.js. Included is npm-shrinkwrap.json so you can see the exact package versions installed. All you have to do to reproduce the error is:

npm install
ember serve
# In another window
rm app/services/test-service.js

And with that, you'll get the errors I'm seeing.

@hjdivad
Copy link
Contributor

hjdivad commented Dec 1, 2016

@denchen ok i wasn't able to install with npm but no matter, i can reproduce this issue with yarn.

This is a regression in fs-tree-diff@0.5.4

@hjdivad
Copy link
Contributor

hjdivad commented Dec 1, 2016

@stefanpenner
Copy link
Contributor

The latest fs-tree-diff (released earlier today) v0.5.6 has fixed this issue (or atleast the one in the example app provided)

Relevant PR:

@denchen
Copy link
Author

denchen commented Dec 15, 2016

Just to validate, I re-NPM'd my app and validated that removing files no longer produces those errors. Thanks!

@stefanpenner
Copy link
Contributor

@denchen thank you for reporting!

@sdhull
Copy link

sdhull commented Nov 13, 2017

I still get errors whenever I remove a file while running ember serve. I've checked fs-tree-diff and my version is 5.7.

Ember CLI version:

$ ember -v
ember-cli: 2.13.3
node: 8.6.0
os: darwin x64

Here's a typical stacktrace:

The Broccoli Plugin: [broccoli-persistent-filter:Babel > [Babel: @ember-decorators/argument]: Babel: @ember-decorators/argument] failed with:
Error: ENOENT: no such file or directory, scandir '/Users/stevehull/Dev/my-app/client/tmp/funnel-input_base_path-31WhveH9.tmp/'
    at Object.fs.readdirSync (fs.js:911:18)
    at _walkSync (/Users/stevehull/Dev/my-app/client/node_modules/walk-sync/index.js:74:18)
    at Function.entries (/Users/stevehull/Dev/my-app/client/node_modules/walk-sync/index.js:50:10)
    at Funnel.processFilters (/Users/stevehull/Dev/my-app/client/node_modules/ember-cli/node_modules/broccoli-funnel/index.js:323:26)
    at Funnel.build (/Users/stevehull/Dev/my-app/client/node_modules/ember-cli/node_modules/broccoli-funnel/index.js:259:10)
    at /Users/stevehull/Dev/my-app/client/node_modules/broccoli-plugin/read_compat.js:93:34
    at tryCatch (/Users/stevehull/Dev/my-app/client/node_modules/rsvp/dist/rsvp.js:525:12)
    at invokeCallback (/Users/stevehull/Dev/my-app/client/node_modules/rsvp/dist/rsvp.js:538:13)
    at publish (/Users/stevehull/Dev/my-app/client/node_modules/rsvp/dist/rsvp.js:508:7)
    at flush (/Users/stevehull/Dev/my-app/client/node_modules/rsvp/dist/rsvp.js:2415:5)

The broccoli plugin was instantiated at:
    at Babel.Plugin (/Users/stevehull/Dev/my-app/client/node_modules/broccoli-plugin/index.js:7:31)
    at Babel.Filter [as constructor] (/Users/stevehull/Dev/my-app/client/node_modules/broccoli-persistent-filter/index.js:64:10)
    at new Babel (/Users/stevehull/Dev/my-app/client/node_modules/broccoli-babel-transpiler/index.js:36:10)
    at Class.transpileTree (/Users/stevehull/Dev/my-app/client/node_modules/ember-cli-babel/index.js:52:18)
    at Object.toTree (/Users/stevehull/Dev/my-app/client/node_modules/ember-cli-babel/index.js:61:30)
    at /Users/stevehull/Dev/my-app/client/node_modules/ember-cli-preprocess-registry/preprocessors.js:180:26
    at Array.forEach (<anonymous>)
    at processPlugins (/Users/stevehull/Dev/my-app/client/node_modules/ember-cli-preprocess-registry/preprocessors.js:178:11)
    at Function.module.exports.preprocessJs (/Users/stevehull/Dev/my-app/client/node_modules/ember-cli-preprocess-registry/preprocessors.js:171:10)
    at Class.preprocessJs (/Users/stevehull/Dev/my-app/client/node_modules/ember-cli/lib/models/addon.js:1172:25)

@hjdivad
Copy link
Contributor

hjdivad commented Nov 13, 2017

@sdhull if you have the cycles to create a minimal scenario for reproducing the error it would help a lot.

@sdhull
Copy link

sdhull commented Nov 13, 2017

Easy to repro locally:

$ ember new foo
$ cd foo
$ ember serve

// new tab
$ ember g service logger
$ rm -f app/services/logger.js

Then look at your previous tab with ember serve, it will look something like this:

file deleted services/logger.js
The Broccoli Plugin: [SimpleConcatConcat] failed with:
Error: ENOENT: no such file or directory, lstat '/Users/stevehull/Dev/foo/tmp/broccoli_persistent_filtereslint_validation_filter-input_base_path-Rl8wIkTc.tmp/services/logger.js'
    at Object.fs.lstatSync (fs.js:948:11)
    at EslintValidationFilter.Filter.isDirectory (/Users/stevehull/Dev/foo/node_modules/broccoli-persistent-filter/index.js:270:23)
    at EslintValidationFilter.Filter.getDestFilePath (/Users/stevehull/Dev/foo/node_modules/broccoli-persistent-filter/index.js:275:12)
    at EslintValidationFilter.getDestFilePath (/Users/stevehull/Dev/foo/node_modules/broccoli-lint-eslint/lib/index.js:123:55)
    at /Users/stevehull/Dev/foo/node_modules/broccoli-persistent-filter/index.js:154:52
    at /Users/stevehull/Dev/foo/node_modules/promise-map-series/index.js:11:14
    at tryCatch (/Users/stevehull/Dev/foo/node_modules/rsvp/dist/rsvp.js:525:12)
    at invokeCallback (/Users/stevehull/Dev/foo/node_modules/rsvp/dist/rsvp.js:538:13)
    at /Users/stevehull/Dev/foo/node_modules/rsvp/dist/rsvp.js:606:14
    at flush (/Users/stevehull/Dev/foo/node_modules/rsvp/dist/rsvp.js:2415:5)

The broccoli plugin was instantiated at:
    at Concat.Plugin (/Users/stevehull/Dev/foo/node_modules/broccoli-plugin/index.js:7:31)
    at new Concat (/Users/stevehull/Dev/foo/node_modules/broccoli-concat/concat.js:38:10)
    at module.exports (/Users/stevehull/Dev/foo/node_modules/broccoli-concat/index.js:26:10)
    at Function.EslintValidationFilter.create (/Users/stevehull/Dev/foo/node_modules/broccoli-lint-eslint/lib/index.js:215:10)
    at Class.lintTree (/Users/stevehull/Dev/foo/node_modules/ember-cli-eslint/index.js:44:19)
    at output.project.addons.map.addon (/Users/stevehull/Dev/foo/node_modules/ember-cli/lib/broccoli/ember-app.js:651:22)
    at Array.map (<anonymous>)
    at EmberApp.addonLintTree (/Users/stevehull/Dev/foo/node_modules/ember-cli/lib/broccoli/ember-app.js:649:38)
    at EmberApp.lintTestTrees (/Users/stevehull/Dev/foo/node_modules/ember-cli/lib/broccoli/ember-app.js:1193:26)
    at EmberApp.appTests (/Users/stevehull/Dev/foo/node_modules/ember-cli/lib/broccoli/ember-app.js:1164:28)

@hjdivad
Copy link
Contributor

hjdivad commented Nov 13, 2017

awesome, thanks @sdhull

@hjdivad
Copy link
Contributor

hjdivad commented Nov 13, 2017

@sdhull can you confirm your global ember-cli is also 2.13.3?

@hjdivad
Copy link
Contributor

hjdivad commented Nov 13, 2017

@sdhull okay I've reproduced on 2.13.3 and confirmed that the issue is fixed by upgrading ember-cli-eslint to @^4.0.0

This is to pick up ember-cli/broccoli-lint-eslint#115

@hjdivad
Copy link
Contributor

hjdivad commented Nov 13, 2017

@sdhull if you want to follow along i'm backporting the fix to 3.x here: ember-cli/broccoli-lint-eslint#119

@hjdivad
Copy link
Contributor

hjdivad commented Nov 14, 2017

@sdhull backported fix released broccoli-lint-eslint@3.3.2 & verified against a new app with ember 2.13.3

@sdhull
Copy link

sdhull commented Nov 14, 2017

Strange, in our yarn.lock file, we have:

ember-cli-eslint@^4.0.0:
  version "4.2.1"
  resolved "https://registry.yarnpkg.com/ember-cli-eslint/-/ember-cli-eslint-4.2.1.tgz#1718875632b3c10fa0da2f665d294c08f24b8ca3"
  dependencies:
    broccoli-lint-eslint "^4.1.0"
    ember-cli-version-checker "^2.1.0"
    rsvp "^4.6.1"
    walk-sync "^0.3.0"

@sdhull
Copy link

sdhull commented Nov 14, 2017

My global ember is 2.13.3. In our project, we've updated to "ember-cli": "~2.16.2",

@hjdivad
Copy link
Contributor

hjdivad commented Nov 14, 2017

@sdhull it's possible you were experiencing a different issue with similar symptoms.

In any case, is the bug present in your project after upgrading?

@sdhull
Copy link

sdhull commented Nov 14, 2017

On my example foo project, after doing npm install broccoli-lint-eslint@3.3.2, it does fix the issue. Let me update my global ember and see if I can create a repro with ember 2.16.2

Really appreciate your help ❤️

@sdhull
Copy link

sdhull commented Nov 14, 2017

Problem doesn't present in a bare app with ember 2.16.2... it must be some combination of our other dependencies 😖

@sdhull
Copy link

sdhull commented Nov 14, 2017

OK so it looks like broccoli-lint-eslint is broken in version 4.2.0 but fixed with version 4.2.1... I had to do yarn upgrade ember-cli-eslint (which went from 4.2.1 => 4.2.2) to fix.

Thanks again @hjdivad 🎉

@hjdivad
Copy link
Contributor

hjdivad commented Nov 14, 2017

@sdhull awesome glad to hear things are working for you now 👍

Happy hacking! 🎉

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

4 participants