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

error when i do awsmobile pull

Open stevemao opened this issue 6 years ago • 25 comments

awsmobile project's access information copied to: src/aws-exports.js
contents in #current-backend-info/ is synchronized with the latest in the aws cloud
? sync corresponding contents in backend/ with #current-backend-info/ Yes
(node:82217) UnhandledPromiseRejectionWarning: Error: EEXIST: file already exists, symlink '../mime/cli.js' -> '/Users/stevemao/workdir/news/awsmobilejs/backend/cloud-api/Posts/node_modules/.bin/mime'

Any idea why?

stevemao avatar May 04 '18 08:05 stevemao

We are investigating this issue. This happens at the last step of the pull, the cli is updating the backend (your development) contents with the latest. So the contents in the #current-backend-info is already sync'ed up with the cloud.

UnleashedMind avatar May 04 '18 17:05 UnleashedMind

What is your cli and node version? I was not able to reproduce this error, with the same symlink in the node_modules/.bin folder.

UnleashedMind avatar May 04 '18 18:05 UnleashedMind

$ node -v
v10.0.0

$ npm -v
6.0.0

I tried

$ node -v
v6.10.3

$ npm -v
6.0.0

It gave me the same result.

My system: macOS High Sierra 10.13.2

My dependencies in one of the cloud apis:

"dependencies": {
    "amazon-cognito-identity-js": "^1.16.0",
    "aws-sdk": "^2.49.0",
    "aws-serverless-express": "^3.2.0",
    "body-parser": "^1.17.1",
    "elasticsearch": "^14.2.2",
    "express": "^4.15.2",
    "http-aws-es": "^4.0.0"
  },
  "devDependencies": {},

stevemao avatar May 04 '18 22:05 stevemao

the cli only works for node version 7+, so node version 6.* is not a good choice. Could you please try to use node version 8.9.0? That's the version that's been extensively tested. We haven't tested on node version 10.0.0 yet.

UnleashedMind avatar May 07 '18 18:05 UnleashedMind

I will switch to v8.9.0 and let you know.

Sent from my iPhone

On 8 May 2018, at 4:53 am, UnleashedMind [email protected] wrote:

the cli only works for node version 7+, so node version 6.* is not a good choice. Could you please try to use node version 8.9.0? That's the version that's been extensively tested. We haven't tested on node version 10.0.0 yet.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

stevemao avatar May 07 '18 22:05 stevemao

I just tried it gives me the same result

$ npm version
{ 
  npm: '6.0.0',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.7.0',
  icu: '60.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.10.0',
  openssl: '1.0.2n',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.19.1',
  v8: '6.2.414.50',
  zlib: '1.2.11' }
retrieving the latest backend awsmobile project information
awsmobile project's details logged at:
    awsmobilejs/#current-backend-info/backend-details.json
awsmobile project's specifications logged at:
    awsmobilejs/#current-backend-info/mobile-hub-project.yml
awsmobile project's access information logged at:
    awsmobilejs/#current-backend-info/aws-exports.js
awsmobile project's access information copied to:
    src/aws-exports.js
contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:1014
  return binding.symlink(preprocessSymlinkDestination(target, type, path),
                 ^

Error: EEXIST: file already exists, symlink '../mime/cli.js' -> '/Users/stevemao/workdir/news/awsmobilejs/backend/cloud-api/QueryPosts/node_modules/.bin/mime'
    at Object.fs.symlinkSync (fs.js:1014:18)
    at copySync (/Users/stevemao/.nvm/versions/node/v8.10.0/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/Users/stevemao/.nvm/versions/node/v8.10.0/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/Users/stevemao/.nvm/versions/node/v8.10.0/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/Users/stevemao/.nvm/versions/node/v8.10.0/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/Users/stevemao/.nvm/versions/node/v8.10.0/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/Users/stevemao/.nvm/versions/node/v8.10.0/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

stevemao avatar May 08 '18 01:05 stevemao

Hi i am also facing the same issue:

contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:1014
  return binding.symlink(preprocessSymlinkDestination(target, type, path),
                 ^

Error: EEXIST: file already exists, symlink '../uuid/bin/uuid' -> '/Users/shashwatjain/Projects/Ionic/myApp/awsmobilejs/backend/cloud-api/imageplumber/node_modules/.bin/uuid'
    at Object.fs.symlinkSync (fs.js:1014:18)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

codeyogi911 avatar May 22 '18 12:05 codeyogi911

Do y'all have anything custom going on in your Cloud APIs?

stevekinney avatar May 29 '18 18:05 stevekinney

@stevekinney no

stevemao avatar May 29 '18 23:05 stevemao

Me too, node LTS and new aws amplify project.

New to awsmobile... what could be wrong?


    src/aws-exports.js
contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:1014
  return binding.symlink(preprocessSymlinkDestination(target, type, path),
                 ^

Error: EEXIST: file already exists, symlink '../mime/cli.js' -> '/xxxx/wesbite/awsmobilejs/backend/cloud-api/sampleLambda/node_modules/.bin/mime'
    at Object.fs.symlinkSync (fs.js:1014:18)
    at copySync (/Users/Dylan/.nvm/versions/node/v8.11.2/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/Users/Dylan/.nvm/versions/node/v8.11.2/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/Users/Dylan/.nvm/versions/node/v8.11.2/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/Users/Dylan/.nvm/versions/node/v8.11.2/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/Users/Dylan/.nvm/versions/node/v8.11.2/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/Users/Dylan/.nvm/versions/node/v8.11.2/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

website Dylan$ node -v
v8.11.2

dylan-westbury avatar Jun 05 '18 10:06 dylan-westbury

Here's mine:

contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:1014
  return binding.symlink(preprocessSymlinkDestination(target, type, path),
                 ^

Error: EEXIST: file already exists, symlink '../../../../../../../semver/bin/semver' -> '/xxxx/awsmobilejs/backend/cloud-api/jobs/node_modules/.bin/semver'
    at Object.fs.symlinkSync (fs.js:1014:18)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

node v8.11.2 npm v5.6.0

ianpogi5 avatar Jun 14 '18 00:06 ianpogi5

Here's what I did to recreate the problem.

  1. Create the App in the Mobile Hub AWS console.
  2. Enable Cloud logic.
  3. Create new API.
  4. On your project source code, awsmobile init projectid
  5. awsmobile pull
  6. cd awsmobile/backend/cloud-api/your-api-folder/
  7. Create package.json file
  8. npm install aws-sdk --save
  9. Go back to root folder of your project
  10. awmobile push

ianpogi5 avatar Jun 14 '18 05:06 ianpogi5

Same for me, nothing super custom going on, but I did manually change the remote AWS node version to 8.10 for all API routes in the mobile-hub-project.yml file just before it started happening:

contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:143
    throw err;
    ^

Error: EEXIST: file already exists, symlink '../uuid/bin/uuid' -> '/Users/xxx/react/xxx/awsmobilejs/backend/cloud-api/xxx/node_modules/.bin/uuid'
    at Object.fs.symlinkSync (fs.js:1000:3)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

When I remove the node_modules from the awsmobilejs/backend/cloud-api/xxx folder, and re-run awsmobile push I get a similar error, but from within a different 'package' this time:

Error: EEXIST: file already exists, symlink '../mime/cli.js' -> '/Users/xxx/react/xxx/awsmobilejs/backend/cloud-api/xxx/node_modules/.bin/mime'
    at Object.fs.symlinkSync (fs.js:1000:3)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

The deployed serverless code still works for me in any case, it's just a confusing error!

jtnix avatar Jun 29 '18 20:06 jtnix

Getting something similar when running "awsmobile push". Last thing I did was npm install a new library ("getstream"). Uninstalling it and re-pushing did not fix the error.

node v9.2.0 npm v5.5.1

===== contents in #current-backend-info/ is synchronized with the latest in the aws cloud fs.js:1034 return binding.symlink(preprocessSymlinkDestination(target, type, path), ^

Error: EEXIST: file already exists, symlink '../sshpk/bin/sshpk-conv' -> '/Users/xxx/projects/xxx/awsmobilejs/backend/cloud-api/API/node_modules/.bin/sshpk-conv' at Object.fs.symlinkSync (fs.js:1034:18) at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8) at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7) at Array.forEach () at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14) at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7) at Array.forEach () at copySync (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14) at contents.forEach.content (/usr/local/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7) at Array.forEach ()

realadeel avatar Jul 04 '18 06:07 realadeel

This worked for me: remove node_modules npm install --no-bin-links

Inspiration: https://github.com/joyent/node-sshpk/issues/16

realadeel avatar Jul 04 '18 06:07 realadeel

This worked for me: remove node_modules npm install --no-bin-links

Yup, I googled it and saw that too... Seems like a workaround, not a fix.

stevemao avatar Jul 05 '18 00:07 stevemao

My experience was that it fixed the immediate push. But, if you have pushed these symlinks before, the lambda function will fail with deception causing a cloud formation infinite loop and inability to update or fix the problem without deleting the entire stack and rebuild after manually deleting the #current-backend-Info and .awsmobile/build-info directories.

But even that might not work and you might need to delete the entire cloud formation stack and restart from scratch.

But then the mobile-hub-project.yml might be out of sync and and might be impossible to re-sync.

Good luck!

Sent from my iPhone

On 5 Jul 2018, at 8:16 AM, Steve Mao [email protected] wrote:

This worked for me: remove node_modules npm install --no-bin-links

Yup, I googled it and saw that too... Seems like a work around not a fix.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

jbarwick avatar Jul 05 '18 04:07 jbarwick

I want to emphasize that this issue is really critical... awsmobile publish is completely broken.

stevemao avatar Sep 05 '18 14:09 stevemao

Same issue: -- Lmk how I can help!

awsmobile project's access information copied to:
    app/aws-exports.js
contents in #current-backend-info/ is synchronized with the latest in the aws cloud
fs.js:1014
  return binding.symlink(preprocessSymlinkDestination(target, type, path),
                 ^

Error: EEXIST: file already exists, symlink '../mime/cli.js' -> '/Users/bpeterson/Projects/notify/awsmobilejs/backend/cloud-api/messages/node_modules/.bin/mime'
    at Object.fs.symlinkSync (fs.js:1014:18)
    at copySync (/Users/bpeterson/.nvm/versions/node/v8.11.3/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:58:8)
    at contents.forEach.content (/Users/bpeterson/.nvm/versions/node/v8.11.3/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/Users/bpeterson/.nvm/versions/node/v8.11.3/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/Users/bpeterson/.nvm/versions/node/v8.11.3/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)
    at copySync (/Users/bpeterson/.nvm/versions/node/v8.11.3/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:51:14)
    at contents.forEach.content (/Users/bpeterson/.nvm/versions/node/v8.11.3/lib/node_modules/awsmobile-cli/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7)
    at Array.forEach (<anonymous>)

barrypeterson avatar Sep 19 '18 08:09 barrypeterson

Is there a fix for this, having same issue

nishanthk avatar Oct 18 '18 06:10 nishanthk

Still an issue in 2019 :)

idevelop avatar Jan 24 '19 17:01 idevelop

Yes still an issue .. awsmobile push give Error: EEXIST: file already exists, symlink '../json2csv/bin/json2csv.js' ->

:(

nawwa avatar Feb 12 '19 13:02 nawwa

Removed node_modules and did: npm install --no-bin-links

Seems to work for me.

automatication avatar Feb 12 '19 21:02 automatication

@automatication same, worked today :)

nawwa avatar Apr 25 '19 07:04 nawwa

Still getting the error. Any other workarounds? Not working with removing nodemodules and npm install --no-bin-links

Error: EEXIST: file already exists, symlink '../uuid/bin/uuid' -> '//node_modules/aws-sdk/node_modules/.bin/uuid'

at /node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:7

shivaramani avatar May 09 '19 18:05 shivaramani