-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Description
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 responded OK.
I've since updated to the latest release and see this is still a problem. Is this intentional, or just overlooked?
Steps to reproduce
- Start server
- GET
/parse/health-> response{"status":"ok"} - Switch off database
- Error shows in logs:
{ Error: connect ECONNREFUSED 127.0.0.1:5432
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 5432 }
warn: Unable to ensure uniqueness for usernames: Error: connect ECONNREFUSED 127.0.0.1:5432
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
warn: Unable to ensure uniqueness for user email addresses: Error: connect ECONNREFUSED 127.0.0.1:5432
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
warn: Unable to ensure uniqueness for role name: Error: connect ECONNREFUSED 127.0.0.1:5432
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
(node:8526) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 8): Error: connect ECONNREFUSED 127.0.0.1:5432
(node:8526) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:8526) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 9): Error: connect ECONNREFUSED 127.0.0.1:5432
- Check health endpoint: GET
/parse/health-> response{"status":"ok"}
Expected Results
Health status should not be ok if there is a database connection error
Actual Outcome
Health status returning ok despite the application not able to make receive requests
Environment Setup
-
Server
- parse-server version (Be specific! Don't say 'latest'.) :
2.7.2 - Operating System: macOS 10.13.3
- Hardware: MacBook Pro
- Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Localhost
- parse-server version (Be specific! Don't say 'latest'.) :
-
Database
- Postgres version: 9.6.6
- Storage engine: N/A
- Hardware: N/A
- Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): Localhost
Logs/Trace
{ Error: connect ECONNREFUSED 127.0.0.1:5432
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 5432 }
warn: Unable to ensure uniqueness for usernames: Error: connect ECONNREFUSED 127.0.0.1:5432
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
warn: Unable to ensure uniqueness for user email addresses: Error: connect ECONNREFUSED 127.0.0.1:5432
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
warn: Unable to ensure uniqueness for role name: Error: connect ECONNREFUSED 127.0.0.1:5432
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
(node:8899) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 8): Error: connect ECONNREFUSED 127.0.0.1:5432
(node:8899) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:8899) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 9): Error: connect ECONNREFUSED 127.0.0.1:5432
GET /api/health 200 4.825 ms - 15
Metadata
Metadata
Assignees
Labels
No labels