-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Health API Showing OK when unable to connect to database #4575
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
Comments
@toddheslin currently the health endpoint is a simple way for checking the status of parse-server itself, rather than having to make a test query or something like that. As such it doesn't provide any details in terms of the database connection. I actually brought this up some time ago in #4305, but there were a number of concerns about making too much information available from a publicly accessible endpoint. We ended up settling for a structured JSON response with the existing OK value as the status and nothing more. If I remember correctly this starts to get a tad confusing when you have multiple parse server instances behind a load balancer. Still, it is something that could be nice to have in the future, provided it is not public and still useful when running more than one instance of parse server. |
thanks @montymxb. One solution I thought of could be setting up Pingdom to make a POST to the Parse Server api endpoint. E.g. if my Parse Server is hosted at This would be loading a new Parse object of type Health in the database. Could keep these as a database log of if/when downtime occurred, or simply clean it up using an afterSave cloud function hook. I haven't actually implemented this yet, but it seems a simple way to ensure everything works. With respect to sending back other information about the server, I guess this could be done by calling the cloud function with the master key. The function could return whatever you wanted to know about the server. Once again, haven't tried this but it seems reasonably possible. |
Np. I haven't experimented returning server related information from cloud code, but it could be possible. Might be a way to set up something for your needs beyond the standard health endpoint. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Issue Description
I've had a recent issue where I was relying on pingdom hitting my
/health
endpoint expecting that it should show an error if there is a database connection error. Unfortunately this is not the case. The Parse app connects to a local postgres database that crashed and didn't restart. Whilst the application was technically crashed, the health endpoint respondedOK
.I've since updated to the latest release and see this is still a problem. Is this intentional, or just overlooked?
Steps to reproduce
/parse/health
-> response{"status":"ok"}
/parse/health
-> response{"status":"ok"}
Expected Results
Health status should not be
ok
if there is a database connection errorActual Outcome
Health status returning
ok
despite the application not able to make receive requestsEnvironment Setup
Server
2.7.2
Database
Logs/Trace
The text was updated successfully, but these errors were encountered: