You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multiple e2e matrix jobs fail intermittently with a toolkit-lib error during stack deploy:
NoStack: ❌ <StackName> failed: NoStack: CloudFormationStack object does not hold a stack
This reproduces on a clean main — run 31155239957 (commit ac38354c) had 6 of 40 cells fail this way across unrelated packages (idempotency ×2, logger, event-handler, tracer, parameters), so it is not specific to any one suite or PR. It also appeared on a feature branch at similar rates, independent of the changes there.
CloudTrail for the failing stacks shows a consistent signature: CreateChangeSet succeeds, ExecuteChangeSet succeeds (no errorCode), and ~30s later the toolkit throws NoStack — i.e. the change set executes, but a follow-up DescribeStacks reads the stack back as absent.
Tracing @aws-cdk/toolkit-lib 1.35.0: in deploy-stack.js (monitorDeployment), waitForStackDeploy → stabilizeStack polls DescribeStacks after execute; when that read comes back empty (a read-after-write consistency window on a just-created stack), it throws a DeploymentError. The catch then calls finalState.wrapped to diagnose it, but finalState is the pre-deployCloudFormationStack (empty for a brand-new stack), so .wrapped throws NoStack (cloudformation/stack-helpers.js:58) — masking the underlying stabilization failure. This is the same class of CloudFormation read-after-write / eventual-consistency sensitivity as the polling/throttling issues previously raised upstream (aws/aws-cdk-cli#1709, aws/aws-cdk-cli#1723); it surfaces under the high CFN concurrency of our matrix.
Why is this needed?
6/40 cells red on a clean main run means most e2e runs need a "re-run failed jobs" pass, which wastes maintainer time, burns CI/AWS resources, and erodes trust in the signal (real failures hide among the flakes). It also compounds with the LMI/throttling work already in flight.
Which area does this relate to?
Tests, Automation
Solution
We have several options available but my preference is to fix upstream:
Make the TestStack deploy tolerant of this transient: catch the toolkit NoStack/stabilization error and retry the deploy a small number of times (the stack usually becomes consistent within seconds). Lowest-effort, contained to packages/testing.
Summary
Multiple e2e matrix jobs fail intermittently with a toolkit-lib error during stack deploy:
This reproduces on a clean
main— run 31155239957 (commitac38354c) had 6 of 40 cells fail this way across unrelated packages (idempotency ×2, logger, event-handler, tracer, parameters), so it is not specific to any one suite or PR. It also appeared on a feature branch at similar rates, independent of the changes there.CloudTrail for the failing stacks shows a consistent signature:
CreateChangeSetsucceeds,ExecuteChangeSetsucceeds (noerrorCode), and ~30s later the toolkit throwsNoStack— i.e. the change set executes, but a follow-upDescribeStacksreads the stack back as absent.Tracing
@aws-cdk/toolkit-lib1.35.0: indeploy-stack.js(monitorDeployment),waitForStackDeploy→stabilizeStackpollsDescribeStacksafter execute; when that read comes back empty (a read-after-write consistency window on a just-created stack), it throws aDeploymentError. Thecatchthen callsfinalState.wrappedto diagnose it, butfinalStateis the pre-deployCloudFormationStack(empty for a brand-new stack), so.wrappedthrowsNoStack(cloudformation/stack-helpers.js:58) — masking the underlying stabilization failure. This is the same class of CloudFormation read-after-write / eventual-consistency sensitivity as the polling/throttling issues previously raised upstream (aws/aws-cdk-cli#1709, aws/aws-cdk-cli#1723); it surfaces under the high CFN concurrency of our matrix.Why is this needed?
6/40 cells red on a clean
mainrun means most e2e runs need a "re-run failed jobs" pass, which wastes maintainer time, burns CI/AWS resources, and erodes trust in the signal (real failures hide among the flakes). It also compounds with the LMI/throttling work already in flight.Which area does this relate to?
Tests, Automation
Solution
We have several options available but my preference is to fix upstream:
TestStackdeploy tolerant of this transient: catch the toolkitNoStack/stabilization error and retry the deploy a small number of times (the stack usually becomes consistent within seconds). Lowest-effort, contained topackages/testing.aws-cdk-cli: the post-ExecuteChangeSetlookup instabilizeStack/monitorDeploymentshould tolerate an eventual-consistency window rather than treating an emptyDescribeStacksas terminal, and the error-diagnosis path should not mask the real error withNoStack. (Sibling to Maintenance: build Lambda Layers from source during tests #1709/feat(idempotency): add idempotency decorator #1723.)stackEventPollingInterval/ the stabilization interval reduces the frequency.Acknowledgment