Getting error trying to link my project in my ci pipeline
Hello,
I am trying to link my supabase project as part of my CI gitlab pipeline and getting the following error:
failed to connect to postgres: failed to connect to
host=db.[MASKED].supabase.co user=cli_login_postgres database=postgres: dial error
I did not change anything in the pipeline, or the way I link my project.
Tried switching to a different, older supabase version (currently I am updating for latest version before trying to link), I'm still receiving the same error.
Would appreciate any help in the matter, thanks!5 Replies
You should use the latest version in your CI pipeline which was released 4 hours or so ago. It is said to have fixed an issue looking similiar to the error you are getting.
https://github.com/supabase/cli/issues/4503
@silentworks Unfortunately this did not solve my issue:
Adding log prints below if that helps- added the debug flag for better readability:
npx supabase link --debug --project-ref $SUPABASE_STAGING_PROJECT_ID
open supabase/.temp/profile: no such file or directory
Supabase CLI 2.62.5
Using profile: supabase (supabase.co)
Loading project ref from flag: [MASKED]
Using access token from env var...
2025/11/25 14:35:35 HTTP GET: https://api.supabase.com/v1/projects/[MASKED]
2025/11/25 14:35:36 HTTP GET: https://api.supabase.com/v1/projects/[MASKED]/api-keys?reveal=true
2025/11/25 14:35:37 HTTP GET: https://api.supabase.com/v1/projects/[MASKED]/config/storage
2025/11/25 14:35:37 HTTP GET: https://api.supabase.com/v1/projects/[MASKED]/network-restrictions
2025/11/25 14:35:37 HTTP GET: https://api.supabase.com/v1/projects/[MASKED]/config/database/postgres
2025/11/25 14:35:37 HTTP GET: https://api.supabase.com/v1/projects/[MASKED]/postgrest
2025/11/25 14:35:37 HTTP GET: https://api.supabase.com/v1/projects/[MASKED]/config/auth
2025/11/25 14:35:37 HTTP GET: https://api.supabase.com/v1/projects/[MASKED]/config/database/pooler
2025/11/25 14:35:37 HTTP GET: https://[MASKED].supabase.co/rest/v1/
2025/11/25 14:35:37 HTTP GET: https://[MASKED].supabase.co/auth/v1/health
2025/11/25 14:35:37 HTTP GET: https://[MASKED].supabase.co/storage/v1/version
Resolved DNS: [......................]:53
Initialising login role...
2025/11/25 14:35:37 HTTP POST: https://api.supabase.com/v1/projects/[MASKED]/cli/login-role
Connecting to remote database...
failed to connect to postgres: failed to connect to
host=db.[MASKED].supabase.co user=cli_login_postgres database=postgres: dial error (dial tcp [..........................]:5432: connect: network is unreachable)
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1You should check your Network Ban list to make sure the IP you are connecting from here isn't banned.
I do not have any banned IPs:

opened this bug:
https://github.com/supabase/cli/issues/4511
GitHub
Getting error trying to link my project in my GitLab CI pipeline (S...
Describe the bug A clear and concise description of what the bug is. To Reproduce Steps to reproduce the behavior: Run "npx supabase link --project-ref $MY_PROJECT_REF Expected behavior Should...