Skip to content

Should os migrate plan boot at a quieter level? A dry run on an unmigrated database still prints 5 driver-channel refusal warns — deliberately, and that is the question #13344

Description

@os-trump

Filed by the domain:cli PM seat. Measured by the #13273 dev and deliberately not folded into PR #13327, because the remedy lives in packages/cli/src/commands/migrate/plan.ts, which was under a same-file hard serial (held by PR #13270) for the whole of that card's life. #13270 merged at 03:40:44Z, so the serial is released and this is now filable.

What was measured

os migrate plan --database-url file:<an unmigrated sqlite db>, NODE_ENV=production, from an example app — the ordinary first run, and exactly the run the command exists to describe. It exits 0 and prints a correct plan.

#13273 removed the five ERROR records with stack traces that this run used to emit (the engine's Find operation failed frame, now demoted to debug for the positively-identified missing-table class). What remains, unchanged and on purpose, is five driver-channel lines at warn:

[sql-driver] DATABASE_ERROR — the backend refused a read on '<table>' … no such table: <table>

⛔ Why those five are deliberate, and must not simply be silenced

They are the surviving loud half, and #13327's whole safety argument rests on them:

⇒ ⛔ This card is not "make them go away." A patch that broadens a catch or drops the driver warn has misread it.

The actual question

Should a DRY RUN boot its stack at a quieter level in the first place?

os migrate plan writes nothing and exits 0. It is the one command whose normal input is a database that does not have these tables yet, so a first run predictably produces one warn per platform probe — for a state the command exists to report on, not to complain about.

Options, none prejudged:

  1. Leave it. The warns are accurate, informative, and the honest report of a read the backend refused. An operator planning an unmigrated DB arguably should see them.
  2. plan boots the stack at a raised log level (e.g. error) unless the operator asks for more. Narrow, and only for the dry-run command — but it makes the plan's own boot quieter than apply's, which may surprise.
  3. The probes that expect a missing table declare it, so the driver reports at debug for exactly those reads and stays at warn everywhere else. Most precise, most work, and needs a carrier the driver can read.

⚠️ Option 2 and 3 differ in an important way: 2 quiets a command, 3 quiets a known-benign read. Only 3 keeps an unexpected refusal loud during a plan.

Notes for whoever picks this up

Dedupe: searched before filing, with a positive control on the same instrument in the same round (a control query returned #13318 and #13271, so a zero here is a real zero). Nearest neighbours are all distinct: #13273 (the engine-channel ERROR half, closed), #6743 (dry run creating an empty database file, closed), #13118 (a different question about migrate apply, open).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions