Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Healtcheck Return Code ignored #2218

Open
horvbalint opened this issue May 16, 2024 · 3 comments · Fixed by #2230
Open

[Bug]: Healtcheck Return Code ignored #2218

horvbalint opened this issue May 16, 2024 · 3 comments · Fixed by #2230

Comments

@horvbalint
Copy link
Sponsor

Description

When setting up healthcheck there is a field called "Return Code", this suggests that it is possible to specify the expected response code of the path.
This is great I have multiple backends where paths are behind a middleware so they return 401 for the healtcheck pings. Saldy setting this field to 401 does not produce the desired outcome, the healtcheck will fail. More specificaly, the status will stuck in "Starting". As to my knowledge this is because the docker healtcheck does not get the correct return code.

I tried to check the codebase and I think the value of this field is not used anywhere, seemingly it was forgotten.
It would be great to have this feature :)

Minimal Reproduction (if possible, example repository)

Start a service that returns 401 on one of its route and enable healthcheck on this route with "Return Code" 401. Try to deploy the service.

Exception or Error

The container will be stuck in starting status.

Version

v4.0.0-beta.277

@luckycreationsindia
Copy link

Hi,

I can confirm this health check is not working as expected with error code.

Here's example repo to try:
Return Custom Error

By default this repo will return error code 401 with message "Unauthorized" and can be configured with environment variable ERROR_CODE and ERROR_MESSAGE

@andrasbacsai
Copy link
Member

This will be fixed in the upcoming version.

@andrasbacsai
Copy link
Member

I had to revert it in v284, because it caused unexpected errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants