AppRunner with container fails to start

0

Hi,

I have a container that is failing to state with AppRunner.

On the event log I see:

06-08-2023 07:09:07 AM [AppRunner] Deployment with ID : 502da9466f2d446dbdc5a36c4438b0ee failed.
06-08-2023 07:08:50 AM [AppRunner] Your application stopped or failed to start. See logs for more information.  Container exit code: 139
06-08-2023 07:06:56 AM [AppRunner] Performing health check on path '/' and port '80'.
06-08-2023 07:06:46 AM [AppRunner] Provisioning instances and deploying image for publicly accessible service.
06-08-2023 07:06:35 AM [AppRunner] Successfully copied the image from ECR.
06-08-2023 07:04:59 AM [AppRunner] Successfully enabled VPC connection for outgoing traffic.

However I cannot see any logs in the application logs that could help me to diagnose the issue.

profile picture
asked a year ago1049 views
3 Answers
0
Accepted Answer

As @Didier suggested, the error was caused by the custom code from the container.

However it was very difficult to diagnose that because AppRunner didn't write logs in case if the container stop at startup...

I fixed this by catching my exception at startup and letting my container working (even if it doesn't start the port listening). Since the container is still alive, logs are written before the health check stops the container and I saw that this was simply a configuration issue...

Hope that https://github.com/aws/apprunner-roadmap/issues/184 issue will be fixed soon.

profile picture
answered a year ago
0

Hi, See https://komodor.com/learn/exit-codes-in-containers-and-kubernetes-the-complete-guide

Exit Code 139 - Segmentation fault (SIGSEGV) -Container attempted to access memory that was not assigned to it and was terminated

So, it's probably an issue with the application / custom code creatung this segmentation violation

Does this container image properly out of AppRunner? If it fails similarly, you may be able to access the logs nore easily

profile pictureAWS
EXPERT
answered a year ago
  • Exit code 139 simply notify that the container stops here. That is only this common thread with my error. SIGSEGV, is a specific error that I didn't have. Obviously, when the container stops with exit code 139, the issue is in the code inside the container. but we should have the logs to help the diagnostic...

-1

Hi, does your application properly respond on health check on port 80 visible in your logs ?

See https://stackoverflow.com/questions/69322032/aws-app-runner-create-failed-on-health-check for a similar problem

profile pictureAWS
EXPERT
answered a year ago
  • Hi, regarding the logs, it seems that the issue is not related to the health check. Container exit code: 139 indicates that the container stops (so port is closed) but health check is definitively not the issue...

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