Fix: Supabase local logs "Backend error" (and old 502s)
The same local Studio Logs pipeline, broken three different ways since 2024: here is which one you are on, and the fix for each.
TL;DR#
Studio's Logs page is where a local Supabase project is meant to show you its own API Gateway,
Postgres and Auth traffic — docker logs on the relevant container still works directly when
it does not. At least three times now — May 2024, July 2025, and in October 2026 — a bug in
the local analytics pipeline behind Studio's Logs page has taken every tab down at once; your
error is most likely one of the three below. Right now (October 2026), the cause is Logflare
1.52.0 casting the @project query parameter to jsonb on the Postgres backend, so every logs
query fails. Update to Supabase CLI 2.122.0, which pins the fix, or — without upgrading — write
1.50.15 into supabase/.temp/logflare-version yourself.
Error fetching logs
Backend error! Retry your query. Please contact support if this continues.Or, on an older CLI/Logflare pairing, a 502 on the Logs page's own request (not your API), or
this line in the supabase_analytics container's own logs:
(Postgrex.Error) ERROR 42703 (undefined_column) column "body" does not existWhy API Gateway, Postgres and Auth logs break together#
supabase start enables analytics by default. Reproduced here on 25 October 2026: a fresh
supabase init on CLI 2.122.0 (confirmed with npx supabase@latest --version, which prints
2.122.0) writes [analytics] enabled = true with backend = "postgres" into config.toml
without you asking for it. That section starts Logflare, a BigQuery-style
log query engine, pointed at a postgres backend instead of real BigQuery. Every tab in
Studio's Logs page — API Gateway/Edge, Postgres, Auth, Functions — sends Logflare the same kind
of query, and Logflare translates it into SQL that runs against _analytics.log_events_*
tables inside your local Postgres container. That one translation layer is why
supabase/supabase#26785 was filed under
one title, "API Gateway and postgresql logging not working for local development", rather than
as two separate bugs: they are the same query engine hitting two different tables, so one bug
in that layer breaks both reports simultaneously, and now a third (Auth) as well.
May 2024 (supabase/supabase#26785): a
Studio update started querying a body column that the local _analytics.log_events_* tables
did not have, so every Logs tab failed: docker logs on the analytics container showed ERROR 42703 (undefined_column) column "body" does not exist, while Studio's own Logs page showed a
502 for that same request. The CLI team shipped an
immediate relief by reverting the Studio image pin
(supabase/cli#2332, merged 28 May 2024, "Studio
update broke postgres logs page"), then fixed the query itself
(supabase/supabase#27861, "fix logs query in
local", merged 9 July 2024). Maintainer encima confirmed it working end to end on
CLI 1.187.8
(comment) before
closing the issue on 29 July 2024.
July 2025 (supabase/cli#3894): a different
failure mode on CLI 2.31.8 — the _analytics schema and its log tables were never created at
all on a fresh supabase start, so the Logflare container (up and running, not crashed) logged
the same column "body" does not exist plus operator does not exist: jsonb ~~ unknown. No
maintainer diagnosis appears on that thread. One commenter, twhittock, says reverting to CLI
2.29.0 (and removing the db.network_restrictions block from config.toml) fixed it for them;
the reporter, whitfa99, closed the issue a month later saying it was "resolved… now using
2.34.3" — two different fixes, on a thread with no explanation of why either worked.
October 2026 (supabase/cli#7155, filed 14
October by a reporter on CLI 2.120.0): Logflare 1.52.0 changed how it casts query parameters —
@project now gets cast to jsonb when translated for the Postgres backend, so every logs
query fails with invalid input syntax for type json. Maintainer avallete root-caused it the
next morning and filed it upstream as
Logflare/logflare#4158, plus a second,
longer-standing bug where IFNULL() (BigQuery) is never translated to COALESCE() (Postgres),
tracked as Logflare/logflare#4159 — that
one breaks the per-minute logs chart on every Logflare version, not just this one.
Fix#
- Confirm this is what you are hitting. For the current (October 2026) bug, the
supabase_analytics_<project>container only logs a generic[error] Backend query error; the real errors are in the Postgres container — rundocker logs supabase_db_<project>and look forfunction ifnull(text, unknown) does not existorinvalid input syntax for type json. For the 2024/2025 shape instead, checkdocker logs supabase_analytics_<project>for thecolumn "body" does not existline quoted above. Either one confirms it is this family of bug, not a config mistake of your own. - Update the CLI.
npm install supabase@latest --save-devthennpx supabase --version, orbrew upgrade supabasethen plainsupabase --version(brew puts the binary on your PATH;npxwould not see it). Supabase CLI 2.122.0 lists the fix in its own release notes, published 23 October 2026: "Stack: local Studio logs work again — analytics is pinned to Logflare 1.50.15, so logs pages no longer show 'Backend error'." That line credits supabase/cli#7182, the PR that pinned it. The pin fixes the log rows for every tab; the per-minute chart stays broken until Logflare/logflare#4159 is fixed upstream, which is a Logflare limitation, not something your update can change. - Restart the stack so it pulls the newly pinned image:
supabase stopthensupabase start. Per the CLI reference, local data is backed up to a Docker volume on a plainsupabase stop— only--no-backupresets it — so this restart costs you no data; see fixing Postgres password authentication failures for the rest of the local-dev connection defaults. - Can't upgrade right now? Pin the version by hand, the same fix the CLI ships, without
waiting for the update (bash/zsh — Git Bash or WSL on Windows):
echo 1.50.15 > supabase/.temp/logflare-version && supabase stop && supabase start. This is the maintainer's own workaround, posted 15 October with the diagnosis, on the affected releases — the report that prompted it was on CLI 2.120.0. - If you are still on CLI 2.3x, with the analytics container up but its
_analyticstables never created (July 2025's symptom — different from the bug above, where the schema exists but the query itself fails), no one on that thread tried the version pin from step 4. The only reports: removing thedb.network_restrictionsblock fromconfig.tomland reverting to CLI 2.29.0 fixed it for one commenter; the reporter instead says it was gone by the time they reached 2.34.3. Step 2's upgrade takes you well past both.
Verify the fix#
Open Studio's Logs page for API Gateway, Postgres and Auth in turn. Rows should load with no
"Backend error" banner and no 502 from the underlying request. The per-minute activity chart at
the top of each page can still legitimately show an error — that is the still-open
IFNULL/COALESCE gap (Logflare/logflare#4159), not a sign your fix failed. To double-check
which Logflare build you are actually running:
docker ps --filter name=supabase_analytics --format "{{.Image}}" should print a tag
containing 1.50.15, the release supabase/cli#7182
pinned.
One email a month — the latest explained errors
What the site published that month — mostly Next.js, Supabase and Node errors, explained. You confirm by email; unsubscribe any time in one click.
The Oban loop on a database created before the fix#
If your local Postgres volume was first created while the CLI was still shipping Logflare
1.53.x (CLI 2.121.0) — before supabase/cli#7182
pinned it back — upgrading alone will not fully quiet things down. The restored 1.50.15 image
does not read the background-job (Oban) tables that 1.53.x created only inside the _analytics
schema, so the analytics container's alerting and event-touch workers restart in a loop and log:
relation "public.oban_jobs" does not existThe PR is explicit that ingestion and querying both keep working regardless, so this loop is
noise in docker logs, not a new outage — and it clears the moment you reset the local
database:
supabase stop --no-backup, then supabase start again. Per the same
CLI reference, that flag is what
resets your local data, so only reach for it on a project you can afford to reseed.
Once the Logs page itself is trustworthy again, a common next step in this same workflow is one
step further along: pushing a migration from this local project to the linked remote one. If
that push comes back with "must be owner of table", it is a different, unrelated error — see
the fix for Supabase's ownership error on db push
rather than reopening this one. If you go the other way and connect psql straight to the
exposed port 54322 to read the _analytics tables yourself while debugging, a wrong password
on that TCP connection gets you a third, unrelated error — a password, not a peer,
authentication failure, since peer auth only ever applies to a local socket. docker exec
into the container and run psql over that socket instead, as the wrong OS user, and you get
the peer failure for real: see
the fix for Postgres peer authentication failures.
The common thread across all three incidents is worth keeping in mind for next time: nothing here was ever actually about "API Gateway" or "Postgres" logging specifically breaking. Everything you see under Studio's Logs tab, in every service, is rendered by the same Logflare instance translating the same style of query into Postgres — so when one tab breaks, check the others before assuming you have found three bugs instead of one.
Frequently Asked Questions
Still stuck? Paste your error.
Paste the error message or stack trace — we check it against every fix and tool on the site.
Continue Reading
Supabase pgsodium_trg_mask_update: Fix Owner Error
Creating or editing a table in the Supabase dashboard throws a permission error that names a trigger you have never heard of. It is not a missing grant — it is Vault's pgsodium extension holding an event trigger your role does not own. Here is the workaround that keeps you working today and the fix that resets ownership for good.
Supabase db push: must be owner of table (SQLSTATE 42501)
Why a migration that runs fine locally is refused on the remote project, which owner fixes work from the postgres role today, and when only Supabase support can help.
Why Your Supabase Queries Are Slow (And How to Fix)
Slow Supabase queries kill your app feel and inflate your bill. Here are the six causes I keep seeing in production apps, and the exact SQL and code fixes for each one.


