Health check on custom port number fails.

0

I attempted to define a new App Runner web api service running on port 5000. The creation fails the health check step, but the failure message states port 8080 which is the default port number on the setup screen. Is it truly using port 8080 for the health check or is the error message string using the default port always? The event prior states health check will occur on port 5000.

Log:

06-20-2021 09:34 PM [AppRunner] Health check on port '8080' failed. Service is rolling back. Check your configured port number. For more information, read the service's logs.
06-20-2021 09:28 PM [AppRunner] Performing health check on path '/' and port '5000'.
06-20-2021 09:28 PM [AppRunner] Provisioning instance and deploying image.
06-20-2021 09:28 PM [AppRunner] Successfully pulled image from ECR.
06-20-2021 09:25 PM [AppRunner] Service status is set to OPERATION_IN_PROGRESS.
06-20-2021 09:25 PM [AppRunner] Service creation started.

Edited by: SamSan on Jun 24, 2021 7:57 AM

SamSan
asked a year ago708 views
2 Answers
0

I have tried port 80 as well as the default port 8080 with the same results where the health check fails. I also tried a different URL from the default "/" with a custom URL "/healthcheck" using the AWS CLI "aws apprunner create-service" command. Also, ensured the health check was being done with HTTP with the AWS CLI. More detailed error messages are definitely needed. This is a Flask app using a Docker container and the port and /healthcheck URL are accessible when running the container locally. The same container works when deployed to Fargate. Is anyone from Amazon App Runner team monitoring this Forum?

SamSan
answered a year ago
0

I resolved the problem by ensuring that my Dockerfile had an ENTRYPOINT value which launches the software desired - in my case, Flask.

My container was configured by both a docker-compose.yml file and a Dockerfile. I had defined the ENTRYPOINT, actually spelled in lower case within the docker-compose.yml file - entrypoint, within the docker-compose.yml file vs. the Dockerfile. AppRunner ignores, truly is not aware of, the docker-compose.yml file, since it is simply driven by the container stored in the ECR. AppRunner should perhaps also consider the docker-compose.yml file. In my organization and others I'm familiar with the docker-compose.yml file or a set of docker-compose files are extremely important in the configuration of the Docker environment. The Docker file alone is NOT enough most of the time. In this case, the ENTRYPOINT can be specified in the Dockerfile and if any entrypoint is also configured in the docker-compose.yml file it overrides the Dockerfile ENTRYPOINT (https://docs.docker.com/compose/compose-file/compose-file-v3/#entrypoint)

SamSan
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