S
Supabase2d ago
cj

Can't `supabase db pull` Error: SSL connection is required

I found this issue on github - https://github.com/supabase/cli/issues/1969 Tried supabase logout, supabase login, supabase unlink, supabase link --project-ref <project-id>, supabase db pull --debug But I still get the error SSL connection is required I tried asking on reddit - https://www.reddit.com/r/Supabase/comments/1mtjfuk/cant_supabase_db_pull_error_ssl_connection_is/
18 Replies
cj
cjOP2d ago
Here is the log for supabase db pull --debug
cj
cjOP2d ago
I also tried without the debug flag supabase db pull and this is what I see
supabase db pull
Initialising cli_login_postgres role...
Connecting to remote database...
Initialising schema...base...
Seeding globals from roles.sql...
Applying migration 20250426011242_<>.sql...
Applying migration 20250426021242_<>.sql...
Applying migration 20250427031242_<>.sql...
Applying migration 20250427041242_<>.sql...
Applying migration 20250427051242_<>.sql...
Applying migration 20240427051252_<>.sql...
Applying migration 20240427061242_<>.sql...
Applying migration 20240428000000_<>.sql...
Applying migration 20240515122300_<>.sql...
Applying migration 20240516061242_<>.sql...
Applying migration 20240829140537_<>.sql...
Applying migration 20241006112758_<>.sql...
Applying migration 20250730000001_<>.sql...
error diffing schema: error running container: exit 1:
[select_097e65a]: Executing query failed: SSL connection is required
main worker has been destroyed
supabase db pull
Initialising cli_login_postgres role...
Connecting to remote database...
Initialising schema...base...
Seeding globals from roles.sql...
Applying migration 20250426011242_<>.sql...
Applying migration 20250426021242_<>.sql...
Applying migration 20250427031242_<>.sql...
Applying migration 20250427041242_<>.sql...
Applying migration 20250427051242_<>.sql...
Applying migration 20240427051252_<>.sql...
Applying migration 20240427061242_<>.sql...
Applying migration 20240428000000_<>.sql...
Applying migration 20240515122300_<>.sql...
Applying migration 20240516061242_<>.sql...
Applying migration 20240829140537_<>.sql...
Applying migration 20241006112758_<>.sql...
Applying migration 20250730000001_<>.sql...
error diffing schema: error running container: exit 1:
[select_097e65a]: Executing query failed: SSL connection is required
main worker has been destroyed
inder
inder2d ago
You likely have ssl enforced for db connection. You can disable it here https://supabase.com/dashboard/project/_/database/settings or download the certificate and add it in ~/.postgresql/root.crt Also the --debug flag seems to be incompatible with ssl mode at the moment https://github.com/supabase/cli/issues/1969
cj
cjOP2d ago
Should I restart the service or something? I added the certificate to ~/.postgresql/root.crt and ran supabase db pull and still get the same error
inder
inder2d ago
What is your cli version?
cj
cjOP2d ago
2.34.3
inder
inder2d ago
I only got this error when I entered the wrong db password
cj
cjOP2d ago
I tried unlinking and relinking. stopped and restarted the supabase services. What else can I try?
inder
inder2d ago
Are you sure about the password?
cj
cjOP2d ago
But I don't enter a db password anywhere I follow this doc to make changes in my local db and push changes to my remote db https://supabase.com/docs/guides/local-development/overview
inder
inder2d ago
Thats strange. I've to add db password everytime I run pull cmd.
cj
cjOP2d ago
Which version of the CLI are you using?
inder
inder2d ago
same as yours
cj
cjOP2d ago
Hm. What is going on? It was working last time I pushed a migration (a few months ago).
Applying migration 20250730000001_<>.sql...
This is the new migration. At this step it fails with the error
inder
inder2d ago
Try disabling ssl enforcement and see if that works
cj
cjOP2d ago
Yes db pull worked. But it also created a remote_schema migration file. I didn't make any migration via the dashboard. I don't know whats going on. But thanks you for your help. This issue should be resolved. (My last migration was a year ago. Maybe supabase updated pg?)
inder
inder2d ago
it creates a remote schema file to keep changes in sync with remote Very much likely
cj
cjOP2d ago
Thanks a lot @inder

Did you find this page helpful?