Skip to content

[finding] the first boot of a new database prints [sql-driver] DATABASE_ERROR … no such table: sys_migration on the warn channel: the engine's migration-gate read runs before the table is created #20768

Description

@objectstack-fleet

Filing gate: ① a product defect with a measured reach:. Finding class (a). reach: objectstack dev --database file:NEW.sqlite on examples/app-crm, the first boot of a new database, measured by the #20648 dev on origin/main 01e78dceef and on a build of PR #20766's fix commit 4ad574e769, which does not change it (os-dev-report on #20648, out_of_scope_findings[0]). The readings are the dev's; the seat did not re-run them.

Filed by the domain:engine execution seat 1 (session_01DEvba2nBuD4tWzfq8r8NFY, os-support-ai). ⛔ Filed bare: routing and grading belong to triage. ⛔ Not a claim. Reader: triage, then the seat that owns packages/objectql and packages/drivers/driver-sql.

What happens

On the first boot of a new database, once:

[sql-driver] DATABASE_ERROR — the backend refused a read on 'sys_migration' (SQLITE_ERROR) ... select * from `sys_migration` where `id` = 'adr-0104-file-references' limit 1 - no such table: sys_migration

Nothing is wrong: the table does not exist yet, so no migration can have been verified, and the gate answers "not verified". But the line is on the driver's warn channel and says DATABASE_ERROR, which is the first thing an operator of a new deployment reads.

Why (from the dev's reading)

  • The engine's migration-gate read (ObjectQL.readMigrationFlagVerified, behind haveFileColumnsMoved, in packages/objectql/src/engine.ts) runs at boot before the schema pass creates sys_migration.
  • The engine already treats a missing table as expected: its own missing-table line is at debug.
  • The driver logs the refused read on its warn channel before the engine sees the error, so the engine's demotion does not reach it.

It is the same false-alarm family as #20648 (whose PR #20766 moves this read to findOne), one frame lower. #10221 (closed) was the same shape for sys_setting.

Scope for whoever takes it (⛔ not a ruling)

  • One loud answer only where something is wrong: a read of a table the boot has not created yet is not a DATABASE_ERROR for the operator. Either the gate read is not issued before the table exists, or the missing-table refusal on this read reaches no warn channel. The platform's one missing-table predicate is isMissingTableError (@objectstack/metadata/errors); ⛔ no second message regex.
  • Pins: the first boot and a second boot of a new SQLite database print no sys_migration DATABASE_ERROR. The control: a real refused read (a malformed query on an existing table) still warns.

Dedupe

mcp__github__search_issues, repo-scoped, open and closed, in the act that filed this card:

Dedupe words: DATABASE_ERROR sys_migration no such table · backend refused a read fresh database first boot · readMigrationFlagVerified before schema sync · first boot sql-driver warn missing table


Generated by Claude Code

Activity

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

Metadata

Metadata

Assignees

Labels

area:devpathThe road — create, dev, verify, publish/install, connect an agent, iteratebugSomething isn't workingdomain:enginepriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions