R
Railway5mo ago
jins

App logs showing pgBouncer errors

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.
No description
2 Replies
Percy
Percy5mo ago
Project ID: c0958e3e-4cd8-4f89-9376-7c4003820f57
jins
jinsOP5mo ago
c0958e3e-4cd8-4f89-9376-7c4003820f57 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\""
},
"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? Possiblly an issue with prisma keeping the connections open too long, will test adding timeouts and prisma.$disconnect() to close connection after queries
Want results from more Discord servers?
Add your server