S
Supabase2mo ago
Kaj

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
garyaustin
garyaustin2mo ago
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?
Kaj
KajOP2mo ago
Yeah, my bad. I added ?pgbouncer=true&connect_timeout=600&connection_limit to the connection url which resulted in:
Can't reach database server at `db.vdvdalslvrticylmitcv.supabase.co:6543`
Can't reach database server at `db.vdvdalslvrticylmitcv.supabase.co:6543`
changing to:
The provided database string is invalid. The provided arguments are not supported in database URL. Please refer to the documentation in https://www.prisma.io/docs/reference/database-reference/connection-urls for constructing a correct connection string. In some cases, certain characters must be escaped. Please check the string for any illegal characters.
The provided database string is invalid. The provided arguments are not supported in database URL. Please refer to the documentation in https://www.prisma.io/docs/reference/database-reference/connection-urls for constructing a correct connection string. In some cases, certain characters must be escaped. Please check the string for any illegal characters.
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 yet
garyaustin
garyaustin2mo ago
So 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?
Kaj
KajOP2mo ago
Yes
garyaustin
garyaustin2mo ago
If you are not, then there is no pgbouncer and you have to use supavisor pooler port.
Kaj
KajOP2mo ago
Using pg bouncer yeah
garyaustin
garyaustin2mo ago
Could you have lost IPv6 somehow?
Kaj
KajOP2mo ago
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
garyaustin
garyaustin2mo ago
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.
Kaj
KajOP2mo ago
I don't
garyaustin
garyaustin2mo ago
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.
Kaj
KajOP2mo ago
Yeah, just tried that. It's saying that it can't parse the port but that seems to be a prisma issue
garyaustin
garyaustin2mo ago
Are your Prisma calls coming from your server?
Kaj
KajOP2mo ago
Yeah
garyaustin
garyaustin2mo ago
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.
Kaj
KajOP2mo ago
I'm gonna check through PSQL now
garyaustin
garyaustin2mo ago
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.
Kaj
KajOP2mo ago
Application code Neon.tech is connecting But supabase isnt
garyaustin
garyaustin2mo ago
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.
Kaj
KajOP2mo ago
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?
garyaustin
garyaustin2mo ago
Does not look right to me.
Kaj
KajOP2mo ago
I thought I copied it from the supabase site Session pooler, to test the IPv6 thing
garyaustin
garyaustin2mo ago
No description
garyaustin
garyaustin2mo ago
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.
Kaj
KajOP2mo ago
Using supabase's generator now so shouldnt have, checking the transaction pooler right now
garyaustin
garyaustin2mo ago
The URL generator does not add the password.
Kaj
KajOP2mo ago
I'm aware I reset the password and put it in the connection string Replacing the [YOUR-PASSWORD], correct?
garyaustin
garyaustin2mo ago
Does it have special characters?
Kaj
KajOP2mo ago
No
garyaustin
garyaustin2mo ago
K
Kaj
KajOP2mo ago
Just upper and lower case letters
garyaustin
garyaustin2mo ago
Your password does not include the [] .
Kaj
KajOP2mo ago
It does not
garyaustin
garyaustin2mo ago
Not sure why your URL getting to PSQL has this in it.
No description
Kaj
KajOP2mo ago
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
garyaustin
garyaustin2mo ago
So PSQL connected enough to check the password?
Kaj
KajOP2mo ago
Yeah
garyaustin
garyaustin2mo ago
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.
Kaj
KajOP2mo ago
Also loading
garyaustin
garyaustin2mo ago
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.
Kaj
KajOP2mo ago
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

Did you find this page helpful?