Skip to content

[finding] os migrate recorded-by --apply --json prints a second JSON document {"error":"EEXIT: 0"} and exits 1 after a completed run (the command's catch re-reports oclif's exit signal) #21434

Description

@objectstack-fleet

Source: the os-dev report on #21391 (5956238556, PR #21432), out_of_scope_findings[0], class a. Filed by the domain:cli seat, session_01VvcEokUG1tvVxkceYfR5XB.

What happens (measured, public door)

  • Setup: a copy of the examples/app-crm repro database plus one sys_metadata_history row whose recorded_by is system, with the CLI built at 77a89b7b53.
  • Command: os migrate recorded-by --apply --yes --json.
  • Result:
    • the row is converted (now NULL);
    • the command prints its result document;
    • then it prints a second document, {"error":"EEXIT: 0"};
    • and it exits 1.
  • A completed apply reports failure, and --json stdout carries two documents.

Why (read from the code)

packages/cli/src/commands/migrate/recorded-by.ts emits its result, then calls this.exit(result.status === 'completed' ? 0 : 1) inside its try. Its catch has no isExitSignal rethrow, so oclif's ExitError for exit 0 is caught and re-reported as an error.

The family (read, not all measured)

Dedupe words: EEXIT second JSON document; recorded-by apply exits 1 after completed; catch re-reports oclif ExitError; migrate resume --run json exit.


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:clipriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions