cli icon indicating copy to clipboard operation
cli copied to clipboard

CLI project link SASL authentication failed

Open BahaMagi opened this issue 1 year ago • 44 comments

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

BahaMagi avatar Dec 18 '23 10:12 BahaMagi

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.

sweatybridge avatar Dec 19 '23 06:12 sweatybridge

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

a7c1098a188f4f24a5ab2b776cd28574

as crash ID

BahaMagi avatar Dec 20 '23 12:12 BahaMagi

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

BahaMagi avatar Jan 04 '24 09:01 BahaMagi

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

medclans avatar Feb 13 '24 04:02 medclans

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)

chanmathew avatar Mar 06 '24 04:03 chanmathew

Same issue:

9a5bea6ec9a842b8ace7d5e0620265fb

JTCorrin avatar Mar 11 '24 14:03 JTCorrin

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.

chanmathew avatar Mar 12 '24 02:03 chanmathew

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)

JTCorrin avatar Mar 12 '24 09:03 JTCorrin

@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

henry2man avatar Mar 15 '24 07:03 henry2man

Same issue: fd6fce781a134bc7ab3fa6da0c414401

kathleen-saz avatar Mar 18 '24 07:03 kathleen-saz

same issue here :(

zolotokrylin avatar Mar 18 '24 07:03 zolotokrylin

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.

sweatybridge avatar Mar 20 '24 04:03 sweatybridge

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.

lelandmiller avatar Mar 26 '24 04:03 lelandmiller

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

sweatybridge avatar Mar 26 '24 07:03 sweatybridge

getting same issue crash id: d635a8a3279f4815940d0f920744c9c2

jventura7 avatar Apr 04 '24 06:04 jventura7

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

mdotmoment11 avatar Apr 04 '24 19:04 mdotmoment11

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

mdotmoment11 avatar Apr 04 '24 19:04 mdotmoment11

Closing as it seems resolvable by pw reset.

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

sweatybridge avatar Apr 18 '24 03:04 sweatybridge

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.

chanmathew avatar Apr 18 '24 13:04 chanmathew

I went back and checked. Nope. It was, at the time:

aQwFyLIRdWA5Z0Ug

On Wed, Apr 17, 2024 at 11:26 PM Han Qiao @.***> wrote:

Closing as it seems resolvable by pw reset.

@mdotmoment11 https://github.com/mdotmoment11 Do you remember if your previous password had any special characters in it?

— Reply to this email directly, view it on GitHub https://github.com/supabase/cli/issues/1760#issuecomment-2062923805, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABT5HGOOJCDFKWNLVNV3ATY544NFAVCNFSM6AAAAABAZIL5SGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRSHEZDGOBQGU . You are receiving this because you were mentioned.Message ID: @.***>

--

BRAD CHICK

@.*** 734.662.1701 (h) 734.646.9372 (m)

"Make Some Time for Wasting!" _ | | | | ___ ___ _ __ ___ / | ' \ / _ / _ \ '/ | (| | | | / / | _
_
|| ||_
|_|| |_/

mdotmoment11 avatar Apr 18 '24 14:04 mdotmoment11

Hey every one i also have the same issue dii you got any solution

[error] failed to initialize database, got error failed to connect to host=aws-0-us-east-1.pooler.supabase.com user=postgres.axwqqoifubxkipmilrmm database=postgres: failed SASL auth (invalid SCRAM server-final-message received from server)

p-shubh avatar May 15 '24 14:05 p-shubh

I got resolved this by reset the db password of supabase

p-shubh avatar May 15 '24 14:05 p-shubh