O hirunewani blog

Q. aws-cdkがCloud assembly schema version mismatchエラーを吐く

Created at

aws-cdkの関連パッケージのバージョンが一致していない場合、Cloud assembly schema version mismatchエラーが発生する可能性がある。

Table of Contents

状況

次のようなエラーがCI上で発生していた。

$ cdk deploy

cli: import fails with with 'S3 error: Access Denied'

Overview: When using cdk import, the command tries to read a template
          that doesn't exist from the assets bucket.

Affected versions: cli: >=2.161.0 <=2.162.0

More information at: https://github.com/aws/aws-cdk/issues/31716


If you don’t want to see a notice anymore, use "cdk acknowledge <id>". For example, "cdk acknowledge 31716".
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 38.x.x, but found 39.0.0)

調査

上部に出力されている「cli: import fails with with ‘S3 error: Access Denied’」が主原因のように見えるが、落ちたコミットを見るとaws-cdk-cliのバージョンを上げるものであった。

改めて出力を見ると、最下部に「Cloud assembly schema version mismatch: Maximum schema version supported is 38.x.x, but found 39.0.0」とあり、aws-cdkaws-cdk-cliのバージョンが一致していないことが原因であると推測される。

対応

aws-cdkのバージョンも上げることで問題は解消した。