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

(cli): "To get rid of this warning, please upgrade to boostrap version >= undefined" #18633

Closed
Plasma opened this issue Jan 25, 2022 · 19 comments
Assignees
Labels
bug This issue is a bug. p1 package/tools Related to AWS CDK Tools or CLI

Comments

@Plasma
Copy link
Contributor

Plasma commented Jan 25, 2022

What is the problem?

The output of cdk diff and cdk deploy are showing the following console warning after printing stack names:

(To get rid of this warning, please upgrade to bootstrap version >= undefined)

For example:

> cdk diff --profile MyProfile
Including dependency stacks: MyStack
Stack MyStack123
(To get rid of this warning, please upgrade to bootstrap version >= undefined)
There were no differences
Stack MyStack456
(To get rid of this warning, please upgrade to bootstrap version >= undefined)
There were no differences

Reproduction Steps

Unable to reproduce outside my current CDK project.

What did you expect to happen?

This error to not appear, or the undefined value to indicate a value to upgrade to, or for the error to have been fixed after a cdk bootstrap was ran.

What actually happened?

The error persists even after a npm install -g aws-cdk, cdk boostrap --profile MyProfile succeeding, and using the latest .NET AWS CDK at time of writing (1.140.0).

CDK CLI Version

2.8.0 (build 8a5eb49)

Framework Version

No response

Node.js Version

n/a

OS

Windows

Language

.NET

Language Version

1.140.0 C# NuGet

Other information

A brand new cdk init project does not show this error, it must be related to my CDK project.

@Plasma Plasma added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 25, 2022
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Jan 25, 2022
@frjtrifork
Copy link

We are seeing the same warning (for some time now) in our existing aws-cdk typescript project.

We are at 1.140.0 but the warning was also being logged in 1.139.0 (and maybe earlier as well)

@adeelamin15
Copy link

Observing same warning as well with python based aws-cdk project on MacOS and Linux. Using cdk version 2.8.0 and also cdk bootstrap is showing it is up to date.

@NGL321 NGL321 added p1 and removed needs-triage This issue or PR still needs to be triaged. labels Jan 26, 2022
@NGL321
Copy link
Contributor

NGL321 commented Jan 26, 2022

This seems concerning. As long as it is limited to a warning rather than a blocker, I am going to leave it as a high priority rather than urgent and investigate it as such.

If this becomes a blocker, please comment to indicate and we can urgently investigate.

Could you also indicate here whether you are experiencing this in v2 releases as well, or just v1?

@frjtrifork how long is some time? Even a general estimate will help narrow the possible commits that could have introduced this.

@adeelamin15
Copy link

@NGL321 For me it is coming with v2 release. I have been using v2 release since quite a time and it wasn't there. Cannot say about v1.

@frjtrifork
Copy link

frjtrifork commented Jan 26, 2022

@NGL321 Our CICD pipeline that log this in a scheduled nightly run has been disabled for a while. So I don't have a specific time.

I can say that it is not in the logs from the CICD runs performed before December 15 where the pipeline scheduler was disabled. The scheduler was enabled again on January 21 where the warning does appear.

I have been running our cdk scripts locally a few times between Christmas and January 21 and I think I started seeing this around the time I updated to 1.139, but I cannot say for sure. Since it was just a warning I did not put much effort into investigating it.

@zessx
Copy link

zessx commented Jan 26, 2022

I just upgraded from 2.0.0 (using it since early December) to 2.8.0 and now seeing this very same warning.

@Plasma
Copy link
Contributor Author

Plasma commented Jan 26, 2022

I can see this warning was introduced ~16 days ago (cc @corymhall ) at 2256680 tagged with versions v2.8.0, v2.7.0, v1.140.0, v1.139.0.

Reviewing the code above, I don't have any errors printed before the warning, so assume its because stackSdk.didAssumeRole == false being triggered. I can see the PR this code was for at #18277 talks about assuming a role for diff and may have some role requirements?

@NGL321 can confirm its not blocking anything for me, its just a console warning at the moment.

@adeelamin15
Copy link

UPDATE

So it turns out that there was a great mismatch of minor versions between my cdk command line tool installed via npm and python library for cdk i.e. aws-cdk-lib . I just upgraded my requirements.txt to match with the version cdk cli and got rid of this warning.

@frjtrifork
Copy link

frjtrifork commented Jan 26, 2022

@Plasma - nice find.

Even though it is just a warning it would be nice if it at least would provide a version for the message.
If there is no lookupRole for the stack - then undefined is printed making it harder for the user to figure out what to do

In our case it has been almost a year since we did a cdk bootstrap in our production account and we are stil on 1.140.0 in production but will be migrating to 2.x in a few weeks.

const upgradeMessage = `(To get rid of this warning, please upgrade to bootstrap version >= ${stack.lookupRole?.requiresBootstrapStackVersion})`;

@corymhall
Copy link
Contributor

@Plasma @frjtrifork this should be fixed in version 1.40.0 and 2.9.0 (currently being released).

@frjtrifork
Copy link

@corymhall I can confirm the warning is fixed in 1.140.0. I thought I had updated to 1.140.0 - and did a stack diff and got the warning. But had forgotten to do install first so was still using 1.139.0 when I got the warning again. Sorry.

@Plasma
Copy link
Contributor Author

Plasma commented Jan 27, 2022

@corymhall also fixed for me now too with CLI 2.9.0 (build a69725c) thank you; this issue could probably be closed now as resolved.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@ksinkar
Copy link

ksinkar commented Feb 25, 2022

@corymhall Still facing this issue in "aws-cdk": "^2.14.0" (npm only, no python)
Screenshot 2022-02-25 at 08 36 44

@vanniktech
Copy link

Having the same with version 2.28.1

@vleandersson
Copy link

For me, the issue was old credentials. By running cdk deploy -v and looking at the logs it was clear that this was the issue. By using the correct profile with accepted credentials this was resolved.

Running with latest installs; aws-cli/2.7.14 Python/3.9.11 with node "aws-cdk": "^2.31.1" inside yarn 3.2.1

@xZero707
Copy link

xZero707 commented Aug 8, 2022

@vleandersson This doesn't solve the core issue.

@hyavari
Copy link

hyavari commented Aug 8, 2022

I did have the same issue, but the reason was the incorrect profile/account credential that I was using. Maybe it helps someone.

@balassy
Copy link

balassy commented Aug 9, 2023

I could solve this issue with aws sso logout and also logging out from the AWS Management Console in my default browser. Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p1 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests