Cannot link to remote project
Describe the bug
Our team regularly faces issues using supabase link to connect to our project. We have both a staging and production enviornment, and we are sometimes able to to connect to one, but not the other, or sometimes neither (sometimes only prod works, other times only staging works, other times neither works).
There does not seem to be any clear reason why this is happening or anything we can do to mitigate it. We have tried increasing our maximum allowed connection for the connection pooler, but we are nowhere near the limit of active connections. We have tried clearing local caches, we have done extensive research online, but there does not appear to be a solution that works consistently. All we can do is wait until the link magically works after some period of time.
This is absurdly frustrating, it appears to be a known issue based on our searches, and it appears to have been plaguing the community for years. I simply cannot understand how this can happen so consistently. It makes the user experience almost unbearable, and it happens far too frequently to be ignored. If it was every now and then, maybe it wouldn't be so bad, but it feels like there's at least 30% chance that if I run supabase link it just won't work and I'll have to wait half an hour or something for it to function again.
To Reproduce
- Run
supabase link - Select project
- Get an error
failed to connect to postgres: failed to connect to `host=aws-0-us-west-1.pooler.supabase.com user=cli_login_postgres.xxx database=postgres`: failed to receive message (timeout: context deadline exceeded)
Expected behavior
Running supabase link should not randomly fail for long periods of time.
System information
- Ticket ID:
31dbee227d78439ea239150a50677c9a - Version of OS: macOS 15.3.1
- Version of CLI: v2.51.0 and v2.54.11
- Version of Docker: v28.4.0
- Versions of services:
SERVICE IMAGE | LOCAL | LINKED
------------------------|------------------------|--------
supabase/postgres | 15.8.1.026 | -
supabase/gotrue | v2.180.0 | -
postgrest/postgrest | v12.2.3 | -
supabase/realtime | v2.57.3 | -
supabase/storage-api | v1.28.2 | -
supabase/edge-runtime | v1.69.15 | -
supabase/studio | 2025.10.27-sha-85b84e0 | -
supabase/postgres-meta | v0.93.1 | -
supabase/logflare | 1.23.2 | -
supabase/supavisor | 2.7.3 | -
I have faced the same issue, indeed frustrating. It is blocking my workflow. Been a supabase user for years and this is very unsatisfying
I was struggling with something that looked very similar (at least facially! who really knows with network issues?). I eventually found https://supabase.com/docs/guides/troubleshooting/error-connection-refused-when-trying-to-connect-to-supabase-database-hwG0Dr , checked my network bans at https://supabase.com/dashboard/project/<project_id>/database/settings#banned-ips , unbanned the one IP that was there, and then the link succeeded. Perhaps the abuse detection is just very sensitive?
I have the exact same issue! Extremely frustrating that it's intermittent and doesn't have any obvious patterns. Like you, I have staging and production. Supabase team, is this on your radar? This is a complete blocker and causing us to look at Supabase alternatives.
I was struggling with something that looked very similar (at least facially! who really knows with network issues?). I eventually found https://supabase.com/docs/guides/troubleshooting/error-connection-refused-when-trying-to-connect-to-supabase-database-hwG0Dr , checked my network bans at https://supabase.com/dashboard/project/<project_id>/database/settings#banned-ips , unbanned the one IP that was there, and then the
linksucceeded. Perhaps the abuse detection is just very sensitive?
I have this issue but no IP bans listed, so not that, the issue is intermittent, so you might still have it
Same problem, randomly we got this error while supabase dump or supabase link. We had to switch to pg_dump directly, then it worked... Seems something to be with the connection pooler.
same issue here... I applied a few migrations, it worked. Tried another, now I'm stuck, unable to finish migrating my db on production.. Not good.
failed to connect to postgres: failed to connect to host=aws-0-us-east-1.pooler.supabase.com user=cli_login_postgres....database=postgres: failed to receive message (timeout: context deadline exceeded)
Any updates on this? I'm having issues as well. I think it's just having trouble connecting to the Postgres instance. I tried psql and I got the same timeout issue
I managed to get it working. Here's what I did
- Downgrade to [email protected] from [email protected]
- Run
supabase link - Upgrade to [email protected]
- Run
supabase linkagain (and it worked)
You might be able to get away with just upgrading to 2.62.10 and then running link. Maybe they patched something in 2.62.10