Skip to content

# Supabase CLI Database Password Not Saved - Shows [YOUR-PASSWORD] Placeholder #4185

@cmullins70

Description

@cmullins70

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

  1. Link project with password:

    supabase link --project-ref bdrkxrozxfzlabdpdwim --password NZmAO29HbEmzuFCI
  2. Verify connection:

    supabase migration list --linked
  3. 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 contains bdrkxrozxfzlabdpdwim
  • Pooler URL file: supabase/.temp/pooler-url contains postgresql://postgres.bdrkxrozxfzlabdpdwim:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:6543/postgres

Attempted Solutions

  1. Re-linking with password flag: supabase link --project-ref bdrkxrozxfzlabdpdwim --password NZmAO29HbEmzuFCI
  2. Using environment variable: SUPABASE_DB_PASSWORD=NZmAO29HbEmzuFCI supabase link --project-ref bdrkxrozxfzlabdpdwim
  3. Clearing cached credentials: supabase unlink then re-linking
  4. 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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions