Reproduction
supabase start -x postgrest
supabase status -o json
Expected
API_URL, REST_URL, and GRAPHQL_URL are still present in the JSON output. The user excluded only the PostgREST container; Kong is still running and ${API_URL}/auth/v1/* and ${API_URL}/storage/v1/* are still reachable.
Actual (v2.101.0)
All three keys are absent from the JSON output:
{
"DB_URL": "postgresql://...",
"PUBLISHABLE_KEY": "sb_publishable_...",
"SERVICE_ROLE_KEY": "..."
}
Root cause
In apps/cli-go/internal/status/status.go, toValues computes:
apiEnabled := utils.Config.Api.Enabled &&
!slices.Contains(exclude, utils.RestId) &&
!slices.Contains(exclude, utils.ShortContainerImageName(utils.Config.Api.Image))
Config.Api.Image is the PostgREST image, so the short name resolves to "postgrest". When postgrest is in exclude, apiEnabled flips false and the whole API_URL / REST_URL / GRAPHQL_URL block is omitted.
But the three URLs aren't all served by PostgREST — they're served by Kong (Config.Api.KongImage). PostgREST is only the upstream for ${API_URL}/rest/v1/* specifically; /auth/v1/* (GoTrue) and /storage/v1/* (Storage) are routed through Kong regardless of whether PostgREST is up. So excluding postgrest should suppress at most REST_URL and GRAPHQL_URL, never API_URL.
Suggested fix
Split the gating so API_URL is governed by Kong's presence, not PostgREST's. Rough sketch:
kongRunning := utils.Config.Api.Enabled &&
!slices.Contains(exclude, utils.KongId) &&
!slices.Contains(exclude, utils.ShortContainerImageName(utils.Config.Api.KongImage))
postgrestRunning := kongRunning &&
!slices.Contains(exclude, utils.RestId) &&
!slices.Contains(exclude, utils.ShortContainerImageName(utils.Config.Api.Image))
if kongRunning {
values[c.ApiURL] = utils.Config.Api.ExternalUrl
if postgrestRunning {
values[c.RestURL] = utils.GetApiUrl("/rest/v1")
values[c.GraphqlURL] = utils.GetApiUrl("/graphql/v1")
}
}
Impact
supabase status -o json is the documented way to discover the local stack from outside the CLI (env-export pipelines, test harnesses, CI). A user excluding PostgREST for unrelated reasons silently loses the entire API surface from that output, with no warning. We hit this in CI when the supabase/setup-cli action was on version: latest and picked up 2.101.0 — same exclude list that was green on 2.100, but every integration test then failed at setup because API_URL was missing.
Workaround
Drop postgrest from -x and pay the extra container cost (~10 s, ~50 MB).
Version
- CLI: v2.101.0
- Repro: GitHub Actions Ubuntu runner; also reproduces on macOS with the same CLI version.
Reproduction
Expected
API_URL,REST_URL, andGRAPHQL_URLare still present in the JSON output. The user excluded only the PostgREST container; Kong is still running and${API_URL}/auth/v1/*and${API_URL}/storage/v1/*are still reachable.Actual (v2.101.0)
All three keys are absent from the JSON output:
{ "DB_URL": "postgresql://...", "PUBLISHABLE_KEY": "sb_publishable_...", "SERVICE_ROLE_KEY": "..." }Root cause
In
apps/cli-go/internal/status/status.go,toValuescomputes:Config.Api.Imageis the PostgREST image, so the short name resolves to"postgrest". Whenpostgrestis inexclude,apiEnabledflips false and the wholeAPI_URL/REST_URL/GRAPHQL_URLblock is omitted.But the three URLs aren't all served by PostgREST — they're served by Kong (
Config.Api.KongImage). PostgREST is only the upstream for${API_URL}/rest/v1/*specifically;/auth/v1/*(GoTrue) and/storage/v1/*(Storage) are routed through Kong regardless of whether PostgREST is up. So excludingpostgrestshould suppress at mostREST_URLandGRAPHQL_URL, neverAPI_URL.Suggested fix
Split the gating so
API_URLis governed by Kong's presence, not PostgREST's. Rough sketch:Impact
supabase status -o jsonis the documented way to discover the local stack from outside the CLI (env-export pipelines, test harnesses, CI). A user excluding PostgREST for unrelated reasons silently loses the entire API surface from that output, with no warning. We hit this in CI when thesupabase/setup-cliaction was onversion: latestand picked up 2.101.0 — same exclude list that was green on 2.100, but every integration test then failed at setup becauseAPI_URLwas missing.Workaround
Drop
postgrestfrom-xand pay the extra container cost (~10 s, ~50 MB).Version