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

CDK CLI can only be used with apps created by CDK >= 1.10.0 #4294

Closed
btotharye opened this issue Sep 30, 2019 · 11 comments · Fixed by #4307
Closed

CDK CLI can only be used with apps created by CDK >= 1.10.0 #4294

btotharye opened this issue Sep 30, 2019 · 11 comments · Fixed by #4307
Assignees
Labels
bug This issue is a bug. package/tools Related to AWS CDK Tools or CLI

Comments

@btotharye
Copy link

btotharye commented Sep 30, 2019

Reproduction Steps

Only upgraded to CDK 1.10.0 and tried to run cdk diff command

Error Log

CDK CLI can only be used with apps created by CDK >= 1.10.0

Environment

  • CLI Version : 1.10.0 (build 19ae072)
  • Framework Version: 1.10.0 (build 19ae072)
  • OS: OSX Mojave
  • Language : python

This is 🐛 Bug Report

@btotharye btotharye added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 30, 2019
@btotharye
Copy link
Author

I also tried npm install -g [email protected] but still get the same error when trying to run a cdk diff not sure why since cdk --version shows 1.9.0 or where that is happening.

@SomayaB SomayaB added language/python Related to Python bindings package/tools Related to AWS CDK Tools or CLI labels Sep 30, 2019
@chris-sage
Copy link

chris-sage commented Sep 30, 2019

The version check for Node/Typescript is coming from a package named @aws-cdk/cx-api. The check is in a file called versioning.js (path: aws-cdk\node_modules@aws-cdk\cx-api\lib). The check appears to read the manifest file in the cdk.out folder, the version in my manifest.json is always being generated as 0.36.0; therefore I am getting the same issue using aws-cdk 1.10.0 with Node/Typescript.

@btotharye
I think this is also a bug with the Node/Typescript CDK. With regards to the Node/Typescript library aws-cdk version 1.9.0 has package.json file which includes an optimistic version constraint of ^1.9.0 on the @aws-cdk/cx-api package. This means it will will match against all versions greater than 1.x.x

If you go to https://semver.npmjs.com/ and enter a package name of @aws-cdk/cx-api and range ^1.9.0 you'll see that ^1.9.0 also matches 1.10.0.

The only "fix" I found was to take the @aws-cdk in my local node modules and copy it into my npm global package store!

For Python, I'm not so sure.

@btotharye
Copy link
Author

The version check is coming from a package named @aws-cdk/cx-api. The check is in a file called versioning.js (path: aws-cdk\node_modules@aws-cdk\cx-api\lib). The check appears to read the manifest file in the cdk.out folder, my version is always being generated as 0.36.0.

@btotharye
It looks like the aws-cdk version 1.9.0 has package.json file which includes an optimistic version constraint of @awd-cdk/cx-api of ^1.9.0. This means it will will match against all version 1.x.x

If you go to https://semver.npmjs.com/ and enter a package name of @aws-cdk/cx-api and range ^1.9.0 you'll see that ^1.9.0 also matches 1.10.0.

The only "fix" I found was to take the @aws-cdk in my local node modules and copy it into my npm global package store!

Cool thanks for the info

@deanforan
Copy link

I also seen this issue earlier today. I found it to be the aws-cdk core was not at the correct version and even after changing the pip install to use the latest it did not update.
I manually set the pip install of each package to use 1.10.0 and then everything worked as expected.

Hope this helps!

@zahydo
Copy link

zahydo commented Sep 30, 2019

For Typescript I removed the node_modules directory and executed npm install to include all the new dependencies with the new CDK version.

@vgribok
Copy link

vgribok commented Sep 30, 2019

@btotharye I suggest removing "language/python" tag from the bug as the issue is not language-specific. I ran into it today while using .NET CDK. Not having the tag may communicate better the breadth of negative impact this issue is having.

@shivlaks shivlaks removed the language/python Related to Python bindings label Sep 30, 2019
@RomainMuller RomainMuller pinned this issue Sep 30, 2019
@RomainMuller
Copy link
Contributor

A solution to this problem is to upgrade all of your CDK library dependencies to 1.10.0 or greater.

@vgribok
Copy link

vgribok commented Sep 30, 2019

A solution to this problem is to upgrade all of your CDK library dependencies to 1.10.0 or greater.

As a work-around this worked, although breaking changes in 1.10 caused lengthy regression effort today.

@nmussy
Copy link
Contributor

nmussy commented Oct 1, 2019

Maybe a better solution would be to use the locally installed CDK (npx cdk diff) instead of installing it globally? I'm not sure why this isn't recommended in the README.

@nija-at nija-at removed the needs-triage This issue or PR still needs to be triaged. label Oct 1, 2019
rix0rrr added a commit that referenced this issue Oct 1, 2019
In the latest release, we changed the CX protocol, requiring users of a
newer CLI to upgrade their CDK framework libraries (to be safe).

This particular change was actually backwards compatible, so add the
requisite code to the CLI to recognize and fix that condition.

Fixes #4294.
rix0rrr added a commit that referenced this issue Oct 1, 2019
In the latest release, we changed the CX protocol (adding a new artifact
type), requiring users of a newer CLI to upgrade their CDK framework
libraries. This check was originally written to improve safety.

This particular change was actually backwards compatible, so add the
requisite code to the CLI to recognize and fix that condition.

Fixes #4294.
rix0rrr added a commit that referenced this issue Oct 1, 2019
In the latest release, we changed the CX protocol (adding a new artifact
type), requiring users of a newer CLI to upgrade their CDK framework
libraries. This check was originally written to improve safety.

This particular change was actually backwards compatible, so add the
requisite code to the CLI to recognize and fix that condition.

Fixes #4294.
mergify bot pushed a commit that referenced this issue Oct 1, 2019
* fix(cli): make new CLI work with old assembly versions (#4307)

In the latest release, we changed the CX protocol (adding a new artifact
type), requiring users of a newer CLI to upgrade their CDK framework
libraries. This check was originally written to improve safety.

This particular change was actually backwards compatible, so add the
requisite code to the CLI to recognize and fix that condition.

Fixes #4294.

* v1.10.1

See CHANGELOG
@RomainMuller RomainMuller unpinned this issue Oct 3, 2019
@cbroompearson
Copy link

I was able to resolve this issue by upgrading like this.
npm install -g [email protected]

@agalazis
Copy link

agalazis commented Jan 27, 2020

well to anybody having the came issue there is a cdk command in package.json for a reason. Just use that since it will always be inline with your local cdk version ie: yarn cdk synth

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. package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.