1

Problem

I'm following this AWS documentation to enable HTTPS in my Flask Elastic Beanstalk environment. When I follow the steps outlined, I get the following error:

2020/08/24 21:30:04.183362 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-init -s 
       arn:aws:cloudformation:us-east-1:XXXXXXXXX:stack/awseb-e-XXXXXXXXX-stack/
       XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX-r AWSEBAutoScalingGroup --region us-east-1 
       --configsets Infra-EmbeddedPostBuild
2020/08/24 21:30:04.592591 [ERROR] An error occurred during execution of command 
       [app-deploy] - [PostBuildEbExtension]. Stop running the command. Error: Container 
       commands build failed. Please refer to /var/log/cfn-init.log for more details. 

I do not have ssh access to the EC2 instances that I deployed. I'm wondering about troubleshooting this particular issue, and generally how to deal with this situation in Elastic Beanstalk.

Question

  1. What issue might be causing the Error: Container commands build failed above?
  2. What can I do to troubleshoot an issue like this if I don't have ssh access to my EC2 instance? Is there a way to view these cfn-init.log files?

Context

The app works perfectly if I exclude this 02_https_instance.config file from my source code. I am wondering if the AWS example needs to be updated for Linux 2, as the mod24_ssl they suggest is for Linux 1, whereas I have to use mod_ssl in this version (Reference). Are there other code updates that are required to make this work?

whoopscheckmate
  • 746
  • 8
  • 23

1 Answers1

3

What issue might be causing the Error: Container commands build failed above?

Container commands is a section in your .ebextentions. Thus it seems a commend defined in container_commands section failed.

What can I do to troubleshoot an issue like this if I don't have ssh access to my EC2 instance? Is there a way to view these cfn-init.log files?

You can download all log files form EB console:

enter image description here

You have to explicitly ask EB to get the files using the menu on the right. By default, the logs panel will be empty if you don't ask.

Marcin
  • 215,873
  • 14
  • 235
  • 294