-
Notifications
You must be signed in to change notification settings - Fork 4k
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
cdk 2.1.0 synth, diff subcommands fail with "AssertDescription: CDK bootstrap stack version 6 required...". cdk 2.1.0 deploy subcommand succeeds. #17942
cdk 2.1.0 synth, diff subcommands fail with "AssertDescription: CDK bootstrap stack version 6 required...". cdk 2.1.0 deploy subcommand succeeds. #17942
Comments
Correction -
I had interpreted that as failure. Maybe it's not. |
Hey @chowlett 👋🏻 I'm not able to reproduce this on my end with CDK v2.1.0 Could you try deleting |
Thanks @ryparker. I deleted node_modules and reinstalled the dependencies. cdk app version
cdk dependency versions
What do you think about me destroying the CDKToolkit stack, re-bootsrapping, and recreating this repro? FWIW it feels to me like |
@robertd thanks. My issue is that the feature seems not to be working correctly. The version check is "bootstrap version is not 1, 2, 3, 4, 5", i.e. version is >= 6. My bootstrap version is 9 (verified by inspecting the SSM parameter ../cdk-bootstrap/hnb659fds/version). So I should pass this check. But I am failing it. So the cdk variable "BootstrapVersion" that synch is checking must have the value 1, or 2, or 3, or 4, or 5. That value would be wrong. Does that make sense? Thanks. |
@chowlett I was confused too when I first saw it. Mainly because s3 bucket bootstrap version is at 9 as well. But I guess this is the part of the new-style stack synthesis. @njlynch Would mind chiming in on this and clarifying the purpose of always seeing this new |
CDK v2 enables the "new-style stack synthesizer" by default (e.g., With the default synthesizer, the Hope that helps! Let me know if you have any follow-ups on that. |
|
Hello ! Have you found a solution @robertd @chowlett ? Thanks by advance |
@afreyermuth98 Checkout @njlynch 's comment above (#17942 (comment)) |
I'm using context: { "@aws-cdk/core:newStyleStackSynthesis": false }, I tried as
Of course, deploying version 10 with cdk bootstrap and running the test code with newStyle enabled gives me an error. import { App } from "aws-cdk-lib";
import { Template } from "aws-cdk-lib/assertions";
import { FooStack } from "../lib/foo-stack";
import { HogeStack } from "../lib/hoge-stack";
test("snapshot", () => {
const app = new App({
context: { "@aws-cdk/core:newStyleStackSynthesis": false },
});
const fooStack = new FooStack(app, "FooStack");
const fooTemplate = Template.fromStack(fooStack);
expect(fooTemplate.toJSON()).toMatchSnapshot();
const hogeStack = new HogeStack(app, "HogeStack");
const hogeTemplate = Template.fromStack(hogeStack);
expect(hogeTemplate.toJSON()).toMatchSnapshot();
}); |
I thought it would be better if I didn't use the same App all the time, but in the actual production code, which is a bit more complex, a field in Stack a is dependent on a field in Stack b. So if I don't use the App all the time, I get an error. |
I've been doing some research and found out that the content of this issue is not relevant, so I'm going to create a new issue. |
One more necrobump... I had "this problem" with a pipelines stack that worked from from cli cdk deploy. In this case, the cdk project was in a subdirectory of the project and while I was building fine because I included in the commands
|
I am having the same issue. |
I am having the same issue with new linux installation. Can we reopen this issue. Been running cdk boostrap and cdk synth for a newly build app. |
I am facing the same problem. There is any workarround ? |
This is a pretty confusing thing to see when just starting with CDK. I get it now, but I would still consider it a UX bug. |
I just had a fresh install of ...
Rules:
CheckBootstrapVersion:
Assertions:
- Assert:
Fn::Not:
- Fn::Contains:
- - "1"
- "2"
- "3"
- "4"
- "5"
- Ref: BootstrapVersion
AssertDescription: CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI. from @njlynch's comment #17942 (comment)
For the assertion issue also happen in Workaround for typescriptFor those who want to check the result before the first deploy, I suggest to temporarily add "context": {
"@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
"@aws-cdk/core:stackRelativeExports": true,
"@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
"@aws-cdk/aws-lambda:recognizeVersionProps": true,
"@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": true,
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
"@aws-cdk/core:checkSecretUsage": true,
"@aws-cdk/aws-iam:minimizePolicies": true,
+ "@aws-cdk/core:newStyleStackSynthesis": false,
"@aws-cdk/core:target-partitions": [
"aws",
"aws-cn"
]
} |
Hahaha this is a very weird things. It took me some time to realize it wasnt an error and merely an attribute value. I highly recommend it not being the last line on the console |
Why not just fix the UX issue? |
I saw this same thing. Wasn't sure what to think since the output doesn't show up in the examples on https://cdkworkshop.com/. Had to come here to see what was up. |
same here, created new stack and seeing this warning is weird dev experience. |
IF YOU ARE COMING HERE AND STILL NOT UNDERSTANDING THIS THREAD (because you scrolled too fast, like me, and missed @chesterm8's write up) This is NOT an error. YOUR CODE IS FINE. The cdk synth step creates a number of resources for your app. One of those resources is a check that the deploying tool has the correct version. This is an error that would happen, IF you ran This is a "UX" bug because it happens to be the last thing in the diff for the stack after synth, and it catches you unaware and takes a minute to parse out. There is an "easy" fix - print "CDK synth succeeded" on stderr and exit 0 as the last step of synth. |
This documentation needs to be updated to reflect the actual user experience. https://docs.aws.amazon.com/cdk/v2/guide/hello_world.html |
Allow me to communicate that this "error", has wasted many valuable minutes of my life. |
This is very confusing. I've read through the thread and here is what I think I've learned. Please correct me if I'm wrong. The message |
Bumbled my way here too 😅. Feeling stupid. |
There is an 'easier' fix - For AWS to stop publishing tools that mislead and confuse, and to do the job that all AWS customers pay them for. |
I see it's not an error now - but it is really confusing! Hopefully AWS will fix this one day.. |
|
2024 and i just got the "error" and came here to understand how it works LOL |
May 15th, 2024: the struggle continues... Can we please re-open this, with a view to fixing the error message? Proposed text update: Location:
|
Comments on closed issues and PRs are hard for our team to see. |
1 similar comment
Comments on closed issues and PRs are hard for our team to see. |
…sion 6 required" (#31092) ### Issue # (if applicable) Closes #17942. ### Reason for this change The CDK CLI shows the stack template, which includes the CFN Rule `CheckBootstrapVersion`. This rule will fail a deployment if the bootstrap is not right. Customers think this rule is an error message. ### Description of changes Obscure this `CheckBootstrapVersion` Rule from the template when we print it, if it exists. If it is the only Rule, remove the `Rules` section entirely. ### Description of how you validated changes Manual testing, unit tests, and CLI integration tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
What is the problem?
cdk synth
andcdk diff
fail with "AssertDescription: CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." after the template checks SSM for version not 1-5. The actual version in SSM is 9.cdk deploy
succeeds.After the successful
cdk deploy
, the synth and diff continue to fail.Reproduction Steps
cdk init --language typescript
What did you expect to happen?
A clean synth with no errors displayed
A clean diff with no errors displayed
A clean deploy with no errors displayed
What actually happened?
for synth and diff
for deploy - a clean, error-free execution with a CFn template produced as expected.
CDK CLI Version
2.1.0
Framework Version
2.0.0
Node.js Version
16.10.0
OS
macOS Monterey (12.0.1)
Language
Typescript
Language Version
TypeScript 4.2.4
Other information
The bootstrap CDKToolkit stack looks as expected - all of the modern template trappings (the previous bootstrap was legacy). The value of the SSM parameter /cdk-bootstrap/hnb659fds/version is 9, as expected. The cdk-hnb659fds-deploy-role-<account>-<region> role has the appropriate ssm:GetParameter permission for .../cdk-bootstrap/hnb659fds/version. the cdk-hnb659fds-lookup-role-<account>-<region> role has ssm:Get* permission for *.
"old" cdk projects continue to function as expected with
cdk synth
etc.Hoping you can deduce some bozo thing I must have overlooked or done. Thanks for whatever help you can provide.
The text was updated successfully, but these errors were encountered: