title: How do I troubleshoot 'Container commands build failed' generic error in AWS Elastic Beanstalk?
body: <p><strong>Problem</strong></p>
  <p>I'm following this <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/https-singleinstance-python.html" rel="nofollow noreferrer">AWS documentation</a> to enable HTTPS in my Flask Elastic Beanstalk environment. When I follow the steps outlined, I get the following error:</p>
  <pre><code>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. 
  </code></pre>
  <p>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.</p>
  <p><strong>Question</strong></p>
  <ol>
  <li>What issue might be causing the <code>Error: Container commands build failed</code> above?</li>
  <li>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 <code>cfn-init.log</code> files?</li>
  </ol>
  <p><strong>Context</strong></p>
  <p>The app works perfectly if I exclude this <code>02_https_instance.config</code> file from my source code. I am wondering if the AWS example needs to be updated for Linux 2, as the <code>mod24_ssl</code> they suggest is for Linux 1, whereas I have to use <code>mod_ssl</code> in this version (<a href="https://stackoverflow.com/questions/62225208/attempting-to-deploy-flask-app-to-aws-beanstalk-with-ssl-no-package-mod24-ssl-a">Reference</a>). Are there other code updates that are required to make this work?</p>