Error: queryCallback is not a function

We are seeing numerous errors like this. Seems to happen when a query times out or something like that.

Seems to be related to this open issue: Query streams break with `query_timeout` · Issue #1860 · brianc/node-postgres · GitHub

{
  "error": {
    "message": "queryCallback\n is not a function",
    "name": "TypeError",
    "stack": "TypeError: queryCallback\n is not a function\n    at Timeout._onTimeout \n(/node_modules/pg/lib/client.js:532:9)\n    at listOnTimeout \n(node:internal/timers:569:17)\n    at process.processTimers \n(node:internal/timers:512:7)"
  },
  "level": "fatal",
  "message": "There was an \nuncaught \nerror",
  "origin": "uncaughtException",
  "pid": 249,
  "requestId": "8c02f1bf-df21-4dbd-ad66-1a9859995730",
  "timestamp": "2024-07-24T15:35:28.575Z"
}

Any ideas how to mitigate this?

Hello @m_0!

Another team member Dan Bloncourt said he had recommended increasing the timeout and this allowed the Postgres connection to succeed to eliminate this error.

Just wanted to double check that the advice had worked and if you are still encountering this error!

We have increased the timeout and the error did go away (for now). But that's just masking the symptom though, not fixing the underlying issue.

Glad to hear the error has gone away for now!

I completely agree, our Query error handling can use some improvement.

I have filed a ticket for our engineering team to address this as we continue to work on increasing the speed on our queries and DB connection to improve performance and reduce the frequency of user issues where they have slow queries/timeouts that impact product performance.

I highly recommend our query performance tooling to see if there are any optimizations that can be done to make things easier on our infrastructure.

Having users toggle the timeout var in their config is a short term work around we are recommending for the short term as we push to improve the product and reduce timeout errors and make debugging easier with better error messages and moving non-fatal errors into a better triage flow!