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

CLI project link SASL authentication failed #1760

Closed
BahaMagi opened this issue Dec 18, 2023 · 20 comments
Closed

CLI project link SASL authentication failed #1760

BahaMagi opened this issue Dec 18, 2023 · 20 comments

Comments

@BahaMagi
Copy link

Describe the bug
Similar issue as described here: supabase/supabase#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
@sweatybridge
Copy link
Contributor

Could you send a bug report with the following command

npx supabase@beta link --project-ref <ref> --create-ticket

After that, share the crash ID here so we can retrieve the diagnostics information.

@BahaMagi
Copy link
Author

Thank you for looking into this!
Ran the above command and got

a7c1098a188f4f24a5ab2b776cd28574

as crash ID

@BahaMagi
Copy link
Author

BahaMagi commented Jan 4, 2024

Any news on this? Not being able to use the CLI is somewhat limiting....

@medclans
Copy link

Same steps as above and below is the crash ID
13addb48fe85407d9654266ccbc6dd7a

@chanmathew
Copy link

chanmathew commented Mar 6, 2024

I'm having similar issue - 0d53919556f041ea831728258b4be8e0

This is the error i get:

failed to connect to postgres: failed to connect to `host=aws-0-us-east-1.pooler.supabase.com user=postgres.<REDACTED> database=postgres`: failed SASL auth (invalid SCRAM server-final-message received from server)

@JTCorrin
Copy link

Same issue:

9a5bea6ec9a842b8ace7d5e0620265fb

@chanmathew
Copy link

I'm having similar issue - 0d53919556f041ea831728258b4be8e0

This is the error i get:

failed to connect to postgres: failed to connect to `host=aws-0-us-east-1.pooler.supabase.com user=postgres.<REDACTED> database=postgres`: failed SASL auth (invalid SCRAM server-final-message received from server)

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.

@JTCorrin
Copy link

The way I'm getting around it now is to link and deploy via github actions. The password I am using to link locally is correct (but failing)

@henry2man
Copy link

henry2man commented Mar 15, 2024

@BahaMagi Please check your Supabase CLI version. I was on 1.113.3 and updated to recent 1.148.6 ... and the issue was gone. NOTE: I reset the password before updating the CLI.

Maybe this is related with IPv4 deprecation: https://github.com/orgs/supabase/discussions/17817

@kathleen-saz
Copy link

Same issue: fd6fce781a134bc7ab3fa6da0c414401

@zolotokrylin
Copy link

same issue here :(

@sweatybridge
Copy link
Contributor

Could you try the latest version?

npx supabase@latest link

It's probably due to an implementation difference between transaction mode of pgbouncer and supavisor which we recently rolled out on port 6543.

@lelandmiller
Copy link

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.

@sweatybridge
Copy link
Contributor

I tested on macOS with passwords containing special char # and up to 50 characters in length but still unable to reproduce. Will try win10 later this week

@jventura7
Copy link

getting same issue
crash id: d635a8a3279f4815940d0f920744c9c2

@mdotmoment11
Copy link

same issue. tried the linking and upgraded to latest supabase (1.154.1):
crash id: 1b6bae554170469282c03ca74fbabe1e

@mdotmoment11
Copy link

same issue. tried the linking and upgraded to latest supabase (1.154.1): crash id: 1b6bae554170469282c03ca74fbabe1e

Just went to UI and changed the pw (recommended by supabase). works now

@sweatybridge
Copy link
Contributor

Closing as it seems resolvable by pw reset.

@mdotmoment11 Do you remember if your previous password had any special characters in it?

@chanmathew
Copy link

Just to add, i do notice that in the CLI, it doesn't seem to automatically pickup your password even if logged in, and I had to explicitly export my password to my shell and then run supabase link.

@mdotmoment11
Copy link

mdotmoment11 commented Apr 18, 2024 via email

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