Skip to content

fix(cli): exit analytics container when migrations fail - #6093

Merged
Coly010 merged 1 commit into
supabase:developfrom
7ttp:fix/logflare-migrate-guard
Aug 6, 2026
Merged

fix(cli): exit analytics container when migrations fail#6093
Coly010 merged 1 commit into
supabase:developfrom
7ttp:fix/logflare-migrate-guard

Conversation

@7ttp

@7ttp7ttp commented Aug 5, 2026

Copy link
Copy Markdown
Member

TL;DR

fixes the analytics crashloop where a failed Logflare.Release.migrate got silently swallowed and
Logflare booted against an unmigrated database killing
Oban on the missing public.oban_jobs, by chaining migrate && start in the generated entrypoint
so a failed migrate now exits the container and the unless-stopped restart policy
just retries until the db is ready

already broken stacks need one supabase stop && supabase start after upgrading cause the new entrypoint only applies on container recreate. diverges from go (ts only)....

before vs after
BEFORE (db refusing): migrate fails, app boots anyway, zombie with exit 0
AFTER (db refusing): app never boots, container exits and retries
AFTER (db appears): migrations apply (37 tables + oban), boots clean

ref:

@7ttp
7ttp requested a review from a team as a code ownerAugust 5, 2026 17:23
@7ttp7ttp self-assigned this Aug 5, 2026
@7ttp

7ttp commented Aug 5, 2026

Copy link
Copy Markdown
MemberAuthor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit:000ea3b9e6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Coly010
Coly010 added this pull request to the merge queueAug 6, 2026
Merged via the queue into supabase:develop with commit 82f6e05Aug 6, 2026
22 checks passed
avallete pushed a commit that referenced this pull request Aug 7, 2026
Verified every bullet against the actual v2.111.0..v2.112.0 tree diff
(the range came from a rebased develop rollup, so commit subjects alone
were misleading) and applied the Codex review feedback:
- Drop #6072 and #6080: packages/next-only, not in the stable shell
- Drop #6003 and #6057: the stable CLI does not exercise the stack
binary cache; #6057's "rollup" was the develop->main rollup PR,
not the Rollup bundler
- Add breaking-change section for NPM_AUTH_TOKEN no longer being
forwarded by functions deploy (#6005, ships in this tag)
- Note the one-time stop/start needed for already-stuck stacks (#6093)
- Scope #5956 to functions download path traversal
- Point db pull --experimental users at --declarative (#6028)
- Fix#6065 and #6066 descriptions to match the shipped changes
- Recount the internal tail (33 uncited commits in the compare range)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018h8krKpNet85649nqtj95b
ivasilov added a commit to supabase/supabase that referenced this pull request Aug 19, 2026
…tudio E2E `Start supabase` flake) (#49198)
<!-- ccr-slack-attribution -->
_Requested by **Ivan Vasilov** · [Slack
thread](https://supabase.slack.com/archives/C063LNYJJKS/p1787058646458219?thread_ts=1787058646.458219&cid=C063LNYJJKS)_
**Before:** the root `package.json` pins the Supabase CLI at `supabase:
^2.76.10`, and `pnpm-lock.yaml` resolves it to `2.76.14`.
**After:** it pins `supabase: ^2.114.0`.
This bumps the Supabase CLI that `pnpm run e2e:setup:cli` and `pnpm run
setup:cli` shell out to, so local dev and the E2E workflows boot the
local stack with a CLI from this month instead of one from ~38 minor
releases ago.
**How:** a one-line version change to the `supabase` devDependency in
the root `package.json`. Nothing else in the repo changes — no workflow,
config, or test changes.
### ⚠️ This PR is incomplete: `pnpm-lock.yaml` still needs regenerating
`pnpm-lock.yaml` is **not** updated in this PR, so `pnpm install
--frozen-lockfile` will fail until someone runs:
```bash
pnpm install --lockfile-only
```
and pushes the result to this branch. The lockfile could not be
regenerated in the environment this PR was authored in: pnpm re-resolves
`apps/studio`'s `"@std/path": "npm:@jsr/std__path@^1.0.8"` on every
install, and `npm.jsr.io` is not reachable from there
(`ERR_PNPM_FETCH_403`). Treat this PR as needing one extra commit before
it can go green.
### Why `^2.114.0` and not `^2.115.0`
`2.115.0` is the current `latest` on npm, but it was published only
hours ago, and `pnpm-workspace.yaml` sets `minimumReleaseAge: 4320` (3
days) with `supabase` not in `minimumReleaseAgeExclude`. Pinning
`2.115.0` today would fail the repo's own supply-chain check. `2.114.0`
(2026-08-12) is the newest release that satisfies that policy.
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.
YES
## What kind of change does this PR introduce?
Dependency bump. **Speculative** — this is an experiment, not a
confirmed fix.
## What is the current behavior?
The `Selfhosted Studio E2E Tests` workflow has been failing on `master`
at the `Start supabase` step. Recent runs:
- https://github.com/supabase/supabase/actions/runs/32092940311
- https://github.com/supabase/supabase/actions/runs/32131961447
In the Slack thread, Ivan Vasilov suggested trying a newer CLI and
Alaister Young endorsed giving it a go.
## What is the new behavior?
The workflow runs `supabase start` with CLI 2.114.0 instead of 2.76.14.
The question this PR is trying to answer is simply **"does a newer CLI
help this flake?"** It is not a diagnosis and not a claimed fix. If CI
still fails at `Start supabase` on this branch, the bump can be kept or
dropped on its own merits and the investigation continues elsewhere.
## Additional context
**Verification status:** none locally. The bump was not exercised
locally — this repo checkout has no `node_modules` (see the lockfile
note above), so `pnpm typecheck`, `pnpm lint`, and `pnpm test:studio`
were not run, and neither was `supabase start`. CI on this PR is the
only signal.
**Call-site compatibility check.** CLI 2.99/2.100 moved to a new
TypeScript shell with a stricter argument parser: command-specific flags
must now come *after* the subcommand. Both call sites in the root
`package.json` already use that order, so no script changes are needed:
```
supabase stop --all --no-backup --workdir ./e2e/studio
supabase start --exclude studio,mailpit --workdir ./e2e/studio
```
**Changelog entries between 2.76.14 and 2.114.0 that touch `supabase
start` or local config.** Listed so reviewers know what changed in the
range — **not** as a claim about what is failing in CI:
- **2.112.0** — `supabase start` no longer hangs when analytics
migrations fail; the analytics container exits and retries instead of
booting against an unmigrated database
([#6093](supabase/cli#6093)).
- **2.112.0** — `supabase start` reuses existing volumes instead of
failing when they already exist
([#6037](supabase/cli#6037)); Kong reloads after
`supabase db reset`
([#6017](supabase/cli#6017)); custom auth email
templates survive `db reset`
([#6065](supabase/cli#6065)); `supabase start`
works on SELinux-enforcing hosts
([#6000](supabase/cli#6000)).
- **2.106.0 — behavior change worth watching.**
`[api].auto_expose_new_tables` now resolves to `false` when unset, and
local start/reset revokes default Data API privileges for newly created
`public` tables, sequences, and functions
([#5524](supabase/cli#5524)). Neither
`supabase/config.toml` nor `e2e/studio/supabase/config.toml` sets this
key, so this default applies. If E2E specs create `public` objects and
then read them through the Data API, they may need explicit `GRANT`s
(the deprecated escape hatch is `auto_expose_new_tables = true`).
- **2.106.0** — when the CLI detects a coding-agent environment, or
`--agent yes` is passed, commands default to JSON output
([#5532](supabase/cli#5532)). `e2e:setup:cli`
already passes `--output json` to `supabase status` explicitly, so this
should be a no-op here.
- **2.100.0** — stricter flag ordering, covered above.
- **2.112.0** — `functions deploy` no longer forwards `NPM_AUTH_TOKEN`
into Docker bundling
([#6005](supabase/cli#6005)). Not used by these
workflows.
- **2.107.0** — pg-delta is the default schema diff engine for `db diff`
/ `db pull` on new projects
([#5511](supabase/cli#5511)).
- Many bundled Docker image bumps across the range (`supabase/postgres`
17.6.1.087 → later patches, `postgres-meta`, `vector` 0.28.1 → 0.53.0,
Studio image), plus `fix(analytics): wait for logflare before starting
vector` (2.84.3) and `fix: use correct docker.sock binding with vector`
(2.84.7).
Full comparison:
supabase/cli@v2.76.14...v2.114.0
---
_Generated by [Claude
Code](https://claude.ai/code/session_0143DrDMGnSSwuHebTPJv7ZY)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local: analytics container boots against an unmigrated DB — entrypoint ignores failed Logflare.Release.migrate and never waits for supabase_db

2 participants

@7ttp@Coly010