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
질문됨 일 년 전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
답변함 일 년 전
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
전문가
답변함 일 년 전
  • 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
전문가
답변함 일 년 전
  • 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...

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠