Skip to content

supabase link returns "Authorization failed for the access token and project ref pair: Not Found" #6091

Description

@trungdtewh

Affected area

Auth

Supabase CLI version

2.111.0

Operating system

macOS Sequoia (Apple Silicon)

Installation method

brew

Command

supabase link \
--project-ref fhaqojwfmtbmjpihzifz \
--profile resms \
--skip-pooler \
--debug

Actual output

Loading profile from flag: resms
Using access token for profile: supabase
Supabase CLI 2.111.0
Using profile: supabase (supabase.co)
GET https://api.supabase.com/v1/projects/fhaqojwfmtbmjpihzifz
GET https://api.supabase.com/v1/projects/fhaqojwfmtbmjpihzifz/api-keys
Authorization failed for the access token and project ref pair:
{"message":"Not Found"}

Expected behavior

supabase link should succeed because the same Personal Access Token can list the project successfully with:

supabase projects list --profile resms

The CLI should retrieve the project details and link the local directory.

Steps to reproduce

  1. Install Supabase CLI via Homebrew.
  2. Login with:
    supabase login --profile resms
  3. Verify the project exists:
    supabase projects list --profile resms --debug
  4. Run:
    supabase link
    --project-ref fhaqojwfmtbmjpihzifz
    --profile resms
    --skip-pooler
    --debug
  5. Observe:
    Authorization failed for the access token and project ref pair:
    {"message":"Not Found"}
Image

Crash report ID

No response

Docker and service versions

Docker Desktop 4.85.0
Supabase CLI 2.111.0
macOS Sequoia (Apple Silicon)
Project:
- quan-ly-ban-hang-bds-dev
- Project ref: fhaqojwfmtbmjpihzifz
The same access token can successfully execute:
supabase projects list --profile resms
but
supabase link
fails with:
Authorization failed for the access token and project ref pair:
{"message":"Not Found"}

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions