How to pull amplify backend without error? (Might related python env?)

0

Hi,

I tried to pull the backend by the cli command that shows in Amplify console, but got an error. amplify pull --appId xxxxxxxxxx --envName yyyyyyyyyy

My environment: amplify --version 10.0.0 python --version Python 3.9.13 pyenv --version pyenv 2.3.3

How should I do to solve this?

Error: Failed to pull the backend. Report saved: /ar/folders/xp/.... Sending zip File at path: '/xxxxxxxxxx/amplify/backend/amplify-meta.json' does not exist ✖ Sending zip 🛑 ENOENT: no such file or directory, stat '/xxxxxxxxxx/amplify/.temp/#current-cloud-backend/function/xxxxxxxxxx/.venv/bin/python' Error: ENOENT: no such file or directory, stat '/xxxxxxxxxx/amplify/.temp/#current-cloud-backend/function/xxxxxxxxxx/.venv/bin/python' at Object.statSync (fs.js:1131:3) at Object.statSync (pkg/prelude/bootstrap.js:1345:32) at Object.statSync (/snapshot/repo/build/node_modules/graceful-fs/polyfills.js:311:34) at getStatsSync (/snapshot/repo/build/node_modules/fs-extra/lib/util/stat.js:58:18) at Object.checkPathsSync (/snapshot/repo/build/node_modules/fs-extra/lib/util/stat.js:90:33) at copyDirItem (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:119:29) at /snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:113:39 at Array.forEach (<anonymous>) at copyDir (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:113:23) at mkDirAndCopy (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:108:3) at onDir (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:99:25) at getStats (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:45:37) at startCopy (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:38:10) at copyDirItem (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:120:10) at /snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:113:39 at Array.forEach (<anonymous>) at copyDir (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:113:23) at mkDirAndCopy (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:108:3) at onDir (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:99:25) at getStats (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:45:37) at startCopy (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:38:10) at copyDirItem (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:120:10) at /snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:113:39 at Array.forEach (<anonymous>) at copyDir (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:113:23) at mkDirAndCopy (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:108:3) at onDir (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:99:25) at getStats (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:45:37) at startCopy (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:38:10) at copyDirItem (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:120:10) at /snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:113:39 at Array.forEach (<anonymous>) at copyDir (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:113:23) at mkDirAndCopy (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:108:3) at onDir (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:99:25) at getStats (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:45:37) at startCopy (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:38:10) at copyDirItem (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:120:10) at /snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:113:39 at Array.forEach (<anonymous>) at copyDir (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:113:23) at onDir (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:103:10) at getStats (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:45:37) at startCopy (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:38:10) at handleFilterAndCopy (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:33:10) at Object.copySync (/snapshot/repo/build/node_modules/fs-extra/lib/copy-sync/copy-sync.js:26:10) at downloadBackend (/snapshot/repo/build/node_modules/amplify-provider-awscloudformation/lib/attach-backend.js:389:8) at async Object.run (/snapshot/repo/build/node_modules/amplify-provider-awscloudformation/lib/attach-backend.js:116:3) at async Object.attachBackend (/snapshot/repo/build/node_modules/amplify-provider-awscloudformation/lib/index.js:208:3) at async queryProvider (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/attach-backend-steps/a10-queryProvider.js:31:5) at async attachBackend (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/attach-backend.js:38:9) at async Object.run (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/commands/pull.js:70:9) at async Object.executeAmplifyCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:292:9) at async executePluginModuleCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:142:5) at async executeCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:40:9) at async Object.run (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:165:13)

Thanks,

asked 2 years ago223 views
1 Answer
0
Accepted Answer

Hi Michihiro Ota,

I believe this is an issue about incorrect symlinks configured for Amplify files and directories hence causing the failure of amplify pull command.

  • You can find a similar GitHub Issue here.. It shows steps about how you can manually create symlinks and re-upload files in to the s3 deployment bucket for Amplify.
  • Can you please upgrade your Amplify CLI to the latest version (10.3.2 and re run the command of amplify pull.
  • You may also want to confirm that amplify-meta.json file is present in your ../backend sub-directory. To learn more about the amplify files/folders structure and its relevant purpose, please visit this page.

Looking forward to hearing back from you. Hope my insights prove useful.

profile pictureAWS
answered a year ago
  • Hi Raheel,

    Thanks for quick response. After I just deleted the symlinks and followed the other steps, now I can pull normally. Thank you!

  • Hi, That's brilliant :D I am glad it worked for you.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions