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
已提问 1 年前1121 查看次数
3 回答
0
已接受的回答

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
已回答 1 年前
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
专家
已回答 1 年前
  • 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
专家
已回答 1 年前
  • 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...

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则