Amplify-console: Amplify unable to pull backend after importing existing storage

Created on 10 Dec 2020  Â·  4Comments  Â·  Source: aws-amplify/amplify-console

I imported an existing storage by following the instructions here. It works fine locally, but the build pipeline fails when i pushed the code.

Steps to reproduce the behavior:

  1. Follow the 'Import an existing S3 bucket into your Amplify project' instructions on here
  2. push the code to your branch already setup for the amplify CI/CD.
  3. build fails with the below error:
    2020-12-10T14:48:44.753Z [WARNING]: ✖ There was an error initializing your environment. 2020-12-10T14:48:44.754Z [INFO]: Failed to pull the backend. 2020-12-10T14:48:44.756Z [INFO]: storage headless is missing the following inputParams bucketName, region 2020-12-10T14:48:44.759Z [INFO]: Error: storage headless is missing the following inputParams bucketName, region  at ensureHeadlessParameters (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-storage/src/provider-utils/awscloudformation/import/import-s3.ts:443:11)  at headlessImport (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-storage/src/provider-utils/awscloudformation/import/import-s3.ts:392:40)  at exports.importedS3EnvInit (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-storage/src/provider-utils/awscloudformation/import/import-s3.ts:294:18)  at processTicksAndRejections (internal/process/task_queues.js:97:5)  at updateConfigOnEnvInit (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-storage/src/provider-utils/awscloudformation/index.js:84:72)  at /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-storage/src/index.js:147:22 2020-12-10T14:48:44.775Z [ERROR]: !!! Build failed 2020-12-10T14:48:44.775Z [ERROR]: !!! Non-Zero Exit Code detected

Expected behavior
build should not fail

Screenshots
Screen Shot 2020-12-10 at 10 37 02 AM

bug

Most helpful comment

To resolve this error please add the following variables to your environment variables in your build:

AMPLIFY_STORAGE_BUCKET_NAME
AMPLIFY_STORAGE_REGION

These values should correlate to the bucket name and region for your imported storage.

This documentation will guide you to the right page to add these settings:

https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html

Please let us know if there are further issues.

All 4 comments

@ayotise The fix for this issue has been identified and is currently being rolled out to all regions. We will update this thread as the roll out completes.

The same bug, are there any updates?

To resolve this error please add the following variables to your environment variables in your build:

AMPLIFY_STORAGE_BUCKET_NAME
AMPLIFY_STORAGE_REGION

These values should correlate to the bucket name and region for your imported storage.

This documentation will guide you to the right page to add these settings:

https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html

Please let us know if there are further issues.

Works fine after adding the environment variables! Thank you so much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericclemmons picture ericclemmons  Â·  5Comments

AustinZhu picture AustinZhu  Â·  4Comments

BardiaN picture BardiaN  Â·  4Comments

JIoJIaJIu picture JIoJIaJIu  Â·  5Comments

nballenger picture nballenger  Â·  5Comments