cli
cli copied to clipboard
CLI on Windows (v2.26.9) ignores self-hosted env vars, always defaults to cloud login, but server is healthy
Describe the bug
The Supabase CLI (v2.26.9 on Windows) consistently ignores environment variables (SUPABASE_PROJECT_URL, etc.) for a self-hosted instance and attempts to authenticate with the Supabase Cloud, resulting in an "Access token not provided" error or a hanging command.
However, the self-hosted server is proven to be healthy and responsive, as direct API calls using PowerShell's Invoke-RestMethod work perfectly.
To Reproduce
- Set up a self-hosted Supabase instance on Coolify with a custom domain.
- Install Supabase CLI v2.26.9 on Windows using Scoop.
- In PowerShell, run the following command to deploy a function:
$env:SUPABASE_PROJECT_URL="https://my-coolify-url.com"; $env:SUPABASE_ANON_KEY="..."; $env:SUPABASE_SERVICE_ROLE_KEY="..."; supabase functions deploy my-func --no-verify-jwt - The command hangs with a blinking cursor or eventually fails with "Access token not provided".
- Running the same command with
--debugshows the CLI is attempting to connect tohttps://api.supabase.com, completely ignoring the providedSUPABASE_PROJECT_URL.
Expected behavior
The CLI should use the provided environment variables to connect to the self-hosted URL.
Additional context
-
This is not a server or network issue. Running
Invoke-RestMethod -Method Get -Uri "https://my-coolify-url.com/rest/v1/"with the correctapikeyheader works perfectly and returns the full Swagger/OpenAPI definition. This proves the server is online, healthy, and accessible. -
This is not a corrupt installation. The issue persists after a full uninstall (including deleting the
.supabaseuser folder) and reinstalling via Scoop. -
This is not a login issue. Running
supabase logoutbefore the command does not solve the problem.
The evidence strongly suggests the CLI is not correctly prioritizing environment variables over a (non-existent or cleared) cloud login state on Windows.