Skip to content

add cloud assembly schema version mismatch error to error mapping #2836

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fast-wasps-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/backend-deployer': patch
---

add cloud assembly schema version mismatch error to error mapping
7 changes: 7 additions & 0 deletions packages/backend-deployer/src/cdk_error_mapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@ const testErrorMappings = [
expectedDownstreamErrorMessage: `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 36.0.0, but found 36.1.1)`,
},
{
errorMessage: `Error: Cannot read asset manifest '.amplify/artifacts/cdk.out<escaped stack>.assets.json': Cloud assembly schema version mismatch: Maximum schema version supported is 43.x.x, but found 44.0.0`,
expectedTopLevelErrorMessage:
"Installed 'aws-cdk' is not compatible with installed 'aws-cdk-lib'.",
errorName: 'CDKVersionMismatchError',
expectedDownstreamErrorMessage: `Error: Cannot read asset manifest '.amplify/artifacts/cdk.out<escaped stack>.assets.json': Cloud assembly schema version mismatch: Maximum schema version supported is 43.x.x, but found 44.0.0`,
},
{
errorMessage: `error Command cdk not found. Did you mean cdl?`,
expectedTopLevelErrorMessage: 'Unable to detect cdk installation',
Expand Down
11 changes: 11 additions & 0 deletions packages/backend-deployer/src/cdk_error_mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,17 @@ export class CdkErrorMapper {
errorName: 'CDKVersionMismatchError',
classification: 'ERROR',
},
// Similar to previous error but there are instances of the error that do not mention upgrading CDK CLI or compatible CDK CLI version
{
errorRegex:
/Cannot read asset manifest .*: Cloud assembly schema version mismatch: Maximum schema version supported is .*, but found .*/,
humanReadableErrorMessage:
"Installed 'aws-cdk' is not compatible with installed 'aws-cdk-lib'.",
resolutionMessage:
"Make sure that version of 'aws-cdk' is greater or equal to version of 'aws-cdk-lib'",
errorName: 'CDKVersionMismatchError',
classification: 'ERROR',
},
{
errorRegex: /Command cdk not found/,
humanReadableErrorMessage: 'Unable to detect cdk installation',
Expand Down
Loading