-
Notifications
You must be signed in to change notification settings - Fork 296
Description
Supabase CLI Database Password Not Saved - Shows [YOUR-PASSWORD] Placeholder
Summary
The Supabase CLI fails to properly save database passwords during the supabase link
command, resulting in persistent authentication failures when trying to connect to remote databases. The CLI shows [YOUR-PASSWORD]
placeholder in connection strings instead of the actual password.
Environment
- CLI Version: 2.40.7 (built from source on 2025-09-19)
- Installation Method: Homebrew (
brew install supabase/tap/supabase
) - OS: macOS (darwin 24.6.0)
- Project: bdrkxrozxfzlabdpdwim (supabase-answerpath24)
Steps to Reproduce
-
Link project with password:
supabase link --project-ref bdrkxrozxfzlabdpdwim --password NZmAO29HbEmzuFCI
-
Verify connection:
supabase migration list --linked
-
Observe failure:
failed to connect to postgres: failed to connect to `host=aws-0-us-east-1.pooler.supabase.com user=postgres.bdrkxrozxfzlabdpdwim database=postgres`: failed SASL auth (invalid SCRAM server-final-message received from server)
Expected Behavior
The CLI should successfully connect to the remote database using the provided password.
Actual Behavior
The CLI fails with "Wrong password" errors and shows [YOUR-PASSWORD]
placeholder in connection strings.
Debug Output
$ supabase migration list --linked --debug
Using project host: supabase.co
Supabase CLI 2.40.7
Loading project ref from flag: bdrkxrozxfzlabdpdwim
Using access token from env var...
Using connection pooler: postgresql://postgres.bdrkxrozxfzlabdpdwim:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:6543/postgres
Connecting to remote database...
2025/09/19 15:22:11 PG Recv: {"Type":"AuthenticationSASLFinal","Data":"e=Wrong password"}
failed to connect to postgres: failed to connect to `host=aws-0-us-east-1.pooler.supabase.com user=postgres.bdrkxrozxfzlabdpdwim database=postgres`: failed SASL auth (invalid SCRAM server-final-message received from server)
Verification That Password is Correct
The same password works perfectly with direct PostgreSQL connections:
$ PGPASSWORD=NZmAO29HbEmzuFCI psql -h aws-0-us-east-1.pooler.supabase.com -p 6543 -U postgres.bdrkxrozxfzlabdpdwim -d postgres -c "SELECT version();"
version
------------------------------------------------------------------------------------
PostgreSQL 17.4 on aarch64-unknown-linux-gnu, compiled by gcc (GCC) 13.2.0, 64-bit
(1 row)
Configuration Files
- Project ref file:
supabase/.temp/project-ref
containsbdrkxrozxfzlabdpdwim
- Pooler URL file:
supabase/.temp/pooler-url
containspostgresql://postgres.bdrkxrozxfzlabdpdwim:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:6543/postgres
Attempted Solutions
- ✅ Re-linking with password flag:
supabase link --project-ref bdrkxrozxfzlabdpdwim --password NZmAO29HbEmzuFCI
- ✅ Using environment variable:
SUPABASE_DB_PASSWORD=NZmAO29HbEmzuFCI supabase link --project-ref bdrkxrozxfzlabdpdwim
- ✅ Clearing cached credentials:
supabase unlink
then re-linking - ✅ Updating CLI: Already running latest version (2.40.7)
Impact
- Developer Experience: Cannot use CLI commands that require database access (
migration list
,db push
, etc.) - Workflow Disruption: Must use alternative methods (direct psql, Supabase Dashboard) for database operations
- Authentication Confusion: CLI appears to authenticate successfully but fails on database operations
Additional Context
- The CLI successfully authenticates with Supabase API (can list projects, fetch project details)
- The issue is specifically with database password storage/retrieval
- The
[YOUR-PASSWORD]
placeholder persists across multiple link attempts - Environment variables (
PGPASSWORD
) are not respected by the CLI
Related Issues
- Similar authentication issues reported in #15184, CLI: Supabase Authentication. error: password authentication failed for user "postgres" #1770, #30910
- Multiple users experiencing "Wrong password" errors with CLI
Workaround
Currently using direct PostgreSQL connections for database operations:
PGPASSWORD=NZmAO29HbEmzuFCI psql -h aws-0-us-east-1.pooler.supabase.com -p 6543 -U postgres.bdrkxrozxfzlabdpdwim -d postgres
Priority: High - Core CLI functionality is broken
Labels: bug
, authentication
, database
, cli