You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
This is not caused by the driver. It doesn't perform any DNS caching. Your operating system / network stack is probably doing it though.
Check the DNS records for your database to see what the TTL (Time To Live) value. That's how many seconds the value can be cached. The default for your DNS provider is probably something large like 3600 (1 hour) or 7200 (2 hours). A smaller value like 60 (1-minute) would lower the failover time.
I ran into similar issue. Our DB is hosted by Amazon's RDS and we connect to it by hostname, when RDS goes through upgrade our apps immediately go to ECONNREFUSED mode. I though it to be an IP change behind the hostname so I started making notes of IP before an update, IP after an update and then I realized that the IP doesn't change. Anything else is cached by the library which might be causing this? Restarting the node app makes it connect immediately without problems until next Postgres update.
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.
The text was updated successfully, but these errors were encountered: