App logs showing pgBouncer errors
Anonymous
TRIALOP

a year ago

I am hosting a Next.js app on a Node.js server which is connected to pgBouncer and a Postgres DB.

I notice these errors in my logs, is this anything to be cooncerned about? I'm not sure what these mean.

3 Replies

Anonymous
TRIALOP

a year ago

c0958e3e-4cd8-4f89-9376-7c4003820f57


Anonymous
TRIALOP

a year ago

Last night I added node-cron to run scheduled prisma queries to clean up the db every 5 minutes. It looks like that may have been the cause for some of those connection and login pgBouncer errors in the screenshot. I had set a custom start command in app settings for bun run start:prod. Since I removed it pgBouncer is just logging stats.

Here are the package.json scripts:

"scripts": {
    "build": "npm run db:deploy && next build",
    "cron": "ts-node --compiler-options '{\"module\":\"CommonJS\",\"verbatimModuleSyntax\":false}' src/cron/index.ts",
    "dev": "prisma generate && next dev -p 2000",
    "start": "next start",
    "start:dev": "concurrently \"bun run dev\" \"bun run cron\"",
    "start:prod": "concurrently \"bun run start\" \"bun run cron\""
  },

If node-cron was the issue here connecting to prisma, are there any known issues with pgBouncer/prisma/node-cron that would cause those initial log errors?


Anonymous
TRIALOP

a year ago

Possiblly an issue with prisma keeping the connections open too long, will test adding timeouts and prisma.$disconnect() to close connection after queries


Loading...