ember-cli icon indicating copy to clipboard operation
ember-cli copied to clipboard

Error: EEXIST, file already exists

Open fivetwentysix opened this issue 11 years ago • 133 comments

file changed templates/application.hbs
EEXIST, file already exists '/Users/fivetwentysix/testapp/tmp/caching-writer-dest-dir_GE6biD.tmp'
Error: EEXIST, file already exists '/Users/fivetwentysix/testapp/tmp/caching-writer-dest-dir_GE6biD.tmp'
    at Error (native)
    at Object.fs.symlinkSync (fs.js:852:18)
    at symlink (/Users/fivetwentysix/testapp/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:82:14)
    at Function.symlinkOrCopySync (/Users/fivetwentysix/testapp/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:58:5)
    at /Users/fivetwentysix/testapp/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/index.js:103:21
    at lib$rsvp$$internal$$tryCatch (/Users/fivetwentysix/testapp/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:489:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/fivetwentysix/testapp/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:501:17)
    at lib$rsvp$$internal$$publish (/Users/fivetwentysix/testapp/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:472:11)
    at lib$rsvp$asap$$flush (/Users/fivetwentysix/testapp/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:1290:9)
    at process._tickCallback (node.js:355:11)

Happens when I save any file with ember serve running.

This happens on a brand new project created with ember-cli-0.1.15

Here's a sample repo: https://github.com/fivetwentysix/ember-test-app

fivetwentysix avatar Mar 04 '15 01:03 fivetwentysix

This is happening to me too. Fresh app with 0.1.2-beta.1. Maybe something has changed in a dependency upstream?

https://gist.github.com/Soliah/edc8f012cc9e6800005d

ghost avatar Mar 04 '15 01:03 ghost

Any of you using outputPaths?

https://github.com/ember-cli/ember-cli/issues/3365

btecu avatar Mar 04 '15 02:03 btecu

I'm getting this too, tried with multiple versions of ember-cli. Not using outputPaths as far as I know, just a plain old ember new myapp.

wstrinz avatar Mar 04 '15 03:03 wstrinz

@fivetwentysix aside from stopping the server prior to making changes, have you found any sort of work around for this?

I'm experiencing it too in an unadulterated stock ember app on:

version: 0.2.0-beta.1 node: 0.12.0 npm: 2.1.8

@btecu no outputPaths here. Obviously it's referenced in node_modules/ember-cli/lib/broccoli/ember-app.js but the app i just tested on is a fresh install of ember cli, a newed up app, and no modifications other than rewriting a project file out.

mariozig avatar Mar 04 '15 03:03 mariozig

See also http://stackoverflow.com/questions/28846170/ember-cli-crash-on-rebuild-after-clean-install-what-am-i-doing-wrong

TimothyGu avatar Mar 04 '15 03:03 TimothyGu

Probably a bad idea, but what I did to get around this problem was editing app/node_modules/ember-cli/node_modules/symlink-or-copy/copy-dereference/index.js and replace fs.writeFileSync(dest, contents, { flag: 'wx', mode: srcStats.mode }) with fs.writeFileSync(dest, contents, { flag: 'w', mode: srcStats.mode })

Restart ember server afterwards...

btecu avatar Mar 04 '15 03:03 btecu

Same issue here. See https://github.com/broccolijs/node-symlink-or-copy/issues/4

bobbyhubbard avatar Mar 04 '15 03:03 bobbyhubbard

@bobbyhubbard are you sure it's the same bug? https://github.com/joyent/node/issues/8651 says it was fixed in node: 0.12.0 and i'm definitely seeing it with that version.

mariozig avatar Mar 04 '15 04:03 mariozig

Hi folks - an hour ago, I did an npm update in my project directory. Immediately afterward, I started noticing the same crashing behaviour after changing a file while serving. Like others here, I suspect this has to do with an upstream dependency completely breaking everything, but I have no idea which one it could be. Would it be useful to share the contents of package.json here?

(For the record, the 'already existing' file is tmp/class-tmp_cache_dir-85EAruZ0.tmp , which is only relevant in that it's also a tmp/... file. The last step in the trace is Object.fs.symlinkSync. Would be happy to share the rest of the trace if it'll help.)

stickbyatlas avatar Mar 04 '15 04:03 stickbyatlas

This is why npm needs something similar to gemfile.lock

fivetwentysix avatar Mar 04 '15 05:03 fivetwentysix

If I knew how to reverse / undo npm update, I'd do it in a heartbeat. I can't even parse the output of the command, it's just a jumble of different dependency trees and conflict warnings. Every time I think "maybe Javascript has finally matured," something like this happens, the whole building topples, and I yearn for a classic, vetted language with a massive standard library.

stickbyatlas avatar Mar 04 '15 05:03 stickbyatlas

I'm getting this too. I'm not sure if this works but if you specify "rimraf":"2.2.8" in package.json, it fixes. rimraf 2.3.0 is just released about 7 hours ago from now.

dopin avatar Mar 04 '15 06:03 dopin

Confirming @dopin's suggestion of forcing rimraf to 2.2.8 works. Make sure to add this to dependencies and not devDependencies.

ghost avatar Mar 04 '15 06:03 ghost

@dopin's suggestion did not work for me. I tried cloning (broken), installing (broken), open old files (worked). Something new in the way that cache files are stored. If I just delete all the cache files with the commonatliy of "caching-writer-dest-dir{otherjunkhere}" then it saved ONCE fine. Next time back to broken.

JohnRodney avatar Mar 04 '15 07:03 JohnRodney

Hitting this too just in the last few hours, yikes yikes...

fotinakis avatar Mar 04 '15 07:03 fotinakis

thats the danger of being an early adopter ;)

gevious avatar Mar 04 '15 08:03 gevious

Yup, same here. I just updated Ember to 1.11 beta. If I go back to 1.10, will this go away? EDIT: No it doesn't. Ignore the referenced issue.

EDIT2: It appears that there is an issue when the project is being watched. If I run ember build manually, every time, I don't get any errors.

tehmaestro avatar Mar 04 '15 09:03 tehmaestro

@dopin 's fix works for me too. Additional information: npm install with rimraf v2.3.0:

npm WARN unmet dependency /home/{*}/node_modules/broccoli-caching-writer/node_modules/rimraf requires glob@'^4.4.1' but will load
npm WARN unmet dependency /home/{*}/node_modules/glob,
npm WARN unmet dependency which is version 4.0.5
npm WARN unmet dependency /home/{*}/node_modules/broccoli-es6modules/node_modules/broccoli-caching-writer/node_modules/rimraf requires glob@'^4.4.1' but will load
npm WARN unmet dependency /home/{*}/node_modules/glob,
npm WARN unmet dependency which is version 4.0.5
npm WARN unmet dependency /home/{*}/node_modules/broccoli-es6modules/node_modules/esperanto/node_modules/sander/node_modules/rimraf requires glob@'^4.4.1' but will load
npm WARN unmet dependency /home/{*}/node_modules/glob,
npm WARN unmet dependency which is version 4.0.5
npm WARN unmet dependency /home/{*}/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/node_modules/rimraf requires glob@'^4.4.1' but will load
npm WARN unmet dependency /home/{*}/node_modules/glob,
npm WARN unmet dependency which is version 4.0.5

DenizOkcu avatar Mar 04 '15 10:03 DenizOkcu

Same here!

file changed controllers/journey.js
EEXIST, file already exists '/Users/pro/Workbench/Centrica/Github/home-move/tmp/class-tmp_cache_dir-fIzB9FpE.tmp'
Error: EEXIST, file already exists '/Users/pro/Workbench/Centrica/Github/home-move/tmp/class-tmp_cache_dir-fIzB9FpE.tmp'
    at Object.fs.symlinkSync (fs.js:741:18)
    at symlink (/Users/pro/Workbench/Centrica/Github/home-move/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:82:14)
    at Function.symlinkOrCopySync [as sync] (/Users/pro/Workbench/Centrica/Github/home-move/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:58:5)
    at /Users/pro/Workbench/Centrica/Github/home-move/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/index.js:103:21
    at lib$rsvp$$internal$$tryCatch (/Users/pro/Workbench/Centrica/Github/home-move/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:489:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/pro/Workbench/Centrica/Github/home-move/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:501:17)
    at lib$rsvp$$internal$$publish (/Users/pro/Workbench/Centrica/Github/home-move/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:472:11)
    at Object.lib$rsvp$asap$$flush [as _onImmediate] (/Users/pro/Workbench/Centrica/Github/home-move/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:1290:9)
    at processImmediate [as _immediateCallback] (timers.js:345:15)

olivierlesnicki avatar Mar 04 '15 10:03 olivierlesnicki

I confirm that specifying "rimraf":"2.2.8" as a dependency fixed it.

olivierlesnicki avatar Mar 04 '15 11:03 olivierlesnicki