Deploy fails due to it not being able to check \health endpoint
The deploys are funky when triggered by new pushes to project's master branch. Sometimes they pass the check and some other times I just have to remove the previous active deploy and redeploy but even then the behavior is unpredictable. Some other times pushing a new change helped. I'm using golang (gin).
router.Run(ip + ":" + port)
where ip is 0.0.0.0
and port is defined as a service variable on port 8080
.
My deploy details are:
buildCommand is basically: go get && go build -o main
Would love help on this since it makes fixing an urgent issue a bit of a nightmare. Thanks!22 Replies
Project ID:
ec8587ed-0fb6-417a-a80d-ab29eb6a37b6
Project ID:
ec8587ed-0fb6-417a-a80d-ab29eb6a37b6
first, why have you set a custom build command?
@Horserix ping for viability
I used that in another platform and it worked when used it after creating the project. I have no problem using the recommended settings from the docs. I just didn't think this could have an impact on the deploy due to it working a while ago
I'll try removing it and using the default and ping you back if it changes 👍
what do the healthchecks fail with?
These are the last logs from the
build logs
:
I just used the default config for the build and deploy and it seems it's having the same issues. It's stuck at the health check attempts 🤔can you show me the code that starts the server?
Sure!
The service variable
ENVIRONMENT
is correctly set as production
in the Variables tab
The /health
GET
endpoint is allowed. There were multiple past deployments where the health checks worked btw and haven't changed it sinceshow me the health endpoint code?
what is your port variable set to
8080
anything bad in the deployment logs when the healthcheck fails?
Nope, everything goes well, the build and publishing are both successful 🤔
In the deploy logs I can see the server running ok. But it's not being hit by any of the requests. I have a previous deployment that is active and working. Which it was triggered a commit ago and worked. It is weird 🤔
But the new commit just fails due to the health check
don't listen on 0.0.0.0
just do
router.Run(":" + port)