Might be stupid, but can't get supabase to connect
After running production nicely for a few months, supabase suddenly decided to stop connecting. Tried resetting passwords, updating prisma, changing the connection string. I'm hosting a site on a VPS using Next & Prisma
41 Replies
You tagged PostgREST which is the API and mention Next. But also mention Prisma and connection string so I assume you are talking DB connections with ports.
What is your error?
Does the dashboard work?
Does something like PSQL work with the database ports?
At the bottom of Dashboard settings is an IP block list. Anything there?
Yeah, my bad.
I added
?pgbouncer=true&connect_timeout=600&connection_limit to the connection url which resulted in:
changing to:
Dashboard is working, there was one ip in the block list but after removing nothing changed, and it's not working on either local or prod. PSQL haven't checked that yetSo that is an IPv6 only connection port. I assume you were using pgbouncer (the flag is not directly related to that). Adding those to the URL broke things, or it was already broken with some error?
Your 2nd error is Prisma so wrong place to ask.
Are you Pro?
Yes
If you are not, then there is no pgbouncer and you have to use supavisor pooler port.
Using pg bouncer yeah
Could you have lost IPv6 somehow?
Logs are indicating that the requests are authorized
Uh
Well it's weird given that it stopped working both locally and in the vps all of the sudden
Do you have the IPv4 $4 addon?
And I'm just throwing stuff out there right now trying to narrow down as I don't use Prisma, but sort of going thru the mistakes I see here.
I don't
You could try the transaction Pooler port of supavisor (in your connection tab for settings).
That is IPv4 and would eliminate IPv6 not working if that is the issue.
Yeah, just tried that. It's saying that it can't parse the port but that seems to be a prisma issue
Are your Prisma calls coming from your server?
Yeah
So I would not think.... IPv6 would not suddenly not work. That is more changing networks/routers/computer.
And checking from PSQL on your computer would more be checking your Supabase instance is working and not your server connection.
I'm gonna check through PSQL now
When you say local or production do you mean your "app" code in both places accessing a hosted instance, or your Prisma code accessing a local instance and a hosted instance.
Application code
Neon.tech is connecting
But supabase isnt
No outages being reported by users here or github. And you are using the pgbouncer in your instance so not impacted by Supavisor.
I don't know if neon is IPv6 only or not.
The supavisor transaction port does work with Prisma, and might provide useful debug info, but not sure I can help much with why Prisma is complaining.
psql: error: invalid integer value "nxUtqPEamjWQ-0-us-west-1.pooler.supabase.com:5432" for connection option "port"
getting this from psql
Is the string correct?
Does not look right to me.
I thought I copied it from the supabase site
Session pooler, to test the IPv6 thing

Same for 5432 port.
I don't know what that giberish is at start of your URL.
Are you using a full url with password in it?
If so and your password has special characters that will mess up the URL. You have to URL encode them.
Using supabase's generator now so shouldnt have, checking the transaction pooler right now
The URL generator does not add the password.
I'm aware
I reset the password and put it in the connection string
Replacing the [YOUR-PASSWORD], correct?
Does it have special characters?
No
K
Just upper and lower case letters
Your password does not include the [] .
It does not
Not sure why your URL getting to PSQL has this in it.

Yeah, I accidently removed the @ there but it's still not working
PSQL says it' the wrong password even though i resetted it and copied it right after
Using the session pooler
And for the transaction pooler; it loads indefinitely
So PSQL connected enough to check the password?
Yeah
And if you try the direct port?
But probably not relevant because now you are going from your computer to Supabase and not from your server to Supabase. So IPv6 support could be totally different.
Also loading
I'd get a support request going to see if the instance might have issues. Just too hard to tell right now. And hard to debug connections back and forth like this.
You could restart instance, but the asking for Password seems to say the connection got there for that case.
I couldn't tell you what happened but it just suddenly started working again
Already escalated to supabase, but at least the prod is up again
Thank you for your time, stuff just costed me 4 hours of sleep probably more if it werent for you