1

I am trying to deploy my Laravel application into ElasticBeanstalk environment. I am using "eb deploy" 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.

Then I also updated the .elasticbeanstalk/config.yml file as follow.

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

Then in the terminal, I updated the "eb" command to use the right environment running the following command.

eb use PatheinDirectoryTesting

Then I run "eb deploy" to deploy my application. It deployed the zip file successfully. Then it threw the error after uploading the zip.

enter image description here

Then I run the "eb logs" to get the error in the logs. This is the error I found in the logs.

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.

I tried deleting the CloudFormation template and deploying again. Then I deploy the application. The error persists. How can I fix it?

halfer
  • 19,824
  • 17
  • 99
  • 186
Wai Yan Hein
  • 13,651
  • 35
  • 180
  • 372
  • Can you check your EB logs? You can get complete logs in EB console's Logs menu. One of your `container_commands` seems to have failed. Have to check which one. – Marcin Aug 29 '20 at 22:40
  • I am not running any container commands. – Wai Yan Hein Aug 29 '20 at 22:50
  • 1
    The error says "Error: Container commands build failed". But still to troubleshoot the issue, EB logs need to be inspected. Especially `/var/log/cfn-init-cmd.log`. – Marcin Aug 29 '20 at 22:54
  • Hi @Marcin, thanks for helping. I found the issue. In the config.yml the default environment is MyanEat-test-env. I replaced it with PatheinDirectoryTesting. And then I run "be deploy PatheinDirectoryTesting". It worked. – Wai Yan Hein Aug 30 '20 at 16:04

0 Answers0