jins
Explore posts from serversApp logs showing pgBouncer errors
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:
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?5 replies
Connect to public or private DB URL from app?
If I change this to
DATABASE_URL_DIRECT=${{myapp-db.DATABASE_PRIVATE_URL}}
in the variables and deploy I get that error in the build log and it fails
But it works with DATABASE_URL_DIRECT=${{myapp-db.DATABASE_URL}}
12 replies
Connect to public or private DB URL from app?
okay this is working:
I'm using prisma and their pgbouncer docs say to set the pgBouncer URL then connect direct to postgres as
directUrl
for Prisma Migrate
https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections/pgbouncer#prisma-migrate-and-pgbouncer-workaround
If I try to use the private Url for postgres for Direct I get an error but I think it should be fine connecting to public?
12 replies
How to add pgBouncer to existing Postgres database
It provisioned the template in my project but these variables are empty strings so it crashes:
I assume I take the POSTGRESQL variables from my database but then what do I use for
PGBOUNCER_DATABASE
?19 replies