Description
When We have created database connection through connection string, it might store ip in the cache in your library and for next every connection it uses that IP. Now my database configuration changed but host, username, password is same and private ip of database changed. Now pg library try to connect on old IP and we are having new IP. So my every API gets failed.
{ "message": "error: terminating connection due to administrator command at Connection.parseE (/usr/src/app/node_modules/pg/lib/connection.js:545:11) at Connection.parseMessage (/usr/src/app/node_modules/pg/lib/connection.js:370:19) at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:113:22) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at Socket.Readable.push (_stream_readable.js:208:10) at TCP.onread (net.js:597:20)", "timestamp": "2018-10-09T04:56:00.329Z", "type": "err", "process_id": 0, "app_name": "api-server" }
{ "message": "Error: connect ECONNREFUSED 11.0.3.5:5432 at Object._errnoException (util.js:992:11) at _exceptionWithHostPort (util.js:1014:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)", "timestamp": "2018-10-09T04:56:02.963Z", "type": "err", "process_id": 0, "app_name": "api-server" }
Here IP and PORT number is fake, but same error I was getting since last 3 days.
So I want to know the possible solution for this.