Recently I upgraded my AWS Elastic Beanstalk (EB) images 1. Since I encountered issues in the past, I dreaded doing this for my ~10 environments.

For most of the time this went smoothly. But as each step in the process takes a few minutes, the whole process still takes a lot of time. But one EB environment ended up in RED state while every bit of information on the AWS platform showed no signs of something wrong. Everything ok in the EB events, EC2 statuses and everywhere else nothing no hint to where something might be wrong. After trying out a few things, I would suggest to try these steps:

  1. Rebuild the environment (from the EB dashboard: Actions)
  2. Clone the environment (from the EB dashboard: Change)
  3. Try to recreate an environment similar or exactly the same as the one that is failing

Before trying out these steps I simply tried to redeploy the app: either by doing this via Application Version or redeploying via my pipeline (loading a new version into EB) without success. Trying to go back to a previous version gave me the following error:

Could not restart app server(s) for Abc: Environment named Abc is in an invalid state for this operation. Must be Ready.

Stupid as the solution might be after rebuilding the app, miraculously, worked again. This reminds me of older versions of Windows (I haven’t used Windows extensively recently, so I am not 100% sure whether this applies to the recent versions as well): If it does not work, just restart

RED State


Footnotes

1 Depending of the versions upgrading EB images might be very inconvenient, involving many steps. In my case I upgraded Node.js images. Each image supports a number of Node.js/NPM versions. For reference see the documentation. So, for upgrading a Node v6.11.1 (EB platform version 4.3.0) to the latest supported AWS EB platform version 4.8.1 (Node: 10.15.1/NPM: 6.4.1), it can’t be done with only one step, because the latest does not support Node v6.11.1. So, you have to do following steps:

  • Change configuration to use Node v7.10.1 because both platforms support this version (if there are no common supported version number, you have to go through an intermediary platform first)
  • Change the EB platform version
  • Change configuration to use Node v10.15.1
  • Re-deploy your app that runs on v10.15.1 (since the previous one probably don’t work anymore)
    Each step will take a few minutes to update. How painful.