Is there a way to alert on this health check ?
Thank you for your comment. We'll review and update the Knowledge Center article as needed.
Exactly my thinking. The current state of these logs, UI is horrible.
Thank you for your comment. We'll review and update the Knowledge Center article as needed.
Yep. The UI for knowing WHY something failed is still horrible. Amazon has done nothing to help out in this area. But, our health check commands are usually to blame. Most are just one line linux curl or wget commands with a || exit 1 tacked onto the end. That will yield only the frustratingly unhelpful message "health check return exit code 1" in the ECS console, and nothing more because that is the only thing returned by the command exit. So the use of exit 1 is really the problem here. What we want is a command that prints out something and returns a non-zero code if it fails, but prints nothing and returns 0 if everything passes. This probably means if you are going to use a health check command you probably should write a proper shell script that can respond all of the special conditions your health check procedure will encounter, and print out good debugging messages when it fails. The other option is to forgo the health check commands all together because typically ELB will health check your app for you. You won't get auto-restart of containers, but you'll have more stability from situations like this where debugging the problem is made harder by using poorly chosen health check commands.
Relevant content
- asked a year ago
- asked 6 years ago

