Skip to content

boot: a fresh database logs "UNIQUE constraint failed: sys_migration.id" on first start #22102

Description

@objectstack-fleet

Filing gate ① — product defect with a named location and a reproduction. reach: a first objectstack dev on an empty SQLite file logged WARN Insert operation failed {"object":"sys_migration","error":{"message":"UNIQUE constraint failed: sys_migration.id …"}} during boot.

Who acts on it: objectstack triage (runtime / migrations owner). ⛔ Not a claim. Found in a manual browser QA pass of Studio on 2026-10-07; filed one card per finding on the maintainer's word: 「你发现的问题全部提交 issue」, and on the one-card-per-finding question 「覆盖规则,逐条立卡」.

What happens

The server starts normally, but an empty database should not hit a duplicate migration row; the warning suggests two writers record the same migration.

Reproduction

pnpm -C examples/app-showcase exec objectstack dev --ui --seed-admin -p <port> -d file:<new file> with OS_PORT=<port>; grep the log for sys_migration.

Suggested direction (triage to rule)

Find the second insert of the same migration id on first boot; make the record an upsert or give it one writer.

Environment

objectstack 879bd38c · examples/app-showcase booted with objectstack dev --ui --seed-admin on an isolated port and SQLite file · objectui 179f6fe9 (HEAD; the framework pin .objectui-sha is a58626c8) served by the console's Vite dev server, perf numbers from a vite build of the same commit · Chromium 141 at 1440×900 · signed in as the seeded platform admin admin@objectos.ai unless stated.

Duplicate check

Dedupe words: sys_migration unique constraint failed first boot · migration recorded twice

Filed by Claude Code (session session_01D76mrPJrSSdaKRxR2rvrMG) from that QA pass.


Generated by Claude Code

Activity

  1. objectstack-fleet commented on Oct 7, 2026

    @objectstack-fleet
    ContributorAuthor

    Path: the road — start: a fresh boot's diagnostics show only real faults | 缺项 | P3

    Triage: closed as a duplicate of #22099 (same row, same mechanism)

    Triage seat (objectstack-wide, seat post #6015) · session_01AavokzJ5DndAwitDXvKy4U · 2026-10-07T17:05Z. ⛔ Not a claim, ⛔ not a dispatch.

    Triage: lands in packages/plugins/plugin-auth/src/default-org-bootstrap-once.ts ⇒ domain:services, where #22099 is now routed; rationale: the same file and the same mechanism make a duplicate. #22099's dev measured this exact warning on a file-backed SQLite first boot, as well as on :memory: and PostgreSQL 16 (os-dev-report 6042611356 on #22099). The cause: plugin-auth's owner-bind gate re-enters itself and records adr-0093-default-org-owner-bind twice. This card's reproduction, a first objectstack dev on a new SQLite file, takes that path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions