Stack cannot be removed after one errorneous attempt
See original GitHub issueThis is a Bug Report
Stack cannot be removed after one errorneous attempt
For bug reports:
- What went wrong?
Tried to remove the complete stack with
serverless remove
. A configured bucket was not empty. Thus the stack ended up in DELETE_FAILED. Then I emptied the bucket and re-removed. But from now on serverless keeps saying “The specified bucket does not exist” - What did you expect should have happened? Remove the complete stack after all configured buckets are emptied.
- What was the config you used?
provider:
name: aws
runtime: java8
package:
artifact: target/hello-dev.jar
functions:
hello:
handler: com.serverless.Handler
resources:
Resources:
MyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: this-is-my-unique-bucket-5646524860
- What stacktrace or error message from your provider did you see? At first with a non-empty bucket (error is correct)
Serverless: Getting all objects in S3 bucket...
Serverless: Removing objects in S3 bucket...
Serverless: Removing Stack...
Serverless: Checking Stack removal progress...
...Serverless: Deployment failed!
Serverless Error ---------------------------------------
An error occurred while provisioning your stack: MyBucket
- The bucket you tried to delete is not empty.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Forums: forum.serverless.com
Chat: gitter.im/serverless/serverless
Your Environment Information -----------------------------
OS: linux
Node Version: 6.9.1
Serverless Version: 1.13.2
After emptying the bucket
Serverless: Getting all objects in S3 bucket...
Serverless Error ---------------------------------------
The specified bucket does not exist
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Forums: forum.serverless.com
Chat: gitter.im/serverless/serverless
Your Environment Information -----------------------------
OS: linux
Node Version: 6.9.1
Serverless Version: 1.13.2
For feature proposals:
-
What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us. MAYBE serverless has a bug when the current state of the stack is DELETE_FAILED.
-
If there is additional config how would it look
Similar or dependent issues:
Additional Data
- Serverless Framework Version you’re using: Node Version: 6.9.1 Serverless Version: 1.13.2
- Operating System: OS: linux
- Stack Trace:
- Provider Error messages: The specified bucket does not exist
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:25 (16 by maintainers)
Top Results From Across the Web
How do I delete an AWS CloudFormation stack that's stuck in ...
Delete a stack with a dependent object or other dependencies that can't be deleted · Open the AWS CloudFormation console. · Choose the...
Read more >Error while removing project dependency in VS2010
When I tried to remove a dependency of a project, I am getting an error message like "The dependency was added by the...
Read more >Everything you wanted to know about exceptions - PowerShell
When an exception is thrown, that call stack is checked in order for an exception handler to catch it. Terminating and non-terminating errors....
Read more >Error when trying to remove a lightning component's <design ...
These are the steps I performed: 1. Remove use of the involved Lightning Component from all Lightning Page using Lightning App Builder 2....
Read more >Stack is in state and can not be updated - Seed.run
The stack is currently being updated. You cannot make another update if one is currently in progress. You need to wait. If you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Understood. So the DELETE_FAILED is indeed the root of the error. Just read through the AWS CF docs. There is a special note on that state for the stack deletion. So Serverless should do exactly as proposed there. I.e. if SLS detects that a stack is in the DELETE_FAILED state, it should set the bucket resource to RETAIN in RetainResources. Then the delete should succeed afterwards:
Maybe, SLS should set the bucket in RetainResources in any case. Then the delete would succeed everytime and the cleanup would be up to the user completely (IMO ok, as the deployment history might be needed).
UPDATE: Here the AWS Docs link: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeleteStack.html
Dont misinterprete. Im fine with the first error if the bucket isn’t empty. But after I emptied on my own sls should be able to remove the stack. But it does not. It keeps the opinion it’s not removable. Probably a force wouldn’t help. The state of the stack seems to be misinterpreted.