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 CLI 12.12.0 #13771

Open
2 tasks done
bergmorten opened this issue May 8, 2024 · 5 comments
Open
2 tasks done

Failed to pull the backend CLI 12.12.0 #13771

bergmorten opened this issue May 8, 2024 · 5 comments
Labels
pending-response Issue is pending response from the issue author pending-triage Issue is pending triage platform-build Issues related to building resources with `amplify build`

Comments

@bergmorten
Copy link

How did you install the Amplify CLI?

amplify build console

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

No response

Amplify CLI Version

12.12.0

What operating system are you using?

als2023 (amplify build console)

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

Nope

Describe the bug

I tried to deploy a new app with the new amplify console, and ran into multiple errors.

  1. Setting node version to 20 was ignored, and first build failed because of node 14 did not meet requirements
  2. Edit then build setting again to set version 20, still ignored
  3. Edit build environment, which suddenly had a _LIVE_UPDATES variable for my branch with node 14, modified this to version 20
  4. Prephase build did now succeed :-), but backend build phase is failing (see log below).
  5. Since amplify-cli 12.12.0 was released today, I then try tied lock it to my last known working version 12.11.1, but build setting and _LIVE_UPDATES with this entry is ignored and 12.12.0 is used.

The error message is that it Failed to pull the backend, and There was an error initializing your environment. Is this because my first build failed?

2024-05-08T15:26:29.577Z [INFO]: # Completed phase: preBuild
# Starting phase: build
2024-05-08T15:26:33.297Z [INFO]: �[0mAmplify AppID found: d280i329tozog7. Amplify App name is: wcs�[0m
2024-05-08T15:26:33.344Z [INFO]: �[0mBackend environment wcs found in Amplify Console app: wcs�[0m
2024-05-08T15:26:35.233Z [WARNING]: - Fetching updates to backend environment: wcs from the cloud.
2024-05-08T15:26:35.544Z [WARNING]: - Building resource api/bathymetry
2024-05-08T15:26:35.582Z [WARNING]: - Building resource api/costExplorer
2024-05-08T15:26:35.601Z [WARNING]: - Building resource api/customerAPI
2024-05-08T15:26:52.800Z [INFO]: ✅ GraphQL schema compiled successfully.
Edit your schema at /codebuild/output/src144640090/src/aws-clients/amplify/backend/api/customerAPI/schema.graphql or place .graphql files in a directory at /codebuild/output/src144640090/src/aws-clients/amplify/backend/api/customerAPI/schema
2024-05-08T15:26:52.805Z [WARNING]: - Building resource api/support
2024-05-08T15:26:52.818Z [WARNING]: - Building resource api/vehicleCertificates
2024-05-08T15:26:52.833Z [WARNING]: - Building resource auth/clientwebe913f698
2024-05-08T15:26:52.875Z [WARNING]: - Building resource auth/userPoolGroups
2024-05-08T15:26:52.901Z [WARNING]: - Building resource custom/SocketServerInterface
2024-05-08T15:26:52.901Z [WARNING]: - Building custom resources
2024-05-08T15:27:05.456Z [WARNING]: - Building resource storage/customerData
2024-05-08T15:27:05.577Z [WARNING]: ✔ Successfully pulled backend environment wcs from the cloud.
2024-05-08T15:27:05.920Z [WARNING]: ✖ There was an error initializing your environment.
2024-05-08T15:27:09.183Z [INFO]: 🛑 Failed to pull the backend.
2024-05-08T15:27:09.190Z [INFO]: Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
2024-05-08T15:27:09.198Z [INFO]:
2024-05-08T15:27:09.198Z [INFO]: Session Identifier: 6119fbfb-77de-45c6-ae3a-4853fae72c93
2024-05-08T15:27:09.244Z [ERROR]: !!! Build failed2024-05-08T15:27:09.244Z [ERROR]: !!! Error: Command failed with exit code 1
2024-05-08T15:27:09.244Z [INFO]: # Starting environment caching...
2024-05-08T15:27:09.244Z [INFO]: # Environment caching completed
2024-05-08T15:27:09.244Z [ERROR]: !!! Error: Command failed with exit code 1
2024-05-08T15:27:09.244Z [INFO]: # Starting environment caching...
2024-05-08T15:27:09.244Z [INFO]: # Environment caching completed

image

image

image

Expected behavior

  1. Allow to set node version when creating a app through console
  2. Allow to set amplify-cli version through build-setting
  3. Build should not fail

Reproduction steps

Try create new app via amplify console, which has a package.json with node requirement of node v20.

Project Identifier

No response

Log output

# Put your logs below this line


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.
@bergmorten bergmorten added the pending-triage Issue is pending triage label May 8, 2024
@bergmorten
Copy link
Author

Update. I manage to set cli version to 12.11.1 (there was still a _LIVE_UPDATES entry for my branch which overwrite the global build setting). I think it is very odd that the console creates environments which duplicates the global variables.

Still the same error with 12.11.1 so 12.12.0 is not the culprit.

@bergmorten
Copy link
Author

Another update.

I then deleted the created backend environment and did a redeploy with amplify cli 12.11.0 and it worked :-)

I do not know if the issue was with 12.12.0 or that the first build failed with incorrect node version....

@ykethan
Copy link
Contributor

ykethan commented May 8, 2024

Hey @bergmorten, thank you for reaching out. Glad to hear you were able to mitigate the issue, if the issue reoccurs could you try adding --debug to the command which should provide some verbose logging. But the change in the node version may be the reason for the failed build, but do let us know if the issue reoccurs.

@ykethan ykethan added pending-response Issue is pending response from the issue author platform-build Issues related to building resources with `amplify build` labels May 8, 2024
@bergmorten
Copy link
Author

What I think happen was that even when preBuild phase was failing the amplify-cli created an empty backend environment. So when preBuild phase was fixed and it did checkout an empty invalid environment.

It should not have created an empty / invalid environment?

The attempts which failed contained these lines:

2024-05-08T15:06:25.556Z [WARNING]: ✔ Successfully pulled backend environment wcs from the cloud.
2024-05-08T15:06:25.841Z [WARNING]: ✖ There was an error initializing your environment.
2024-05-08T15:06:29.195Z [INFO]: 🛑 Failed to pull the backend.

When I deleted the backend environment it did create a new environment.

2024-05-08T16:15:40.672Z [INFO]: �[0mAdding backend environment wcs to AWS Amplify app: XXXXXXXXX

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label May 8, 2024
@ykethan
Copy link
Contributor

ykethan commented May 10, 2024

@bergmorten the branch should pull the backend that the app was connected to. If the backend does not exist it tries to create one for you.

@ykethan ykethan added the pending-response Issue is pending response from the issue author label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-response Issue is pending response from the issue author pending-triage Issue is pending triage platform-build Issues related to building resources with `amplify build`
Projects
None yet
Development

No branches or pull requests

2 participants