Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

stack: rest readiness probe (GET /) never passes when a db_pre_request hook rejects requests without an app header

Chiusa
#7,215 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@7ttp ci sta già lavorando.

Dal 17/10/2026.

  • #7216 di @7ttp — integrata

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
postgresql, typescript
Ambito
backend, devops

Direzione di ricerca

Find the experimental stack rest service recipe and its readiness probe; compare it with the Docker recipe’s PostgREST admin port configuration and the native runtime’s exposed ports. Check the readiness and service startup tests first. Done means the service becomes ready when PostgREST is serving even if db_pre_request rejects an anonymous GET /, and the eager and lazy startup cases pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

🐛 Bug supabase/cli
Affected area

Local development: experimental stack engine ([experimental] stack = true), rest service readiness.

Supabase CLI version

2.121.0 and 2.122.0-beta.1

Operating system

Linux x86_64 (glibc 2.44)

Installation method

npx

Command

supabase start --runtime native --eager (also reproduced with lazy start)

Actual output

With --eager, start fails:

ExperimentalStackStartError: Composition start had failures
rest (...): ... is not ready: rest HTTP readiness timed out
Recent stdout:
127.0.0.1 - anon [...] "GET / HTTP/1.1" 403 71 "" ""
127.0.0.1 - anon [...] "GET / HTTP/1.1" 403 71 "" ""

With the default lazy start, supabase start succeeds, but the first Data API request (which carries the header the hook requires) waits about 60 s and then returns 502 from the gateway, because rest never becomes ready. The same request sent directly to the PostgREST process returns 200.

Expected behavior

rest is reported ready once PostgREST is up and serving, independent of how the project's db_pre_request hook answers an anonymous GET /.

The rest recipe hardcodes healthPath: "/" on the data port. GET / runs the configured db_pre_request function, so any project whose hook rejects requests without an application header (for example a shared proxy-secret check) can never pass readiness. PostgREST has an admin server with GET /ready for this purpose; the Docker recipe already sets PGRST_ADMIN_SERVER_PORT. In the native runtime I only saw the data port listening. Probing /ready on the admin port, or treating any HTTP response from the data port as "up", would fix it.

Steps to reproduce
  1. SUPABASE_EXPERIMENTAL_STACK=1 supabase init
  2. Add supabase/migrations/20260101000000_pre_request_hook.sql:
create schema hooks;
create function hooks.check_request() returns void language plpgsql as $$
begin
  if current_setting('request.headers', true)::json->>'x-app-secret' is distinct from 'expected' then
    raise sqlstate 'PGRST' using
      message = json_build_object('code', 'APP_403', 'message', 'Unauthorized.')::text,
      detail = json_build_object('status', 403, 'headers', json_build_object())::text;
  end if;
end;
$$;
grant usage on schema hooks to anon, authenticated, service_role;
grant execute on function hooks.check_request() to anon, authenticated, service_role;
alter role authenticator set pgrst.db_pre_request = 'hooks.check_request';
notify pgrst, 'reload config';
create table public.notes (id int primary key);
grant select on public.notes to anon;
  1. supabase start --runtime native --eager fails with rest HTTP readiness timed out.
  2. Control: without that migration, the same command exits 0.
  3. Lazy variant: supabase start --runtime native, then curl -H 'x-app-secret: expected' -H "apikey: $PUBLISHABLE_KEY" "$API_URL/rest/v1/notes" returns 502 after about 60 s.
Crash report ID

N/A

Docker and service versions

Native runtime (PostgREST 16.4, Postgres 17). The Docker runtime uses the same recipe healthPath.

Additional context

The default (non-stack) engine works with the same hook, so this blocks adopting per-worktree stacks for projects that gate the Data API in a pre-request hook.

Lingua principale
TypeScript
Stelle
2.4k
Fork
537
Merge medio
19h 40m
PR unite (30g)
403

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di supabase/cli

Tutte le issue di supabase/cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.