question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cli: Cloud assembly schema version mismatch with latest versions

See original GitHub issue

Describe the bug

After upgrading everything to latest versions (python libs: 1.154.0, cli version: 2.22.0 (build 1db4b16)), i get the following error:

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 17.0.0, but found 18.0.0)

Expected Behavior

No error.

Current Behavior

Getting error after updating everything to latest.

Reproduction Steps

  1. mkdir cdk-repro
  2. cd cd cdk-repro/
  3. cdk init app --language python
  4. rm -rf .venv/
  5. python3 -m venv .venv
  6. edit requirements.txt to use aws cdk v1:
    aws_cdk.core
    
  7. edit app.py to use aws cdk v1:
    #!/usr/bin/env python3
    import os
    
    from aws_cdk import core as cdk
    
    ...
    
    
  8. edit cdk_repro_stack.py:
    from aws_cdk import core as cdk
    
    class CdkReproStack(cdk.Stack):
    
        def __init__(self, scope: cdk.Construct, construct_id: str, **kwargs) -> None:
            super().__init__(scope, construct_id, **kwargs)
    
  9. python -m pip install -r requirements.txt
  10. cdk synth

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.22.0 (build 1db4b16)

Framework Version

1.154.0

Node.js Version

v16.13.0

OS

ubuntu (windows wsl)

Language

Python

Language Version

Python 3.8.10

Other information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:7
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
adam-kiss-sgcommented, Apr 29, 2022

@mitchboulay

See the official docs: https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html

  1. update requirements.txt:
oldnew
aws_cdk.core
aws_cdk.aws_iam
aws-cdk-lib
  1. update imports
oldnew
from aws_cdk import (
    aws_iam as iam,
    core as cdk,
)
from constructs import Construct
from aws_cdk import (
    Stack,
    CfnOutput,
    aws_iam as iam
)
  1. update cdk.json (remove content of “context”)
  2. remove the python venv, recreate it and do a pip install
  3. i also had to rerun cdk-boostrap on all accounts/regions
1reaction
rix0rrrcommented, May 9, 2022

We had a mistake in our release process, which caused a difference in commits between the latest v1 and v2 to be released. Our apologies.

2.23.0 supports the latest cloud assembly format.

Read more comments on GitHub >

github_iconTop Results From Across the Web

‼️ NOTICE: aws-cdk CLI - "Cloud assembly schema version ...
Please upgrade the CLI to the latest version. (Cloud assembly schema version mismatch: Maximum schema version supported is 10.0.0, but found ...
Read more >
How to solve CDK CLI version mismatch - Stack Overflow
I encountered this issue with a typescript package, after upgrading the cdk in package.json. As Maciej noted upgrading did not seem to work....
Read more >
aws-cdk/cloud-assembly-schema module - AWS Documentation
The schema version is specified in the cloud-assembly.version.json file, under the version property. It follows semantic versioning, but with a small twist.
Read more >
@aws-cdk/cloud-assembly-schema - npm
Cloud Assembly Schema. Latest version: 2.53.0, last published: 3 days ago. Start using @aws-cdk/cloud-assembly-schema in your project by ...
Read more >
Migrating to AWS CDK v2 - the missing GO manual
Please upgrade the CLI to the latest version. (Cloud assembly schema version mismatch: Maximum schema version supported is 9.0.0, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found