PHP Avenger
PHP Avenger

Reputation: 1801

How to view AWS Elastic Beanstalk deployment process log in case of failure

I have a PHP application that is deployed on Elastic Beanstalk for latest changes, code directory is zipped (Development on windows environment) and then uploaded by "Upload & Deploy" option. It process every thing and finally fails due to some health check issue.

ERROR   During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.
ERROR   Failed to deploy application.
ERROR   Instance id(s) 'unique-instance-id' did not pass health check after command execution. Aborting the operation.
INFO    Command execution completed on 1 of 2 instances in environment.
INFO    Deploying new version to instance(s).

This problem does not occur if code directory is zipped on MacBook and then uploaded.

I can assume there could be some issue with EOL End of line or may be other zip format for windows and linux

I googled a lot but the solution are to upload the to environment and then run dos2unix command. but I have no access to the instance. only Amazon Front end panel to upload a file.

Question: I just need to know how can I view the detailed log of Elastic Beanstalk process log for "upload and deployment" of application process (Not the trace as I have pasted above).

I have also tried the "Logs" tab(link) left side menu. It helps to download zip file for logs contains httpd(access_log, error_log[very old error messages]) and some other log files.

However these log files does not help to understand why deployment failed.

Upvotes: 1

Views: 4618

Answers (2)

Scott Reed
Scott Reed

Reputation: 369

For me the issue of the deployment process getting stuck on "Command execution completed on 1 of 2 instances in environment." was because the health checks were failing. They were failing because my application was expecting a 200 status code on the health check but was receiving a 302 (as seen in the access logs). This is configured in elastic beanstalk under load balancer > processes > edit > health check > HTTP code. I was debugging this for several days so I hope this helps someone!

Upvotes: 1

Erwin Waterlander
Erwin Waterlander

Reputation: 516

  1. Run dos2unix on the files before you create the zip file. Dos2unix is also available for Windows.

Upvotes: 0

Related Questions