6

I'm using AWS Elastic Beanstalk, and very often when deploying an environment, the health check turns RED, but I can't find an explanation why:

AWS Elastic Beanstalk dashboard

Clicking on Monitor doesn't help much:

AWS Elastic Beanstalk monitor

Is there a way to have more specific information about why the environment turns RED?

For information, there is a healthy instance for this environment in my EC2, I've SSH'ed it and it does respond to HTTP requests, although when loading http://xxx.elasticbeanstalk.com/ from my browser, the request times out.

BenMorel
  • 4,507
  • 10
  • 57
  • 85

6 Answers6

5

This is an old question but for the sake of people coming to this website, here is an update. Elastic Beanstalk recently announced support for Enhanced Application health monitoring.

https://aws.amazon.com/blogs/aws/elastic-beanstalk-update-enhanced-application-health-monitoring/

Now along with a health color, you can also discover "causes" which is an english language description for why the health of an environment transition.

You can also read about enhanced health reporting here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced.html

Rohit Banga
  • 584
  • 2
  • 5
  • 16
3

AWS is pretty useless on health screen, it only shows "severe" on my screen, that`s it. I can see it on main screen too, I wonder why Amazon coders like to create pretty useless screens. If this happens during deploying your code, there is one reason for that, your instance t1.micro or t2.micro allocated and shared pretty small amount of resource. It looks like resources are not available during your deployment. If you are ready to pay, you will get your resources.

Not yet
  • 31
  • 1
  • 4
    Welcome to ServerFault Mr. "Not yet". This is leaning toward a rant instead of an answer, but there's enough here that I'm not going to flag it. If you can try to edit this into shape a bit. Not for AWS's sake, but for your own. – chicks Oct 19 '18 at 20:10
  • This should probably be a comment indeed. – BenMorel Oct 20 '18 at 12:31
  • I just got downvoted for a question and you get 3 upvotes on a comment, it's a cruel world we live in Mr. Not yet – FabricioG Oct 02 '19 at 07:09
  • It is actually explaining what the reason could be so according to me it is an answer, some people can find the answer in it, some of them can not. I respect your thoughts. – Not yet Oct 09 '19 at 16:20
1

For me, this turned out to be because:

  1. My application returned code 302 when going directly to / and 200 if I went to something like /index.html, and the default health check path is /
  2. The load balancer only looked for code 200.

It can be details like that. So I would start by looking at the load balancer health check and the specific return code that you are getting, or something similarly simple.

Patrick Mevzek
  • 9,921
  • 7
  • 32
  • 43
snetch
  • 113
  • 4
0

You may have to make sure you're responding on the right address.

Check your server access logs to see what beanstalk is trying to hit and make sure you respond on that address.

Drew Khoury
  • 4,637
  • 8
  • 27
  • 28
0

Elastic Beanstalk uses the application health check monitoring provided by the ELB to detect whether any instances are unhealthy, and this is ongoing even during application deployment. If your application takes a long time to start up and deploy, then the ELB may see that one or more instances is unhealthy while it is restarting and Elastic Beanstalk will change the Health status to "yellow" or "red".

However, if this is the underlying cause then the status should go back to "green" shortly. If the health check stays red then you might have a different problem in your application.

Ken Liu
  • 155
  • 1
  • 9
0

This is exactly what my issue was. In my application Users who are not logged in get redirected to the login page (302). I edited the "Health checks" tab in "Target Groups" under "LOAD BALANCING" for the EC2 instance. I added 302 to the 200 that was already there (comma separated). It works now.