failed to connect to postgres since 2.40.4, works on --debug

Open
#4,142 12 comments 30 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
postgresql, typescript
Domain
cli, databases

Research direction

Start by reviewing PR #4113 and reproduce the regression with the shown pnpx supabase@2.40.4 db reset --db-url command against the Docker Compose Postgres instance. Compare the normal and --debug runs to locate the differing connection behavior. Done means db reset connects successfully without --debug, while the existing 2.40.3 behavior remains intact.

Written by the indexing model from the issue text.

Description

🐛 Bug do-not-close supabase/cli

https://github.com/supabase/cli/pull/4113 introduced an error for our supabase in docker-compose (for development), i.e. running:

pnpx supabase@2.40.3 db reset --db-url "postgres://postgres:supadev@localhost:53322"

works, but 2.40.4 with the change from #4113 :

Do you want to reset the remote database? [y/N] y 
Resetting remote database...
failed to connect to postgres: failed to connect to `host=localhost user=postgres database=`: tls error (server refused TLS connection)
Try rerunning the command with --debug to troubleshoot the error.

Is there some setting we can fix this by?

In addition to it, what's a bit surprising, is that when adding --debug, it actually does run fine.

Dominant language
TypeScript
Stars
2.4k
Forks
523
Avg merge
21h 33m
Merged PRs (30d)
258

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/cli

All issues in supabase/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.