cli: CLI project link SASL authentication failed
Describe the bug Similar issue as described here: https://github.com/supabase/supabase/issues/15184 Created a new issue here since I suspect this to be a CLI issue.
Created a new project and tried to link the CLI to the project with
npx supabase link
selecting the project manually to make sure the ref is correct. Tried both: providing the password in an env variable and providing it manually when trying to link. From another PC in the same office it works, from this one I get
failed to connect to postgres: failed to connect to `host=db.<out project ID>.supabase.co user=postgres database=postgres`: failed SASL auth (FATAL: SASL authentication failed (SQLSTATE 08P01))
And my IP is listed as blocked in the Supabase Database settings.
Resetting password did not help.
Connecting to the DB directly via for example PGAdmin works as well, so connection link and PW are definitely correct.
Desktop (please complete the following information):
- OS: Win10
- Version of CLI 1.126.0
- Version of supabase-js: 2.39
- Version of Node.js: 18.19.0
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 20
- Comments: 56 (6 by maintainers)
Set the password manually in supabase Reset Password window. Don’t use any special characters, except ‘!’. Don’t copy-paste it in the VSCode terminal. Type it manually, from your memory, not from copied text box on supabase. put it in the .env SUPABASE_DB_PASSWORD= variable. Don’t paste it, type it manually. Works for me.
failed to connect to postgres: failed to connect to 'host=aws-0-eu-west-2.pooler.supabase.com user=postgres.<user> database=postgres': failed SASL auth (invalid SCRAM server-final-messsage received from server)Even the password reset didnt work for me. Setting the SUPABASE_DB_PASSWORD env var also did not help. However when i changed way i was pasting in to the console (right click to ctrl+v) it worked. Pasting both ways to the terminal produce the same exact characters, not sure whats going on here.Closing as it seems resolvable by pw reset.
@mdotmoment11 Do you remember if your previous password had any special characters in it?
Update on this - turns out updating my DB password that was generated by supabase (a shorter one) seems to have fixed it. Perhaps the one I generated previously didn’t work due to password length? Hope this helps others running into this issue.
Any news on this? Not being able to use the CLI is somewhat limiting…
I can reproduce this exact behaviour on windows powershell. Ctrl+v works but not typing into the prompt.
In my case, what made it work was to past it using CTRL+SHIFT+V.
Hey! I was having the same issue even on latest. @chanmathew’s tip to use the password generated by supabase worked for me as well. I wonder if it was related to special characters in my password,
#in particular.I also ran into this issue, but spotted a very dumb user issue after a while.
Generating a conform password by the included tool not means, it is already submitted (as I thought). You have to copy AND also have to submit it. Spent a couple of hours and support emails to figure this out.
In case this is still an issue. I solved it by upgraded supabase cli to version
2.x.xand re-runningsupabase login. After thatsupabase linkworked without any issues.OS: MacOS Version of CLI 2.19.7
Hi,
For me @sweatybridge got it:
In case somebody missed this. So does not work in Docker terminal, or Visual code terminal etc.
BUT on command prompt I could run without errors. Running supabase commands with NPX
Turn my terminal off and turned it on again and it works 🤷
The temporary workaround is to set
SUPABASE_ACCESS_TOKENenvironment variable. For eg.supabase.exe linkdidn’t worksupabase.exe link --project-refworked🤷♂️
Just went to UI and changed the pw (recommended by supabase). works now