Skip to content

(cli): cdk diff and cdk deploy hang when CreateChangeSet API returns InternalFailure #1483

@Tietew

Description

@Tietew

Describe the bug

When CreateChangeSet API returns an InternalFailure error, cdk diff and cdk deploy hangs after "creating CloudFormation changeset..." message.

CLI Output with -vvv

$ cdk deploy MyStackName -vvv
[16:48:14] CDK Toolkit CLI version: 2.1121.0 (build 7abdd4e)
(omit)
✨  Synthesis time: xxxxx
(omit)
[16:48:32] Retrieved account ID xxxxxxxxxxxx from disk cache
[16:48:32] [SDK info] CloudFormation.DescribeStacks({"StackName":"MyStackName"}) -> OK
[16:48:32] MyStackName: checking if we can skip deploy
[16:48:32] MyStackName: --no-execute, always creating change set
[16:48:32] MyStackName: deploying...
[16:48:32] Waiting for stack CDKToolkit to finish creating or updating...
[16:48:32] [SDK info] CloudFormation.DescribeStacks({"StackName":"CDKToolkit"}) -> OK
[16:48:32] [SDK info] CloudFormation.DescribeStacks({"StackName":"CDKToolkit"}) -> OK
[16:48:32] Removing existing change set with name cdk-deploy-change-set if it exists
[16:48:32] [SDK info] CloudFormation.DeleteChangeSet({"ChangeSetName":"cdk-deploy-change-set","StackName":"MyStackName"}) -> OK
[16:48:32] Waiting for changeset cdk-deploy-change-set on stack MyStackName to finish deleting...
[16:48:32] [SDK error] CloudFormation.DescribeChangeSet({"ChangeSetName":"cdk-deploy-change-set","StackName":"MyStackName"}) -> ChangeSetNotFoundException: ChangeSet [cdk-deploy-change-set] does not exist
[16:48:32] Attempting to create ChangeSet with name cdk-deploy-change-set to update stack MyStackName
MyStackName: creating CloudFormation changeset...
[16:48:45] Telemetry Sent Successfully
(hangs)

CloudTrail log

{
    "eventVersion": "1.11",
    "userIdentity": {}, // masked
    "eventTime": "2026-05-07T07:48:34Z",
    "eventSource": "cloudformation.amazonaws.com",
    "eventName": "CreateChangeSet",
    "awsRegion": "ap-northeast-1",
    "sourceIPAddress": "xxxxxxxxxxxx",
    "userAgent": "aws-sdk-js/3.1041.0 ua/2.1 os/linux#6.8.0-111-generic lang/js md/nodejs#24.14.1 md/tsc#dev_^5.9.3 api/cloudformation#3.1041.0 m/E aws-cdk/2.1121.0",
    "errorCode": "InternalFailure",
    "errorMessage": "An unknown error occurred",
    "requestParameters": null,
    "responseElements": null,
    "requestID": "xxxxxxxxxxxx",
    "eventID": "xxxxxxxxxxxx",
    "readOnly": false,
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "xxxxxxxxxxxx",
    "eventCategory": "Management",
    "tlsDetails": {
        "tlsVersion": "TLSv1.3",
        "cipherSuite": "TLS_AES_128_GCM_SHA256",
        "clientProvidedHostHeader": "cloudformation.ap-northeast-1.amazonaws.com"
    }
}

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

CDK CLI exits with error message.

Current Behavior

CDK CLI hangs.

Reproduction Steps

No reproduction steps. I'm unsure why CloudFormation occurs the internal error.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.1121.0 (build 7abdd4e)

Framework Version

No response

Node.js Version

v24.14.1

OS

Ubuntu Linux

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions