When using framework version 1.38.0
with CLI version 1.36.0
, running cdk synth
throws
the following error:
Cloud assembly schema version mismatch: Maximum schema version supported is 1.33.0,
but found 2.0.0. Please upgrade your CLI in order to interact with this app.
While it's clear to me that I need to upgrade the CLI version, I see two problems with this error message:
2.0.0
and 1.33.0
.~ This is not a bug there was a major version bump of the scheme. Cloud assembly
in such a basic functionality of the CDK seems like it can be confusing for many users. While the term is well defined in the CDK documentation I don't think it's common among users. Since the action required from the user is to update the CLI I don't see the added a value of using Cloud assembly
in here.@iliapolo
~Excuse my ignorance on this one but have just hit this error message and can't seem to figure out which version this is referring to and what needs to be upgraded. Does anyone have the fix for this?~
Was being a noob, run npm install -g aws-cdk
to upgrade the CDK CLI.
I'm experiencing this as well and it started just a few days ago. It happens in my CI pipeline. I'll be investigating today but below are some details for anybody else who comes across this ticket.
I suspect this is an issue with CDK because:
CI Environment: Gitlab, using gitlab-runner 12.10.0-rc2 (6c8c540f)
Docker Image: node:lts
(12 at the time of writing)
npm: 6.14.5
cdk version: 1.38.0
$ npm i -g npm
$ npm config set prefix /usr/local
$ npm config set cache .npm
$ npm config set prefer-offline true
$ export AWS_ACCESS_KEY_ID=$CI_DEPLOY_ACCESS_KEY_ID
$ export AWS_SECRET_ACCESS_KEY=$CI_DEPLOY_SECRET_ACCESS_KEY
$ npm i -g aws-cdk
$ npm ci
$ cdk deploy --ci --require-approval=never
Cloud assembly schema version mismatch: Maximum schema version supported is 1.33.0, but found 2.0.0.
Please upgrade your CLI in order to interact with this app.
@baer since you execute npm install -g aws-cdk
before executing cdk deploy
your CLI version should be compatible with the framework version. Can you execute cdk --version
after executing npm install -g aws-cdk
to verify you have the latest version installed?
@NetaNir Agreed, it should, but it looks like the version is 1.36.1 which is... odd. This points to a problem with either Gitlab's CI, Gitlab's CI caching, or pm resolving the wrong version.
$ npm i -g aws-cdk
/usr/local/bin/cdk -> /usr/local/lib/node_modules/aws-cdk/bin/cdk
+ [email protected]
added 213 packages from 187 contributors in 5.208s
I'm going to clear the cache and see what I can learn.
@NetaNir I re-ran the CI job with the --prefer-online
flag which forces a cache invalidation in NPM and got the same result:
$ npm i -g aws-cdk --prefer-online
/usr/local/bin/cdk -> /usr/local/lib/node_modules/aws-cdk/bin/cdk
+ [email protected]
added 213 packages from 187 contributors in 6.908s
When I removed the cache altogether, I got the latest version. You could also use npm install --force
to do the same thing.
$ npm i -g aws-cdk --prefer-online
/usr/local/bin/cdk -> /usr/local/lib/node_modules/aws-cdk/bin/cdk
+ [email protected]
added 213 packages from 187 contributors in 8.379s
The issue appears to be that NPM is checking for semver major on npm install
and that the cached 1.26.1
satisfies that constraint. It looks like aws-cdk
released a breaking change in a semver minor release which could be problematic for others as well depending on how you specify the dependency in the package.json
. See npm-semver for details
@NetaNir you can try to reinstall cdk.
npm uninstall -g cdk
and then
npm install -g aws-cdk
Please make sure if aws-cdk
dependency is pointing to the right cdk version in the package.json file. If not, please run npm install [email protected]
Ran into this issue and fixed this issue as well today. We had a rouge cdk dependency pointing to 1.37 instead of 1.38.
Our fix for this was ensuring that all dependencies (including types) match the version of aws-cdk.
COMMANDS:
pip install --upgrade awscli
And then
npm -g update aws-cdk
SOLVE THE PROBLEM.
npm install -g aws-cdk works for me , Fixed this issue
Let's change the message to:
You are using a CDK CLI version which is older than CDK version used by your app. Please upgrade your CLI to the latest version (or to a version which supports cloud assembly schema version 3.0.0 or above).
Most helpful comment
~Excuse my ignorance on this one but have just hit this error message and can't seem to figure out which version this is referring to and what needs to be upgraded. Does anyone have the fix for this?~
Was being a noob, run
npm install -g aws-cdk
to upgrade the CDK CLI.