P
Prisma5mo ago
Abhinav

Can't reach database server at `aws-0-ap-south-1.pooler.supabase.com:5432`

DATABASE_URL="postgres://postgres.tdaudbkvlopqsbzesmau:[email protected]:6543/postgres" DIRECT_URL="postgres://postgres.tdaudbkvlopqsbzesmau:[email protected]:5432/postgres" Using supabase + prisma. This problem is haunting me. Please help me.
31 Replies
Abhinav
Abhinav5mo ago
2 days
jonfanz
jonfanz5mo ago
@Abhinav if you followed that link, change your passwords immediately. That individual was not associated with Prisma.
Abhinav
Abhinav5mo ago
yes, I figured out. Thanks a lot! Someone please help with the question
Jan Piotrowski (janpio)
Did you follow Supabase's instructions? https://supabase.com/partners/integrations/prisma
Supabase
Prisma | Works With Supabase
Next-generation Node.js and TypeScript ORM.
Abhinav
Abhinav5mo ago
yes, followed. but still same error
Jan Piotrowski (janpio)
What command exactly are you running? And what is the output and full error message you are getting?
Abhinav
Abhinav5mo ago
No description
Abhinav
Abhinav5mo ago
.env file
DATABASE_URL="postgres://postgres.ydwxvgrxrvchtdabfjde:[email protected]:6543/postgres?pgbouncer=true&connection_limit=1?connect_timeout=300"
DIRECT_URL="postgres://postgres.ydwxvgrxrvchtdabfjde:[email protected]:5432/postgres"
DATABASE_URL="postgres://postgres.ydwxvgrxrvchtdabfjde:[email protected]:6543/postgres?pgbouncer=true&connection_limit=1?connect_timeout=300"
DIRECT_URL="postgres://postgres.ydwxvgrxrvchtdabfjde:[email protected]:5432/postgres"
Jan Piotrowski (janpio)
?connect_timeout=300 would need to be &connect_timeout=300 to actually work, but that connection string is not used in the db push command I just created a new project:
PS C:\Users\Jan\Documents\throwaway\postgresql-supabase> npx prisma db push
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "aws-0-us-east-1.pooler.supabase.com:5432"

The database is already in sync with the Prisma schema.
PS C:\Users\Jan\Documents\throwaway\postgresql-supabase> npx prisma db push
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "aws-0-us-east-1.pooler.supabase.com:5432"

The database is already in sync with the Prisma schema.
Which region is aws-0-ap-south-1? Singapore it seems, I also just created a database there and everything works.
Abhinav
Abhinav5mo ago
I have different regions too. I wonder what the problem is?
Jan Piotrowski (janpio)
It happens every time? Maybe try this:
DIRECT_URL="postgres://postgres.ydwxvgrxrvchtdabfjde:[email protected]:5432/postgres?connect_timeout=300"
DIRECT_URL="postgres://postgres.ydwxvgrxrvchtdabfjde:[email protected]:5432/postgres?connect_timeout=300"
That would tell Prisma to wait longer when trying to connect when you run db push.
Abhinav
Abhinav5mo ago
Yes. Haven't been able to run a project. it was working fine earlier (3-4 months back). then it was paused. Now it doesn't work. yes trying yes the issue still persists. seems like the database is not working? how can I test it?
Jan Piotrowski (janpio)
I sent you a DM. Generally you can use any other database tool to try these credentials.
Abhinav
Abhinav5mo ago
No description
Abhinav
Abhinav5mo ago
will something like tableplus work?
Jan Piotrowski (janpio)
Ok, now we have a mysery:
No description
Jan Piotrowski (janpio)
I used your connection string twice. First time it failed, second time it worked. In between these two I connected via DBeaver (a tool similar to tableplus). Can you try again if it works for your with Prisma now as well?
Abhinav
Abhinav5mo ago
nopes doesn't work : ( let me try tableplus
Jan Piotrowski (janpio)
For me it keeps working.
Abhinav
Abhinav5mo ago
do you think it's a network issue?
Jan Piotrowski (janpio)
I am not sure. I am confused now why it didn't work for me initially, but now consistently works.
Abhinav
Abhinav5mo ago
No description
Abhinav
Abhinav5mo ago
it doesn't go after this
Jan Piotrowski (janpio)
That, plus that you can not use the credentials I shared via DM, indicates a networking problem indeed. Somehow your computer or network can not connect to Supabase's databases.
Abhinav
Abhinav5mo ago
cool I will try changing DNS and other stuff. Will let you know. Thanks a lot! Big big help.
Abhinav
Abhinav5mo ago
No description
Abhinav
Abhinav5mo ago
tried everything FINALLY WORKED USED VPN and worked it's so weird even with VPN it didn't work first time Thanks a lot for your time, big help!
K1|ller
K1|ller5mo ago
I'm using supabase too and it works but what it won't work is realtime, a week of emails already, I'm 99% sure they have problems with it
jonfanz
jonfanz5mo ago
Glad it’s working 🙂 Could you quickly summarize what was going wrong and what you did to fix it? We’re seeing a number of Supabase related issues like this one and are working with them to figure out an underlying cause
Abhinav
Abhinav5mo ago
Yes, basically supabase has some weird problem where it just doesn't connect. DBeaver showed connection timeout. I tried everything like making another project (with different hosting place) but it finally worked when I turned on VPN and then tried 2-3 times. Now it works for local deployment but still shows some error in vercel deployment.
Unhandled Rejection: PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-1.0.x".
We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.
This is likely caused by a bundler that has not copied "libquery_engine-rhel-openssl-1.0.x.so.node" next to the resulting bundle.
Ensure that "libquery_engine-rhel-openssl-1.0.x.so.node" has been copied next to the bundle or in "node_modules/.pnpm/@[email protected][email protected]/node_modules/.prisma/client".
We would appreciate if you could take the time to share some information with us.
Please help us by answering a few questions: https://pris.ly/engine-not-found-bundler-investigation
The following locations have been searched:
/var/task/node_modules/.pnpm/@[email protected][email protected]/node_modules/.prisma/client
/var/task/.next/server
/vercel/path0/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client
/var/task/.prisma/client
/tmp/prisma-engines
at wa (/var/task/.next/server/chunks/452.js:64:841)
at async Object.loadLibrary (/var/task/.next/server/chunks/452.js:111:10446)
at async wt.loadEngine (/var/task/.next/server/chunks/452.js:112:452)
at async wt.instantiateLibrary (/var/task/.next/server/chunks/452.js:111:13267) {
clientVersion: '5.15.0',
errorCode: undefined
}
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
Unhandled Rejection: PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-1.0.x".
We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.
This is likely caused by a bundler that has not copied "libquery_engine-rhel-openssl-1.0.x.so.node" next to the resulting bundle.
Ensure that "libquery_engine-rhel-openssl-1.0.x.so.node" has been copied next to the bundle or in "node_modules/.pnpm/@[email protected][email protected]/node_modules/.prisma/client".
We would appreciate if you could take the time to share some information with us.
Please help us by answering a few questions: https://pris.ly/engine-not-found-bundler-investigation
The following locations have been searched:
/var/task/node_modules/.pnpm/@[email protected][email protected]/node_modules/.prisma/client
/var/task/.next/server
/vercel/path0/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client
/var/task/.prisma/client
/tmp/prisma-engines
at wa (/var/task/.next/server/chunks/452.js:64:841)
at async Object.loadLibrary (/var/task/.next/server/chunks/452.js:111:10446)
at async wt.loadEngine (/var/task/.next/server/chunks/452.js:112:452)
at async wt.instantiateLibrary (/var/task/.next/server/chunks/452.js:111:13267) {
clientVersion: '5.15.0',
errorCode: undefined
}
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
By adding binaryTargets = ["native"] like this in the schema file
generator client {
provider = "prisma-client-js"
binaryTargets = ["native"]
}
generator client {
provider = "prisma-client-js"
binaryTargets = ["native"]
}
I was able to solve this problem but still very unsatisfactory performance. The retrieval from database is taking forever and getting errors almost every 3rd time
Want results from more Discord servers?
Add your server