cli: Can't link project (connect: no route to host)
Describe the bug
I get the following error trying to link to the project using supabase link
failed to connect to `host=db.redacted.supabase.co user=postgres database=postgres`: dial error (dial tcp [2600:1f1c:f9:4d0a:8d82:ad21:9ea8:8fd9]:5432: connect: no route to host)
Try rerunning the command with --debug to troubleshoot the error.```
I have tried to execute some other commands like pull and push using the --db-url flag but I get a similar error.
I noticed that on my dashboard some times I get an ip banned, I guess it's mine, I unban it but the problem persists.
**To Reproduce**
Steps to reproduce the behavior:
1. Download supabase cli
2. Execute supabase link
3. Select a project
4. Type the password
5. Get the error
**Expected behavior**
Should be able to link the project or get a more concise description of what the problem is.
**System information**
- OS: MAC OS
- Version of CLI: 1.123.4
**Additional context**
- Version of Node.js: 20.8.1
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (7 by maintainers)
I just realized that I have supabase globally instaled on my computer so I never type the npx prefix to the commands. I tried executing the commands adding the prefix. i.e
npx supabase linkAnd now I don’t get the connection error.
You only need IPv6 on home router when connecting directly to hosted db. Connecting to the connection pooler still works over IPv4.
If you are having trouble linking, try deleting
supabase/.tempbeforesupabase link.I had the same problem with supabase
v1.120.0:npx supabase link --project-ref XXX --password YYYtried to connect todb.XXX.supabase.cowith error:although connection pooling is enabled and host should be
aws-0-eu-central-1.pooler.supabase.comAfter upgrading Supabase to
v1.145.4, the linking worked properly.