Why is my Elastic Beanstalk environment in a non-operational state?

4 minute read
1

I want to troubleshoot environment operation failures in AWS Elastic Beanstalk due to an AWS CloudFormation stack that's in a non-operational state.

Short description

Elastic Beanstalk creates an CloudFormation stack to manage the resources that are associated with the Elastic Beanstalk environment. You can check this stack in the CloudFormation console with the stack name awseb-envID-stack.

When the Elastic Beanstalk environment enters a non-operational state, the CloudFormation stack shows a FAILED status, and you receive the following error message:

"The stack STACK-ID associated with environment ENVIRONMENT-ID is in STACK-STATUS state."

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.

To bring your Elastic Beanstalk environment to an operational state, perform the actions associated with your CloudFormation stack status in the following table:

CloudFormation stack statusCloudFormation actionElastic Beanstalk action
CREATE_FAILEDNoneRun the Rebuild environment or Terminate environment operations
UDPATE_ROLLBACK_FAILEDBring stack to UPDATE_ROLLBACK_COMPLETE statusRetry the operation
DELETE_FAILEDBring stack to DELETE_COMPLETE statusRetry the operation
UPDATE_ROLLBACK_COMPLETENoneRetry the operation
UPDATE_COMPLETENoneIf the stack's previous state was CREATE_FAILED, then run the Rebuild or Terminate operation. Otherwise, retry the operation.
DELETE_COMPLETENoneRetry the operation.
ROLLBACK_COMPLETENoneRun the Rebuild environment or Terminate environment operations.

If your CloudFormation stack has a FAILED status, then choose one of the following resolutions.

CREATE_FAILED status

When the stack has a CREATE_FAILED status, the environment can't recover. The environment will continue to have issues even if the stack status changes to UPDATE_COMPLETE. If your stack has the CREATE_FAILED status, then you must create a new Elastic Beanstalk environment.

Choose one of the following options to recreate the environment:

If you still can't create a new environment, then complete the following steps:

  1. Address the root cause of the stack failure, if there's an issue that prevents the creation of a new environment.
  2. Create a new environment. To do so, terminate the current environment, and then perform the CreateEnvironment operation again. Or, rebuild the environment through the console or run the rebuild-environment command.

UPDATE_ROLLBACK_FAILED status

To bring the Elastic Beanstalk environment to an operational state, complete the following steps:

  1. Open the CloudFormation console.
  2. Identify the resource that failed to update during the rollback from the respective stack event, and then address the failure.
  3. Bring the stack to the UPDATE_ROLLBACK_COMPLETE status. To do so, choose the Continue update rollback option in the CloudFormation console.
  4. In the Continue update rollback dialog box, expand Advanced troubleshooting. In the Resources to skip - optional section, select the resource that failed to update.
  5. Choose Continue update rollback. The stack now shows the UPDATE_ROLLBACK_COMPLETE status.
  6. Retry the operation that returned the error.

DELETE_FAILED status

To bring the Elastic Beanstalk environment to an operational state, complete the following steps:

  1. Open the CloudFormation console.
  2. Identify the resource that failed to delete during the respective stack event.
  3. Manually delete the resource. For example, if the resource is a security group, then delete the security group from the Amazon Elastic Compute Cloud (Amazon EC2) console.
  4. Delete the CloudFormation stack from the CloudFormation console. The deleted stack shows a DELETE_COMPLETE status.
  5. Retry the Terminate environment or Rebuild environment operations.

For more information, see How do I terminate or rebuild my Elastic Beanstalk environment when the AWSEBSecurityGroup fails to delete?

AWS OFFICIAL
AWS OFFICIALUpdated 4 months ago
2 Comments

My support plan is Basic. Do I have to upgrade my AWS Support plan to "contact the AWS Support team to change the environment to an Available state"?

replied 8 months ago

Going forward, you won't need to contact AWS support to change your environment's status to Available. Instead, you'll receive an error message detailing the status of the CloudFormation stack linked to your environment. After resolving the error, you can proceed with the recommended steps outlined in the article.

profile pictureAWS
replied 4 months ago