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

Previews backend creation fails #1978

Closed
4 tasks done
phcorp opened this issue Jun 18, 2021 · 6 comments
Closed
4 tasks done

Previews backend creation fails #1978

phcorp opened this issue Jun 18, 2021 · 6 comments
Labels
archived This issue has been locked.

Comments

@phcorp
Copy link

phcorp commented Jun 18, 2021

Before opening, please confirm:

App Id

d3mo0reg2kbp24

Region

eu-west-1

Amplify Console feature

Previews

Describe the bug

I enabled previews in my amplify projet. I created a first pull-request which successfully deployed to a preview environment. I created a second pull-request which fails at build step when creating the backend of the preview environment.

Logs:

                                 # Starting phase: build
2021-06-18T13:52:32.919Z [INFO]: �[33mNote: It is recommended to run this command from the root of your app directory�[39m
2021-06-18T13:52:39.507Z [INFO]: �[0mAmplify AppID found:  <private_information>. Amplify App name is:  <private_information>�[0m
2021-06-18T13:52:39.605Z [INFO]: �[0mAdding backend environment pre to AWS Amplify Console app: d3mo0reg2kbp24�[0m
2021-06-18T13:52:39.704Z [WARNING]: - Initializing project in the cloud...
2021-06-18T13:52:44.945Z [INFO]: 
2021-06-18T13:52:44.950Z [INFO]: CREATE_IN_PROGRESS  <private_information> AWS::CloudFormation::Stack Fri Jun 18 2021 13:52:39 GMT+0000 (Coordinated Universal Time) User Initiated
                                 CREATE_IN_PROGRESS UnauthRole                  AWS::IAM::Role             Fri Jun 18 2021 13:52:44 GMT+0000 (Coordinated Universal Time)
                                 CREATE_IN_PROGRESS DeploymentBucket            AWS::S3::Bucket            Fri Jun 18 2021 13:52:44 GMT+0000 (Coordinated Universal Time)
                                 CREATE_IN_PROGRESS AuthRole                    AWS::IAM::Role             Fri Jun 18 2021 13:52:44 GMT+0000 (Coordinated Universal Time)
2021-06-18T13:52:45.026Z [INFO]: 
2021-06-18T13:52:45.027Z [INFO]: CREATE_IN_PROGRESS UnauthRole AWS::IAM::Role Fri Jun 18 2021 13:52:44 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
2021-06-18T13:52:49.931Z [INFO]: 
2021-06-18T13:52:49.933Z [INFO]: CREATE_IN_PROGRESS AuthRole         AWS::IAM::Role  Fri Jun 18 2021 13:52:44 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
                                 CREATE_IN_PROGRESS DeploymentBucket AWS::S3::Bucket Fri Jun 18 2021 13:52:45 GMT+0000 (Coordinated Universal Time) Resource creation Initiated
2021-06-18T13:53:04.943Z [INFO]: 
2021-06-18T13:53:04.945Z [INFO]: CREATE_COMPLETE AuthRole   AWS::IAM::Role Fri Jun 18 2021 13:53:01 GMT+0000 (Coordinated Universal Time)
                                 CREATE_COMPLETE UnauthRole AWS::IAM::Role Fri Jun 18 2021 13:53:01 GMT+0000 (Coordinated Universal Time)
2021-06-18T13:53:09.959Z [INFO]: 
2021-06-18T13:53:09.961Z [INFO]: CREATE_COMPLETE DeploymentBucket            AWS::S3::Bucket            Fri Jun 18 2021 13:53:06 GMT+0000 (Coordinated Universal Time)
                                 CREATE_COMPLETE <private_information> AWS::CloudFormation::Stack Fri Jun 18 2021 13:53:08 GMT+0000 (Coordinated Universal Time)
2021-06-18T13:53:09.986Z [WARNING]: ✔ Successfully created initial AWS cloud resources for deployments.
2021-06-18T13:53:10.053Z [WARNING]: - Uploading files...
2021-06-18T13:53:10.123Z [WARNING]: - Uploading files...
2021-06-18T13:53:10.175Z [WARNING]: - Initializing your environment: pre
2021-06-18T13:53:10.175Z [WARNING]: ✔ Initialized provider successfully.
2021-06-18T13:53:10.885Z [WARNING]: - Updating resources in the cloud. This may take a few minutes...
2021-06-18T13:53:11.824Z [WARNING]: Error updating cloudformation stack
2021-06-18T13:53:11.826Z [WARNING]: ✖ An error occurred when pushing the resources to the cloud
2021-06-18T13:53:11.826Z [WARNING]: ✖ There was an error initializing your environment.
2021-06-18T13:53:11.833Z [INFO]: �[0mError [ValidationError]: No updates are to be performed.�[0m
                                 �[0m    at Request.extractError (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/protocol/query.js:50:29)�[0m
                                 �[0m    at Request.callListeners (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:106:20)�[0m
                                 �[0m    at Request.emit (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:78:10)�[0m
                                 �[0m    at Request.emit (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:688:14)�[0m
                                 �[0m    at Request.transition (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:22:10)�[0m
                                 �[0m    at AcceptorStateMachine.runTo (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/state_machine.js:14:12)�[0m
                                 �[0m    at /root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/state_machine.js:26:10�[0m
                                 �[0m    at Request.<anonymous> (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:38:9)�[0m
                                 �[0m    at Request.<anonymous> (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:690:12)�[0m
                                 �[0m    at Request.callListeners (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:116:18)�[0m
                                 �[0m    at Request.emit (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:78:10)�[0m
                                 �[0m    at Request.emit (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:688:14)�[0m
                                 �[0m    at Request.transition (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:22:10)�[0m
                                 �[0m    at AcceptorStateMachine.runTo (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/state_machine.js:14:12)�[0m
                                 �[0m    at /root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/state_machine.js:26:10�[0m
                                 �[0m    at Request.<anonymous> (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:38:9)�[0m
                                 �[0m    at Request.<anonymous> (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:690:12)�[0m
                                 �[0m    at Request.callListeners (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:116:18)�[0m
                                 �[0m    at callNextListener (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:96:12)�[0m
                                 �[0m    at IncomingMessage.onEnd (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/event_listeners.js:336:13)�[0m
                                 �[0m    at IncomingMessage.emit (events.js:326:22)�[0m
                                 �[0m    at IncomingMessage.EventEmitter.emit (domain.js:483:12)�[0m
                                 �[0m    at endReadableNT (_stream_readable.js:1241:12)�[0m
                                 �[0m    at processTicksAndRejections (internal/process/task_queues.js:84:21) {�[0m
                                 �[0m  code: 'ValidationError',�[0m
                                 �[0m  time: 2021-06-18T13:53:11.824Z,�[0m
                                 �[0m  requestId: '2cbacff3-7161-4381-81b2-7f14f4e04bc0',�[0m
                                 �[0m  statusCode: 400,�[0m
                                 �[0m  retryable: false,�[0m
                                 �[0m  retryDelay: 60.516674828539685�[0m
                                 �[0m}�[0m
2021-06-18T13:53:11.849Z [ERROR]: !!! Build failed
2021-06-18T13:53:11.849Z [ERROR]: !!! Non-Zero Exit Code detected
2021-06-18T13:53:11.849Z [INFO]: # Starting environment caching...
2021-06-18T13:53:11.850Z [INFO]: # Environment caching completed
Terminating logging...

Expected behavior

A preview environment should be created for any pull-request.

Reproduction steps

Go to the application > Click on Previews > Click on a pull-request name > Click on redeploy this version

OR

Launch a build by creating a pull-request

Build Settings

version: 1
backend:
  phases:
    build:
      commands:
        - '# Execute Amplify CLI with the helper script'
        - amplifyPush --simple
frontend:
  phases:
    preBuild:
      commands:
        - yarn
    build:
      commands:
        - yarn build
  artifacts:
    baseDirectory: build
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*
test:
  phases:
    preTest:
      commands:
        - yarn
    test:
      commands:
        - yarn test:ci
  artifacts:
    baseDirectory: coverage
    configFilePath: '**/junit.xml'
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

Additional information

The ideal solution in my case would be to use the same backend for previews, but for an unknown reason I can't as reported here: #448

@github-actions
Copy link

Hi 👋, thanks for opening! While we look into this...

If this issue is related to custom domains, be sure to check the custom domains troubleshooting guide to see if that helps. Also, there is a more general troubleshooting FAQ that may be helpful for other questions.

Lastly, please make sure you've specified the App ID and Region in the issue!

@phcorp phcorp changed the title Previews backend creation failed Previews backend creation fails Jun 18, 2021
@dnoji
Copy link

dnoji commented Jun 18, 2021

I'm having the same issue

@Athena96
Copy link
Contributor

There is currently an issue with v5.0.0 of the Amplify CLI that is causing builds with no backend changes to throw this error you are seeing. As a temporary workaround, you can use a previous version of the cli in the 'Build settings'
tab in the Amplify Console:
Screen Shot 2021-06-18 at 1 17 55 PM

@truecolintracy
Copy link

truecolintracy commented Jun 19, 2021

Having the same issue, however my build has started the process of deleting the backend envs. This morning my Ampllify App build was completely deleted as well.

Screen Shot 2021-06-18 at 6 54 04 PM

@phcorp
Copy link
Author

phcorp commented Aug 2, 2021

I used the workaround provided here: #448 (comment) thanks!

Feel free to close the ticket or leave it open until a fix has been provided to v5

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the archived This issue has been locked. label Oct 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked.
Projects
None yet
Development

No branches or pull requests

5 participants