ERROR : Stack Deletion Failed: AWSEBRDSDatabase - amazon-web-services

I wanted to delete an ASP.NET MVC application on the Elastic Beanstalk. But before deleting the app I first deleted the RDS server instance linked to the application. The RDS instance got deleted succesfully but now when I try to delete the Elastic Beanstalk application I get the following error message in the console -
Stack deletion failed: The following resources failed to delete AWSEBRDSDatabase
How do I proceed to delete this? I am not able to find any help regarding this issue!

ran across the same issue myself today.. there doesn't appear to be a way to delink the deleted RDS instance in the Elastic Beanstalk configuration sadly. I did however manage to delete the application though by first recreating the RDS instance using the same name as before.
Go to AWS RDS > Intances > Launch DB Instance
recreate the deleted instance using the exact name that was previously used. Once successfully created, go back to Elastic Beanstalk and it allows you to terminate the environment. Bit of a pain but works none the less.
Thanks
TJ

It happened to me and the way I was able to resume the removal of Elasticbeanstalk sucked on this status was to go through CloudFormation panel and remove the stack with failed status as described on: https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-stack-delete-failed/
After that I was able to remove the Environment and Application under Elasticbeanstalk.

I had this error "The following resource(s) failed to delete: [AWSEBRDSDatabase]" this helped me to resolve the problem.
Open the AWS CloudFormation console.
Choose the stack that's stuck in DELETE_FAILED status.
Choose Delete.
Note: A window opens and lists the resources that failed to delete.
4. In the window, select all the resources that you want to retain, and then choose Delete stack.
I checked to retain resource, even though the resource that was retained didn't exist but it helped me to delete it, if I didn't check it it was not deleted
https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-stack-delete-failed/
https://aws.amazon.com/premiumsupport/knowledge-center/elastic-beanstalk-deleted-rds-database/

Related

AWS CodeDeploy overwrite existing files when deploying via AutoScaling

I have an Autoscaling Group that gets scaled/deployed on using CodeDeploy, I had created a working instance and got it all up and running and took an image of it for a launch template, this instance was attached to the Autoscaling group and when I deployed it worked perfectly fine.
However, over the weekend, AWS decided to tear that instance down and create a whole new one, and when it did, the deployment failed because of the error File already exists. I understand what the error is, but I don't understand why it occurred? That deployment had already occurred on that image, so it shouldn't run into that issue....
Anyways, I know when you manually kick off a deployment, you can opt to Overwrite existing files to avoid this error. But I haven't been able to find this setting for when Autoscaling automatically kicks off deployments. How can you allow duplicate files to be overwritten by CodeDeploy when the deployment is kicked off automatically by your Auto Scaling group?
Make sure you have specified overwrite in your appspec.yml file
file_exists_behavior: DISALLOW|OVERWRITE|RETAIN
AWS Docs

Failed to deploy application: During an aborted deployment, some instances may have deployed the new application version

I can't deploy a new version on Elastic Beanstalk.
Everything was working fine until I tried to deploy a new version where I have lots of issues (It is not the first time I deploy a new version on this environment, I already have deployed dozens). When I manage to fixe all of them I got those errors:
Failed to deploy application.
During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.
Unsuccessful command execution on instance id(s) 'i-...'. Aborting the operation
I redeploy the version which does not work.
Here is the Elastic Beanstalk console:
Elastic Beanstalk console
Elastic Beanstalk events
The request logs button from Elastic Beanstalk return nothing.
The system log from EC2 instance shows the last working version logs.
I enable the CloudWatch logs from Configuration navigation pane. It added 4 files to CloudWatch logs:
/var/log/eb-activity.log -> empty so far
/var/log/httpd/access_log -> empty so far
/var/log/httpd/error_log -> empty so far
/environment-health.log -> Command is executing on all instances (56 minutes or more elapsed).", "Incorrect application version found on all instances. Expected version \"prod-v1.7.28-0\" (deployment 128).
It is an Amazon Linux, t2.medium instance with Apache as web server
What I already try:
Change the name of .zip each time to be different of other zip already deploy
Terminate the instance and the loadBalancer automatically create a new one
Reboot the instance
Rebuild Elastic Beanstalk environment
Deploy a simplest code
I tried to deploy just a zip with the code below but I got same errors.
<html>
<head>
<title>This is the title of the webpage!</title>
</head>
<body>
<p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p>
</body>
</html>
It always go back to last working version and when I tried to deploy the new version it does not work.
On some post I see some people telling it is maybe because the instance is too small but before it was working perfectly and the size does not change since then.
If you have some questions or ideas I will be very thankful.
Have a nice day !
Answer:
The issue was in the logs like you said. I had to ssh into my EC2 instance to reached them. The error was in the file cfn-init-cmd.log.
One of the command was waiting for an input so it timed out with no error message.
You should check the logs of the EBS for any hints as to what goes wrong with your deployment. The AWS console
can be helpful for that.
There are also the logs that can be acquired from EC2:
CloudWatch logs is another thing to check.
You should also check the autoscaling group, and see if there are any health checks there. What kind of checks are these? What's the grace period?
Here's a list of reasons that an EC2 health check could fail.
You could launch a better ec2 instance for troubleshooting.
Instance status checks.
The following are examples of problems that can cause instance status checks to fail:
Failed system status checks
Incorrect networking or startup configuration
Exhausted memory
Corrupted file system
Incompatible kernel
Also rebuilding is really a drastic step as it destroys and rebuilds all your resources. Your ELB DNS for example will be gone, any associated EIP will be released. These things can't be reclaimed.
I also faced same issue and deleted the wrong application versions. And increased the command timeout.
Default max deployment time -Command timeout- is 600 (10 minutes)
Go to Your Environment → Configuration → Deployment preferences → Command timeout
Increase the Deployment preferences higher like 1800 and then try to deploy the previous working application version. It will work.

Elastic Beanstalk - Delete environment failed

In AWS Elastic Beanstalk, I created an environment and through it a database.
I went to RDS and renamed the instance name and then delete the RDS instance
Now I am trying to delete the environment and the procedure fails:
ERROR Stack deletion failed: The following resource(s) failed to delete: [AWSEBRDSDatabase].
What can I do in order to detach the environment from the RDS?
Any ideas?
Thank you very much
#Andreas What you can do is rename the RDS instance back to the original one and takes a Snapshot of it.
if you don't rename and try to delete the beanstalk what happens is beanstalk will keep on looking for the RDS Instance.
Now you can delete the Beanstalk, after successful deletion of the environment you can again create the RDS Instance via that Snapshot (which you have created previously)
What else you can try is go to the Configuration tab of the beanstalk and change the configuration of Database and update the beanstalk. This will preserve your beanstalk env also and changes the RDS configuration also.
For me helped to going to Cloud Formation and deleting stack there
https://aws.amazon.com/premiumsupport/knowledge-center/elastic-beanstalk-deleted-rds-database/

Amazon Web Service can't delete an Elastic Beanstalk environment

I have a problem with AWS Elastic Beanstalk. I tried to delete an environment. It started the process, but after a few minutes the environment "health bar" went to grey and gave me the following errors:
"Deleting security group named: XXXXX failed Reason: resource YYYYY has a dependent object"
"Stack deletion failed: The following resource(s) failed to delete: [AWSEBSecurityGroup]."
I tried to delete the security group from the error message, but I got this:
"XXXXXX: resource XXXXX has a dependent object"
After this I wanted to delete the dependence from the EB environment, but because it's Grey, it didn't allow me to do that.
I browsed the internet for hours, found a possible solution, where I need to do something at the EC2's Network Interfaces page, but it doesn't say any specific option or information.
Try this, I was suggested by AWS support and it worked for me.
You need to go to your CloudFormation console and retry deletion of the CloudFormation stack which the Beanstalk environment used.
The deletion may fail, but after retrying it will prompt you if you want to skip the "AWSEBRDSDatabase" resource that failed to delete. You can just confirm that you want to skip deletion (since you have actually already deleted it).
This should remove the CloudFormation stack
Then you can retry deletion of the Beanstalk environment from the Beanstalk console.
Is the security group being referenced by RDS or something in S3? If that is the case, you'll have to delete the dependency in either RDS or S3.
The error message is saying something outside of your environment is still using the security group and it can't be deleted for this reason.
Go to EC2 under AWS console's Compute
Go to Security Groups under NETWORK & SECURITY on the sidebar
Find your misbehaving security group on the page
Check it and choose Delete Security Group from the Actions menu
You will be presented with a link that will lead you to the security group or instances it depends on.
Keep going until you get to the parent Security Group or instances and delete them.
Make sure you don't delete any important Security Groups or Instances!
In case this happens due to a similar error but due to RDS attached to this,
Stack deletion failed: The following resource(s) failed to delete: [AWSEBRDSDatabase].
This happens when you terminate the RDS instance manually from RDS listing console. I resolved this by launching another instance with the same DB instance ideIntifier name.
Once this is created, you can terminate the Elastic Beanstalk environment successfully. This works.
Use https://github.com/mingbowan/sgdeps to find your security group dependencies and then break the dependencies.
Had this happen where I was using the security group created by EB with a non-eb created RDS instance.
I modified the RDS instance to stop using the EB-created security group and was able to do a successful termination of the environment and application. I used the eb cli 3.x and eb terminate --all --force to get a fresh start on the application.
In my case i have white list EBS instance into RDS security group , so deleted from RDS solved problem.

AWS Elastic Beanstalk: terminate RDS then fail to update application version

I created AWS EB environments with RDS MySQL DB 1st time. But, I realized that I don't need to use MySQL so, I switched to sqlite3 and terminate RDS MySQL DB. After this, I can't update application version by using git aws.push. AWS EB shows the below error message all the time.
Service:AmazonCloudFormation, Message:Stack named 'awseb-e-xxxxxx-stack' aborted operation.
Current state: 'UPDATE_ROLLBACK_IN_PROGRESS' Reason: The following resource(s) failed to update: [AWSEBAutoScalingGroup].
Updating Auto Scaling group failed Reason: Template error: DBInstance xxxxxxx doesn't exist
How can I fix this issue? Thanks.
As some have noted, you actually cannot manually delete your RDS instance from an elasticbeanstalk environment.
Per another answer you can change this via some options using one of the aws apis:AWS Elastic Beanstalk change RDS Endpoint
My solution was to terminate the environment and just start a new one from a saved configuration.
I was unable to terminate an EB environment of mine due to previously having manually deleted the RDS instance associated with the environment.
I was able to solve this issue by creating a new RDS instance with the same identifier as the deleted instance, then terminating the environment like normal.
If you deleted your RDS instance manually, Elastic BeansTalk does not know about that change and must be updated too.
You can go to Elastic Beanstalk console, pick up your Application and your Environment, go to "Configuration" and delete your RDS instance from the Elastic Beanstalk configuration.