AWS Elastic Beanstalk Degrades every time I update - Stays down

8,174

Solution 1

Check in your /opt/elasticbeanstalk/hooks/appdeploy/post/01_monitor_httpd_pid.sh. Note that 01_monitor_httpd_pid.sh might have a different name for you.

In there you need to change your proxy check if you're not using apache/httpd to nginx, like so:

#!/bin/bash
set -xe
/opt/elasticbeanstalk/bin/healthd-track-pidfile --proxy nginx

If you are using apache/httpd, it means that there's something wrong with your apache runtime instance or process. Make sure the pid file is where is should be for the health check.

Solution 2

We can set a file inside the .ebextensions directory as bellow. when you see the error Following services are not running: proxy.

.ebextensions/01_fix_proxy.config contents:

  "/opt/elasticbeanstalk/hooks/appdeploy/post/01_monitor_httpd_pid.sh":
  mode: "000755"
  owner: root
  group: root
  content: |
    #!/bin/bash
    set -xe
    /opt/elasticbeanstalk/bin/healthd-track-pidfile --proxy nginx
Share:
8,174

Related videos on Youtube

Reid
Author by

Reid

I am a Software Engineer working primarily in the React, TS, Node, Elastic Search, and Serverless tech stack. However, I also have extensive experience with creating and programming embedded electronics and consumer products.

Updated on September 18, 2022

Comments

  • Reid
    Reid over 1 year

    When I update my instance, I use the EB Command Line Tools. I push my instance to my CodeCommit git, and then deploy my code using the eb deploy command. Nearly every time I do this, my envronment status changes to degraded/severe with the instance that is running giving the error Following services are not running: proxy. It will spin up more instances based on my auto scaling policy (tied to health), and sometimes after 2-3 new instances, I will get one that is "OK"

    My environment is configured as 64bit Amazon Linux 2016.09 v2.2.0 running PHP 7.0. It is auto load balancing and auto scaling on average netowrk out. It is running t1.micro in Any availability zone, and the software configuration is as follows: Log publication: On; Allow URL fopen: On; Display errors: Off; Document root: /http/; Max execution time: 60; Memory limit: 256M; Zlib output compression: Off;

    What could cause this?

    • Admin
      Admin over 7 years
      All instances and any newly created instances are spun up in the us-east-1a zone
    • Admin
      Admin over 7 years
      did you resolve this? i am facing the same issue
    • Admin
      Admin over 7 years
      I couldn't. I ended up starting a completely new application. It now works great, but it was a real pain to transfer because I had a RDS inside of my EB application.
    • Admin
      Admin over 7 years
      did you start the new app from the CLI or the console? i have done many apps over the years but never faced this issue
  • Chris Mccabe
    Chris Mccabe over 7 years
    I don't tweak anything on my instances and haven't done for a number of years but as soon as i downloaded the new eb command line tools for deployment i get the same issue as reported above