AWS App Runner Failing On Launch

0

Hello,

I am working on hosting a container on the internet that will be used by only a few users for a few hours a day, so I am trying to avoid paying the cost for a load balancer if at all possible. I currently have the docker container in a private ECR repository, and have it running on a fargate service. The fargate service is working great: I can access the container from the public IP address and it works as expected. However, the public IP changes when I push any update, so App Runner seemed like a better option as the link stays the same. I went through the setup steps and everything seemed to work as expected. I built the app, and the health check succeeded on the first attempt. However, whenever I click the URL, the app launches, and I see the UI of the app, but it fails immediately. I have checked in the logs and there are no error messages, or anything that helps me trace back this error. I am confused as to why I can run the container in fargate ECS, but it fails in App Runner. Does anyone have any ideas on why this might be, or how I can fix it?

My first thought is that it might have to do with a permissions issue since it fails immediately, but I am using the default permissions and my app isn't interacting directly with any AWS services. Any ideas here? Thanks in advance.

  • Hi, I work for App Runner product team. Can you provide the serviceARN so we can look into the error and get back to you?

2 Answers
0

Difficult to tell without error message on AppRunner. How does the image look like (https://github.com/aws-containers/hello-app-runner/blob/main/Dockerfile)

You can probably use CloudMap for Fargate https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html

The most cost effective option may me using Lambda and URL support. You should consider if you can run this using Lambda which now has built in URL support and scalers to 0.
https://aws.amazon.com/blogs/aws/announcing-aws-lambda-function-urls-built-in-https-endpoints-for-single-function-microservices/

You can even package the function in a container and push to ECR if you want to have the same deployment model https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/deploy-lambda-functions-with-container-images.html

profile pictureAWS
Roly
answered a year ago
0

Update: After somewhat extensive research, I think I finally found the answer. The app that I have is getting a HTTP timeout and is thus crashing. It does some pretty computationally expensive operations at startup in the app's server which stalls any information getting to the ui. Since the load balancer doesn't see any response to the request in the ui for a certain period of time (AWS doesn't say, maybe 10, 15, 20 seconds), then the load balancer thinks the app is dead and kills it.

Trevor
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions