long-lived connection: internal nodejs exception with ETIMEDOUT at node:internal/stream_base_commons
Hello,
Dear pg mantainer and community.
We are getting random exit from nodejs process with:
Error: read ETIMEDOUT
at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
Emitted 'error' event on Client instance at:
at Client._handleErrorEvent (/opt/app-root/src/node_modules/pg/lib/client.js:319:10)
at Connection.emit (node:events:513:28)
at TLSSocket.reportStreamError (/opt/app-root/src/node_modules/pg/lib/connection.js:52:12)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -110,
code: 'ETIMEDOUT',
syscall: 'read'
}
Node.js v18.9.1
npm timing command:run Completed in 12908487ms
npm timing npm Completed in 12908655ms
npm info ok
It can happen twice a day or twice for a hour. There is no specific pattern.
I know about: https://node-postgres.com/apis/client#error Please help us understand how to catch this exception and handle it.
Thank you in advance.
same issue here
I am having the same problem here. Funny enough I only experience these errors on my production database server, but on the other environments (testing and staging). Can this be related to the postgres server configuration somehow?
@costa-simulatedreality did you ever end up figuring out what was causing your issue? I'm running into this too and can't reliably reproduce it.
@brianmatindi Were you able to figure out what was causing the issue? I am experiencing this in my nestjs project.
I encountered the same issue after my server ran for a couple of hours in the production environment