- Newest
- Most votes
- Most comments
Based on your logs, I can see that your App Runner service is failing during the health check phase, despite your application appearing to start correctly on port 8000. This is a common issue with App Runner services and there are a few potential causes to investigate.
The key issue here is that while your application is running on port 8000 (as shown in your application logs), the App Runner service is unable to successfully complete health checks on that port.
Here are some potential solutions:
-
Port Configuration Mismatch: Ensure that the port you've configured in App Runner matches the port your application is actually using. In your case, your application is running on port 8000, so make sure App Runner is configured to use port 8000 as well.
-
Health Check Endpoint: If you're using HTTP protocol for health checks (though your logs show TCP), make sure your application has a health check endpoint that returns a 200 status code. For many web frameworks, you might need to explicitly add a health check route (like '/health') that responds with a success status.
-
Update Service Configuration: If your App Runner service is in a failed state, you can rebuild it with updated configuration. You can do this by:
- Going to the App Runner console
- Selecting your service
- Making necessary configuration changes
- Rebuilding the service
-
Check Container Port Exposure: Make sure your Dockerfile properly exposes the port your application is using (EXPOSE 8000).
-
Try Different Health Check Protocol: If you're currently using TCP, you might try switching to HTTP if your application supports it, or vice versa.
Since your application logs show that the service is running on port 8000 and App Runner is attempting health checks on the same port, the issue might be related to how your application is handling the health check requests or how the container is exposing the port.
Sources
Deploy https://gallery.ecr.aws/docker/library/httpd to apprunner failed | AWS re:Post
Service - AWS App Runner
Rebuilding a failed App Runner service - AWS App Runner
service basic-ml-microservice-service port 5000 is unhealthy in target-group ecs-mlewp2-basic-ml-microservice due to (reason Health checks failed with these codes: [404]). | AWS re:Post
AWS App Runner Health Check Fails Despite Successful Local Testing | AWS re:Post
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
