Skip to content

Schema auto-repair is skipped when CLI telemetry is off #1768

Closed

Description

@sentry-junior

When telemetry is off, the CLI's SQLite database skips per-query schema auto-repair and readonly-write handling. That covers SENTRY_CLI_NO_TELEMETRY=1 and every sentry __complete run, since runCompletion() sets it. Raised by Warden on #1762 and confirmed to predate that PR.

  • getDatabase() in packages/cli/src/lib/db/index.ts wraps the raw connection with createTracedDatabase() from src/lib/telemetry.ts only when telemetry is on. Otherwise it returns the raw Database.
  • createTracedDatabase() and createTracedStatement() are the only callers of tryRepairAndRetry() (schema errors) and isReadonlyError() handling (src/lib/db/schema.ts). Without the proxy, a query that hits a missing table or column throws instead of repairing and retrying.
  • initSchema() and runMigrations() still run on open. Only the retry-on-query step is lost.
  • In shell completion, handleComplete() swallows the error, so a stale schema shows up as silently empty completions (for example, getCachedOrganizations() reading credential_identity).
  • This has been the behavior on main since the completion fast path started setting SENTRY_CLI_NO_TELEMETRY. perf(cli): Give __complete its own light entry point #1762 keeps it unchanged.

via @BYK.

--

View Session in Sentry

Activity

  1. added
    bugSomething isn't working
    CLISentry CLI and CLI documentation
    on Oct 31, 2026
  2. linear-code commented on Oct 31, 2026

    @linear-code
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

    CLISentry CLI and CLI documentationbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions