Skip to content

The sys_oauth_resource bootstrap row is re-inserted on every boot and its UNIQUE refusal is now logged at ERROR — an idempotent step reporting as a failure #17176

Description

@zhuangjianguo

Found while upgrading objectstack-ai/hotclm from @objectstack/* 17.3.0 to 17.4.0 (hotclm#35 / hotclm PR #37). Filed at the destination per that repo's AGENTS.md rule for platform gaps — report, never patch. Not triaged: no domain:*, no priority, no assignee.

Symptom

On a clean single-tenant SQLite dev database, every boot after the first logs, at ERROR level:

ERROR Insert operation failed {"object":"sys_oauth_resource",
  "error":{"message":"UNIQUE constraint failed: sys_oauth_resource.identifier ...

raised from createWithAutonumberResync. It is a platform bootstrap row being re-inserted into a database that already holds it — the second boot repeats the first boot's work, the unique index correctly refuses, and the refusal surfaces as an error.

Nothing breaks. The row is already present, which is the desired end state; no application data is touched.

What changed in 17.4.0

17.3.0 logged nothing here. This looks like a downstream effect of 65846bc ("a batch ROW reports a unique-constraint refusal as UNIQUE_VIOLATION — the same wire spelling as the whole-request failure on the same route", #14723), which surfaces unique-constraint refusals that were previously swallowed. That change is right; what it exposed is that a bootstrap step was relying on the refusal being silent.

⇒ The bug is arguably not the logging but the unconditional re-insert. A bootstrap step that runs on every boot should be an upsert, or should check first — not an insert that depends on its own failure being invisible.

Version boundary

  • 17.3.0 — silent.
  • 17.4.0 — ERROR on every boot after the first.

Same application, same worktree, same clean .objectstack/data, both boots read at seeder quiescence.

Reproduce

git clone https://github.com/objectstack-ai/hotclm && cd hotclm
pnpm install          # resolves @objectstack/* 17.4.0
rm -rf .objectstack/data
pnpm demo             # boot 1 — inserts the row
pnpm demo             # boot 2 — the ERROR line appears here

Expected

The bootstrap makes sys_oauth_resource idempotent explicitly — upsert, or existence check before insert — so a second boot is quiet. Failing that, the expected refusal is recognised at the call site and logged below error severity, so an ERROR in the boot log continues to mean something went wrong.

Why it matters beyond noise

Consumer repos are told to treat the boot log as a gate (objectstack-ai/hotclm's AGENTS.md: "A boot that logs warnings is not a passing boot"). Two independent ERROR lines now appear on a healthy 17.4 boot; each one that an author learns to scroll past lowers the odds they notice a real one.

Related

Sibling finding from the same boot, different root cause, filed separately: the _objectstack_sequences column-existence probe logged at ERROR. Historical, all closed, none the same defect: #5495, #12313, #12394, #8269.

Activity

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions