-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Health Check Endpoints Return 200 Despite Invalid Credentials #741
Comments
Your expected behaviour isn't quite correct at least for Let's take a look at the docs. https://docs.pact.io/pact_broker/configuration/features#healthcheckheartbeat-url
b848ce3#diff-ae75b0267097077500d2c3597f335ce847f1cf76f10712dec9ad1321a6fb6a59R61 What do you get in the response from the |
The response from the /diagnostic/status/dependencies endpoint returns true with 200 status and the pactbroker application throws 500 Internal Server Error |
I would be expecting it to hit this block
returning a tuple of
The first value of the tuple controls the response status
It calls sequels valid_connection method https://www.rubydoc.info/gems/sequel/4.38.0/Sequel%2FDatabase:valid_connection%3F I can't see whether that will check the credentials or just availability of the database endpoint. I assume it in the latter, which is why you aren't getting the error you expect. |
Pre issue-raising checklist
I have already (please mark the applicable with an
x
):Software versions
Pactbroker docker image version 2.122.0-pactbroker2.112.0
Database: PostgreSQL (AWS RDS)
Deployment Platform: Openshift/Kubernates
Expected behavior
When the database credentials goes invalid, the /diagnostic/status/heartbeat and /diagnostic/status/dependencies endpoints should return an appropriate error status (e.g., 500) to indicate that the application is not healthy.
Actual behavior
When the database credentials goes invalid, the application throws 500 Internal Server Error for normal operations. the /diagnostic/status/heartbeat and /diagnostic/status/dependencies endpoints will return 200 OK, indicating the application is healthy, even thought it is unable to function properly due to invalid credentials.
Steps to reproduce
- Observe the application gives 500 Internal Server Error
- Observe that these endpoints return 200 OK despite 500 Internal Server Error from application.
The text was updated successfully, but these errors were encountered: