Failed to connect to postgres
Describe the bug Error connecting to postgres after trying to link supabase CLI to another project. Unlinking another.
The same issue as here - https://github.com/supabase/cli/issues/3960 (I tried what was suggested there, still error.)
To Reproduce Steps to reproduce the behavior:
- Run supabase CLI and run
supabase link - See Error
failed to connect to postgres: failed to connect to `host=aws-1-ap-southeast-2.pooler.supabase.com user=cli_login_postgres.PROJECT_ID database=postgres`: AfterConnect error (ERROR: permission denied to set role "postgres" (SQLSTATE 42501)
System information
Rerun the failing command with --create-ticket flag.
- Ticket ID: [e.g. 21b825bc3818499882ea5bc86313999a]
- Version of OS: [Ubuntu 24.04.3 LTS]
- Version of CLI: [^2.51.0]
- Version of Docker: [v28.4.0]
- Versions of services: [output from
supabase servicescommand]
I have this same error, it was marked resolved in another thread about the same issue. but it persists for me.
same here, both with the latest and the beta version of the cli
same error here, happened when i updated the cli to the newest version
This error is happening for me too. Using version 2.54.11
We have released a fix for this server side. Could you guys try the same command again?
I am still receiving an error, but now it says: Failed SASL auth (invalid SCRAM server-final-message received from server)
Was getting this error, after spending alot of time come to know that, my ip was banned in Database setting, IDK how but it is, unban it and working now
Was getting this error, after spending alot of time come to know that, my ip was banned in Database setting, IDK how but it is, unban it and working now
Dude, you just saved my weekend vibing session. Thank you!
Was getting this error, after spending alot of time come to know that, my ip was banned in Database setting, IDK how but it is, unban it and working now
Yeap, this is the problem. My IP has been marked "abusive" for no reason
I started encountering this issue in my CI pipeline since yesterday, I can't link my project- receiving this error:
failed to connect to postgres: failed to connect to host=db.[MASKED].supabase.co user=cli_login_postgres database=postgres: dial error
I checked and I couldn't see any ip ban in my project settings. Any other ideas on how to fix it?
Thanks in advance!
I started encountering this issue in my CI pipeline since yesterday, I can't link my project- receiving this error: failed to connect to postgres: failed to connect to
host=db.[MASKED].supabase.co user=cli_login_postgres database=postgres: dial errorI checked and I couldn't see any ip ban in my project settings. Any other ideas on how to fix it?
Thanks in advance!
Same here.
This is the output in our GitLab CI/CD pipeline, that was working fine til 5 days ago
npx supabase link --project-ref $SUPABASE_PROJECT_ID
Connecting to remote database...
failed to connect to postgres: failed to connect to `host=db.[SUPABASE_PROJECT_ID].supabase.co user=postgres database=postgres`: dial error (dial tcp [2a05:d019:fa8:a402:48c3:a1b:e46d:e1c8]:5432: connect: network is unreachable)
Try rerunning the command with --debug to troubleshoot the error.
I started encountering this issue in my CI pipeline since yesterday, I can't link my project- receiving this error: failed to connect to postgres: failed to connect to
host=db.[MASKED].supabase.co user=cli_login_postgres database=postgres: dial errorI checked and I couldn't see any ip ban in my project settings. Any other ideas on how to fix it?
Thanks in advance!
Same here.
This is the output in our GitLab CI/CD pipeline, that was working fine til 5 days ago
npx supabase link --project-ref $SUPABASE_PROJECT_ID Connecting to remote database... failed to connect to postgres: failed to connect to `host=db.[SUPABASE_PROJECT_ID].supabase.co user=postgres database=postgres`: dial error (dial tcp [2a05:d019:fa8:a402:48c3:a1b:e46d:e1c8]:5432: connect: network is unreachable) Try rerunning the command with --debug to troubleshoot the error.
Restart or Recreate the project
I think the issue is related to IPv4 support drop https://supabase.com/docs/guides/troubleshooting/supabase--your-network-ipv4-and-ipv6-compatibility-cHe3BP
@michael-elyon I can confirm than in my case the issue was caused by supabase link, which attempts to connect over IPv6. Since the GitLab CI/CD runner doesn’t support IPv6, the command failed.
I resolved the problem by removing supabase link from the pipeline and replacing it with commands that accept the --db-url parameter and the supavisor connection string instead.
For example:
supabase db push --db-url postgresql://postgres.[YOUR_PROJECT_ID]:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:6543/postgres