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

'Bootstrap required' error message has wrong sample command #3091

Closed
1 of 5 tasks
clareliguori opened this issue Jun 26, 2019 · 8 comments
Closed
1 of 5 tasks

'Bootstrap required' error message has wrong sample command #3091

clareliguori opened this issue Jun 26, 2019 · 8 comments
Assignees
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug. management/devenv Related to CDK development/build environment needs-reproduction This issue needs reproduction.

Comments

@clareliguori
Copy link
Member

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.

  • I'm submitting a ...

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior?
    If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce

Running cdk deploy against a stack with a custom resource:

<stack name> failed: Error: This stack uses assets, so the toolkit stack must be deployed to the environment (Run "cdk bootstrap aws://123456789012/us-east-1")
This stack uses assets, so the toolkit stack must be deployed to the environment (Run "cdk bootstrap aws://123456789012/us-east-1")

Following the instructions and running cdk bootstrap aws://123456789012/us-east-1 results in:

Expected environment name in format '<account>/<region>', got: aws://123456789012/us-east-1
  • What is the expected behavior (or behavior of feature suggested)?

Error gives sample cdk bootstrap command in expected format.

  • What is the motivation / use case for changing the behavior or adding this feature?

Useful error message

  • Please tell us about your environment:

    • CDK CLI Version: 0.36.0
    • Module Version: 0.36.0
    • OS: Ubuntu
    • Language: Typescript
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

@clareliguori clareliguori added the needs-triage This issue or PR still needs to be triaged. label Jun 26, 2019
@NGL321 NGL321 added bug This issue is a bug. @aws-cdk/core Related to core CDK functionality management/devenv Related to CDK development/build environment needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels Jun 27, 2019
@ozbillwang
Copy link

ozbillwang commented Jul 23, 2019

Thanks, @clareliguori

I got similar error when run cdk deploy, but with unknown-account/unknown-region

Error: This stack uses assets, so the toolkit stack must be deployed to the environment (Run "cdk bootstrap aws://unknown-account/unknown-region")

After read your notes, I now know how to run cdk bootstrap. There are not enough documents for us to get help in its README

 $ cdk bootstrap aws://1234/ap-southeast-2
 ⏳  Bootstrapping environment aws://1234/ap-southeast-2...
CDKToolkit: creating CloudFormation changeset...
 0/2 | 11:47:23 PM | CREATE_IN_PROGRESS   | AWS::S3::Bucket | StagingBucket
 0/2 | 11:47:24 PM | CREATE_IN_PROGRESS   | AWS::S3::Bucket | StagingBucket Resource creation Initiated
 1/2 | 11:47:46 PM | CREATE_COMPLETE      | AWS::S3::Bucket | StagingBucket
 2/2 | 11:47:48 PM | CREATE_COMPLETE      | AWS::CloudFormation::Stack | CDKToolkit
 ✅  Environment aws://1234/ap-southeast-2 bootstrapped.

The bootstrap, in fact, creates another cloudformation stack to manage the s3 bucket for lambda assets (zip files)

After that, I can run cdk deploy successfully

@eladb eladb self-assigned this Aug 12, 2019
@vegetabill
Copy link

I encountered the same issue. I think the error message is fine but it makes it seem like the AWS account and region are not configured even when they are.

I would just update the error message, if anything.

It informs the user how to fix, namely cdk bootstrap

(using named profiles if that is why it appears as unknown in the msg)

@eladb eladb assigned shivlaks and unassigned eladb Sep 4, 2019
@shivlaks
Copy link
Contributor

@vegetabill what would a more helpful message look like. Fix the command to just Run cdk bootstrap and link to it's documentation?

@jerry-aws - This is probably also an opportunity for us to improve the documentation around bootstrap, what it does, why it's necessary and how the CDK uses it. The documentation likely hasn't been touched in a long time.

@ghost
Copy link

ghost commented Sep 30, 2019

@shivlaks I have a bit on bootstrap in the new troubleshooting topic I'm working on, but I should add it to the Getting Started topic as well. (Even though the example used in Getting Started doesn't need the bootstrap.)

@shivlaks
Copy link
Contributor

shivlaks commented Oct 9, 2019

realized this was already addressed through #3599

@shivlaks shivlaks closed this as completed Oct 9, 2019
@mattiLeBlanc
Copy link

You can also do cdk bootstrap --profile [aws profile name] if you have stored your credentials under the ~/.aws folder.

@el-veee
Copy link

el-veee commented Nov 12, 2020

For the benefit of whoever else finds this, I came across this issue from the "imageScanOnPush" parameter of ecr.Repository

@simsek97
Copy link

Running cdk bootstrap before cdk deploy should be enough.
But I agree, the error message is a bit confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug. management/devenv Related to CDK development/build environment needs-reproduction This issue needs reproduction.
Projects
None yet
Development

No branches or pull requests

9 participants