Github action failed on aws-cdk dependency

Viewed 931

we executed the same workflow an hour apart. The initial run was successful and then we received the following error in the subsequent execution:

This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version. (Cloud assembly schema version mismatch: Maximum schema version supported is 15.0.0, but found 16.0.0)

This error occurs in the cdk synth stage. As far as I can tell, we are installing aws-cdk@latest (2.5.0) and our requirements.txt is installing a number of packages. When I compared the dependencies between the two runs I found the following:

Successful build: Collecting aws-cdk.cloud-assembly-schema==1.138.2
Downloading aws_cdk.cloud_assembly_schema-1.138.2-py3-none-any.whl (150 kB)

Failed build: Collecting aws-cdk.cloud-assembly-schema==1.139.0
Downloading aws_cdk.cloud_assembly_schema-1.139.0-py3-none-any.whl (153 kB)

I'm assuming the "latest" version was picked up? However, how can I track this type of information? I have tried a number of searches include aws-cdk versions, aws-cdk 1.139.0 release date, etc... Perhaps, I don't understand the package versioning?

Any feedback is appreciated. Thank you!

1 Answers

This is because the new 1.139 release upgraded the schema version to 16.0.0, whereas 2.5.0 is still on 15.0.0. 16.0.0 in CDKv2 will be included in a future release. In the meantime, install the 1.139 version of the CLI, it will work.

A general way to solve this would be to upgrade your constructs to v2 to never have this mismatch.

GitHub issue.

UPDATE: The latest CDK CLI 2.9.0 supports schema version 16.0.0.

Related