Health checks failed with these codes: [502] on AWS ALB when using Strapi enable AWS App Mesh on ECS

115 views Asked by At

Summary I have a Strapi app running on AWS ECS with AWS App Mesh Envoy. The App Mesh is configured using AWS Cloud Map. Initially, when I added the Envoy proxy container to the task definition using the old ECS console and deployed it, it was successful. However, prior to this success, the health check for the Envoy container was failing, prompting me to add a VPC Endpoint to AWS App Mesh Management to ensure the health check of the Envoy container.

In addition to this adjustment, I had to change the value of APPMESH_VIRTUAL_NODE_NAME to APPMESH_RESOURCE_ARN due to the latest version of Envoy. The ECS service consists of two containers, and both of them are currently in a healthy state.

However, when I attached the private DNS of the ECS service to an AWS ALB, the target group associated with the ECS service's IP address reported a Health checks failed with these codes: [502]. I'm perplexed as to why the task is healthy when the App Mesh Envoy container is not in use but fails the health check when the Envoy proxy is added. I've been searching for a solution to this error for weeks but haven't found one yet.

Steps to Reproduce What are the steps you can take to reproduce this issue? Enable App Mesh integration in the task definition by using the old console of ECS and deploy them with AWS ALB

Attachments Here is the image of the AWS ALB return 502 health check Health check on AWS ALB failed when enable App Mesh in ECS task definition

Additional context I have configured the virtual node and virtual routers in AWS App Mesh listener port are http2 1337, same the port as the Strapi container on ECS (Port mapping 1337). The App Mesh listener port should be the same as the Strapi container port on ECS 1337 right? Hope to see any solutions for this. I am appreciate it if you can help me done this one. Thank you very much

0

There are 0 answers