title: AWS ElasticBeanstalk deployment is throwing error, "An error occurred during execution of command [app-deploy] - [PostBuildEbExtension]"
body: <p>I am trying to deploy my Laravel application into ElasticBeanstalk environment. I am using &quot;eb deploy&quot; command for the deployment. The command was working fine. I had been deploying my application successfully. At some point, I updated my CloudFormation template to change the environment name of the ElasticBeanstalk.</p>
  <p>Then I also updated the .elasticbeanstalk/config.yml file as follow.</p>
  <pre><code>branch-defaults:
    master:
      environment: PatheinDirectoryTesting
      group_suffix: null
  environment-defaults:
    MyanEat-test-env:
      branch: null
      repository: null
  global:
    application_name: PatheinDirectoryApplication
    default_ec2_keyname: null
    default_platform: arn:aws:elasticbeanstalk:eu-west-1::platform/64bit Amazon Linux
      2 v3.1.0 running PHP 7.3
    default_region: eu-west-1
    include_git_submodules: true
    instance_profile: null
    platform_name: null
    platform_version: null
    profile: null
    sc: git
    workspace_type: Application
  </code></pre>
  <p>Then in the terminal, I updated the &quot;eb&quot; command to use the right environment running the following command.</p>
  <pre><code>eb use PatheinDirectoryTesting
  </code></pre>
  <p>Then I run &quot;eb deploy&quot; to deploy my application. It deployed the zip file successfully. Then it threw the error after uploading the zip.</p>
  <p><a href="https://i.stack.imgur.com/5OzcJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5OzcJ.jpg" alt="enter image description here" /></a></p>
  <p>Then I run the &quot;eb logs&quot; to get the error in the logs. This is the error I found in the logs.</p>
  <pre><code>2020/08/29 21:42:29.413325 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-init -s arn:aws:cloudformation:eu-west-1:733553390213:stack/awseb-e-gntnptfj8v-stack/90004470-ea3e-11ea-8e57-02d39f83e350 -r AWSEBAutoScalingGroup --regio
  n eu-west-1 --configsets Infra-EmbeddedPostBuild
  2020/08/29 21:42:31.691170 [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 tried deleting the CloudFormation template and deploying again. Then I deploy the application. The error persists. How can I fix it?</p>