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

Failed to pull the backend. #14065

Open
2 tasks done
GrowingCompany opened this issue Jan 9, 2025 · 7 comments
Open
2 tasks done

Failed to pull the backend. #14065

GrowingCompany opened this issue Jan 9, 2025 · 7 comments
Labels
pending-triage Issue is pending triage platform-pull Issues related to `amplify pull`

Comments

@GrowingCompany
Copy link

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

18.20.4

Amplify CLI Version

12.14.0

What operating system are you using?

Mac Sequoia 15.1.1

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

no

Describe the bug

I have a published service in the web and work on making a new project with the same amplify server.
While I'm setting up the project, amplify pull has been failed.

Expected behavior

Succeed pull the backend

Reproduction steps

  1. remove all related files,
  • aws-exports.js
  • amplifyconfiguration.json
  1. command amplify pull

  2. put credentials
    ? Please choose the profile you want to use default
    ? Which app are you working on? ###
    ? Pick a backend environment: master
    ? Choose your default editor: Visual Studio Code
    ✔ Choose the type of app that you're building · javascript
    Please tell us about your project
    ? What javascript framework are you using react
    ? Source Directory Path: src
    ? Distribution Directory Path: build
    ? Build Command: npm run-script build
    ? Start Command: npm run-script start

  3. got failed

Project Identifier

76cd9fdb-58cf-4b29-bc4b-ad21fb9b3f02

Log output

Do you plan on modifying this backend? Yes
⠴ Fetching updates to backend environment: master from the cloud.Overrides functionality is not implemented for this category
✔ Successfully pulled backend environment master from the cloud.
✖ There was an error initializing your environment.
🛑 Failed to pull the backend.

Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

PullBackendFault: Failed to pull the backend.
at attachBackend (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/attach-backend.js:55:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/commands/pull.js:64:9)
at async Object.executeAmplifyCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:194:9)
at async executePluginModuleCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:139:5)
at async executeCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:37:9)
at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:121:5)

Unable to parse aws-exports.js. Has this file been modified?
Error: Unable to parse aws-exports.js. Has this file been modified?
at getCurrentAWSExports (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-frontend-javascript/lib/frontend-config-creator.js:301:13)
at getAWSExports (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-frontend-javascript/lib/frontend-config-creator.js:158:35)
at createAWSExports (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-frontend-javascript/lib/frontend-config-creator.js:150:31)
at Object.createFrontendConfigs (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-frontend-javascript/index.js:49:16)
at AmplifyToolkit.onCategoryOutputsChange (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/extensions/amplify-helpers/on-category-outputs-change.js:49:37)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async initializeEnv (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/initialize-env.js:143:9)
at async onSuccess (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/attach-backend.js:81:17)
at async attachBackend (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/attach-backend.js:50:9)
at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/commands/pull.js:64:9)
at async Object.executeAmplifyCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:194:9)
at async executePluginModuleCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:139:5)
at async executeCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:37:9)
at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:121:5)

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@GrowingCompany GrowingCompany added the pending-triage Issue is pending triage label Jan 9, 2025
@ykethan
Copy link
Member

ykethan commented Jan 13, 2025

Hey @GrowingCompany, thank you for reaching out. Wanted to get some additional information on this. were there any changes in the amplify/.config folder?
additionally, is the aws-exports.js file currently empty?

@ykethan ykethan added pending-response Issue is pending response from the issue author platform-pull Issues related to `amplify pull` labels Jan 13, 2025
@GrowingCompany
Copy link
Author

Thanks for the reply.

Yes. While pull the backend, generate amplify/.config and apparently filled in aws-export.js.
For your information, the generated aws-exports.js is the same from the other project using same amplify backend.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Jan 13, 2025
@ykethan
Copy link
Member

ykethan commented Jan 16, 2025

Hey @GrowingCompany, wanted to reconfirm the information provided. On running a pull were the correct config and aws-exports files were generated?
Additionally, could you provide us your use case?
if you are looking to add a new environment you can run amplify add env <env-name> or run amplify init and select if you would like to reuse an existing environment or create a new environment.

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Jan 16, 2025
@GrowingCompany
Copy link
Author

I'm pulling an existing environment on aws-amplify.
As I attached, I made it with ' Successfully pulled backend environment master from the cloud.' when try pull request.
aws-config, amplify folder are apparently made with pull request.
Several tries that removing all files(aws-config, amplify folder) and re-pull had same issues.

Image
Image

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Jan 19, 2025
@GrowingCompany
Copy link
Author

Update.

I've just pulled amplify and got same issue.
I did amplify diagnose --send-report and Project Identifier: 28559d110853dd1193389e8652ee6996.
I think this report let you easily take look into this issue.

Image

@ykethan
Copy link
Member

ykethan commented Jan 21, 2025

@GrowingCompany thank you for the information. From the project identifier, noticed this project appears contain a unmigrated auth resource as the build CloudFormation template uses a yml file.
Could you try downgrading Amplify CLI to v10.0.0, then running a amplify pull. Do let us know if this does till throw an error message.
I would suggest updating the auth resource by running amplify update auth which should should prompt for auth resource migration. On migrating and pushing the resource you should be able to migrate to the latest version and retry the commands.
Additionally, could you provide us information on the project setup? such as frontend framework being used?

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Jan 21, 2025
@GrowingCompany
Copy link
Author

Finally, amplify pull done.

downgrade amplify-cli [email protected] works for the issue.

For your information, project setup specifications below,

  • editor: vscode
  • typeofapp: js
  • framework: react

So should I keep the version of [email protected]?
Is there an issue the latest version of cli?

Image

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-triage Issue is pending triage platform-pull Issues related to `amplify pull`
Projects
None yet
Development

No branches or pull requests

2 participants