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.

"Stack [stack-id] does not exist" while creating a new stack

See original GitHub issue

I run a cdk deploy '*' command to deploy multiple stacks that depend on each other. All of the previous stacks have deployed successfully, however, when I attempt to add a new CDK stack, occasionally (actually quite rarely) I encounter the following error:

 ❌  Attendor-dzhuneyt-redis failed: Error [ValidationError]: Stack [Attendor-dzhuneyt-redis] does not exist
    at Request.extractError (/Users/dzhuneytahmed/PhpstormProjects/attendor/cdk/node_modules/aws-sdk/lib/protocol/query.js:50:29)
    at Request.callListeners (/Users/dzhuneytahmed/PhpstormProjects/attendor/cdk/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/dzhuneytahmed/PhpstormProjects/attendor/cdk/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/dzhuneytahmed/PhpstormProjects/attendor/cdk/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/dzhuneytahmed/PhpstormProjects/attendor/cdk/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/dzhuneytahmed/PhpstormProjects/attendor/cdk/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/dzhuneytahmed/PhpstormProjects/attendor/cdk/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/dzhuneytahmed/PhpstormProjects/attendor/cdk/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/dzhuneytahmed/PhpstormProjects/attendor/cdk/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/Users/dzhuneytahmed/PhpstormProjects/attendor/cdk/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {
  message: 'Stack [Attendor-dzhuneyt-redis] does not exist',
  code: 'ValidationError',
  time: 2020-04-14T08:49:45.963Z,
  requestId: 'a6cbcb26-7a34-44d1-abc8-d7a3b4e4073e',
  statusCode: 400,
  retryable: false,
  retryDelay: 234.4330453810892
}
Stack [Attendor-dzhuneyt-redis] does not exist

Let me emphasise again that this stack did not currently exist prior to running the deployment command. If I retry the command, it will work.

Reproduction Steps

Create a couple of CDK stacks that depend on each other and then create another stack that depends on one of the previously created ones.

Environment

  • CLI Version : 1.32.2 (build e19e206)
  • Framework Version: Not sure what this is
  • OS : macOS Catalina
  • Language : TypeScript

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
magJcommented, Apr 17, 2020

I ran into this after running a --no-execute deployment.
Very confusing error message.
Deleting the review in progress stack fixes it.

Ironic that the solution to an error saying that a stack does not exist, is to delete the stack that exists.

2reactions
winjercommented, Apr 14, 2020

I just experienced this and found that the stack had been created, probably by an earlier invocation, but was in the “review” state because a changeset hadn’t been applied.

Deleting the stack then rerunning cdk resolved this.

The error message could be improved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stack with id does not exist - Seed.run
The reason it shows up as this error is because on the first deployment Serverless Framework tries to create an S3 bucket to...
Read more >
Stack with id [existing stack] does not exist
I found the problem: I ran a test that set env AWS_REGION=us-west-1 , and then tried to deploy in the same terminal instance....
Read more >
Stack with id does not exist? Stack definitely exists
The stack ID in question is an existing CloudFormation stack that definitely exists in the target account. I've googled high & low for...
Read more >
Troubleshooting CloudFormation - AWS Documentation
When you create or update an AWS CloudFormation stack, your stack can fail due to invalid input parameters, unsupported resource property names, or...
Read more >
serverless-deploy failed - ValidationError: Stack with id does ...
The error show that stack does not exist, that means it was not created. Unfortunately, I see here, it is not shown in...
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