Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supabase db dump results in wrong password error #2325

Open
Daniel-Ash opened this issue May 27, 2024 · 21 comments
Open

Supabase db dump results in wrong password error #2325

Daniel-Ash opened this issue May 27, 2024 · 21 comments

Comments

@Daniel-Ash
Copy link

Describe the bug
supabase db dump results in error: pg_dump: error: connection to server at "aws-0-us-east-1.pooler.supabase.com" (44.216.29.125), port 5432 failed: error received from server in SCRAM exchange: Wrong password

To Reproduce
Steps to reproduce the behavior:

  1. Run supabase link. (Link project requires the correct password to authenticate, and succeeds)
  2. Run supabase db dump.
  3. Receive error.

Expected behavior
Supabase db dump should authenticate successfully.

Screenshots
n/a

System information
Rerun the failing command with --create-ticket flag.

  • Ticket ID: 7de07aac103942d89638f1b3d92b0cc2
  • Version of OS: Microsoft Windows 11 Home 10.0.22631 N/A Build 22631
  • Version of CLI: 1.167.4
  • Version of Docker: 4.20.1
  • Versions of services:
    SERVICE IMAGE │ LOCAL │ LINKED
    ─────────────────────────┼──────────────────────┼────────────
    supabase/postgres │ 15.1.1.44 │ 15.1.1.44
    supabase/gotrue │ v2.151.0 │ v2.151.0
    postgrest/postgrest │ v12.0.2 │ v12.0.2
    supabase/realtime │ v2.28.32 │ -
    supabase/storage-api │ v1.2.1 │ v1.2.1
    supabase/edge-runtime │ v1.49.0 │ -
    supabase/studio │ 20240506-2976cd6 │ -
    supabase/postgres-meta │ v0.80.0 │ -
    supabase/logflare │ 1.4.0 │ -
    bitnami/pgbouncer │ 1.20.1-debian-11-r39 │ -
    darthsim/imgproxy │ v3.8.0 │ -

Additional context
I found a post with a similar issue where the recommended advice was to reset the password, which resolved the issue for me initially (sorry I couldn't find that post), however the same issue occurred a day later. It is not a suitable solution for us to rotate passwords every time this occurs.

If I run supabase db dump -p [password] then it works.

@JuanxCursed
Copy link

+1

@sweatybridge
Copy link
Contributor

Sorry for the late reply. I can't reproduce this issue locally. Is it still happening to anyone's projects?

@JuanxCursed
Copy link

Yes, I do have 2 projects; this happens on both of them.
Even following this guide, is not working as expected with cd/ci pipelines:
https://supabase.com/docs/guides/cli/github-action/backups

@Jaseibert
Copy link

Yup, I have the issue on one of my projects.

@alex13slem
Copy link

+1

@philipAthanasopoulos
Copy link

Me too

@zoahmed-xyz
Copy link

same here

@JuanxCursed
Copy link

Any updates on this?

@lalitntaparia
Copy link

Same issue here: Dumping data from remote database...
pg_dump: error: connection to server at "aws-0-ap-southeast-1.pooler.supabase.com" port 6543 failed: error received from server in SCRAM exchange: Wrong password

@Aging-Developer
Copy link

having the same issue also

@igormariano89
Copy link

me too

@sweatybridge
Copy link
Contributor

If you are on Windows, try pasting the password with ctrl+v instead of typing #1760 (comment)

@bugswritter
Copy link

having the same issue on my local machine.
pg_restore: connecting to database for restore pg_restore: error: connection to server at "aws-0-us-east-1.pooler.supabase.com" (52.45.94.125), port 6543 failed: error received from server in SCRAM exchange: Wrong password

@wiksien
Copy link

wiksien commented Oct 29, 2024

I had the same issue and it turns out that when you have the URI link with [YOUR_PASSWORD] you need to delete the square brackets too! Silly error, but easy to make considering the way the whole links looks. I'd consider to remove the square brackets and just leave YOUR_PASSWORD to avoid confusion. @sweatybridge

@JuanxCursed
Copy link

I had the same issue and it turns out that when you have the URI link with [YOUR_PASSWORD] you need to delete the square brackets too! Silly error, but easy to make considering the way the whole links looks. I'd consider to remove the square brackets and just leave YOUR_PASSWORD to avoid confusion. @sweatybridge

I'm not using the [], but is not working stil

@bugswritter
Copy link

My issue was my password had $ , i just escaped the sign with \$.

@danielrsenna
Copy link

same issue here

@JuanxCursed
Copy link

Even scaping I'm still getting that the door is invalid:


Run supabase db dump --db-url "$supabase_db_url" -f supabase/roles.sql --role-only
failed to parse connection string: cannot parse `******:6543/postgres`: failed to parse as URL (parse "postgresql://postgres.xxxxxx:***": invalid port ":***" after host)
Try rerunning the command with --debug to troubleshoot the error.
Error: Process completed with exit code 1.

@devamaz
Copy link

devamaz commented Dec 15, 2024

I am having the same issue

@Skaenyde
Copy link

Skaenyde commented Dec 29, 2024

In my case I am using SqlAlchemy and I was fighting with psycopg2 and asyncpg for a while. I eventually stopped trying asyncpg and in my main.py i still had a line trying async calls.

This worked

@app.on_event("startup")
def init_db():
     with engine.connect() as connection:
         Base.metadata.create_all(bind=connection)

This was causing the wrong password error:

@app.on_event("startup")
async def init_db():
    async with engine.begin() as conn:
        await conn.run_sync(Base.metadata.create_all)

@markledwich2
Copy link

I am also having the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests