Skip to content

github-backup(reconcile): a failed clone pass exits 0 and is absent from the dated report — clone_all's verdict is dropped by its only scheduled caller #3300

Closed

Description

@dezren39

Problem

In the weekly reconcile (infra/github-backup/bin/reconcile.py) — the sweep the module calls its correctness floor — a failed clone pass is invisible to every surface that could alarm on it: main() returns 0, and the dated reconcile report is written before the clone pass runs, so it never records the clone outcome at all.

clone_all.py computes a meaningful exit code (0 only when every planned repo cloned ok), and reconcile is its only scheduled caller — but reconcile drops that code on the floor. A week where every missing mirror fails to clone (bad token, disk full, network down) therefore looks exactly like a clean week to the systemd timer, and the only trace is a stdout line in the journal and the per-repo rows in clone-status.jsonl, which nothing alarms on.

Evidence (verified this run on main 7d8a3ca5)

  • reconcile.py:108-113 — the clone pass: r = subprocess.run([... clone_all.py]); on r.returncode != 0 it only print("clone pass had failures; see clone-status.jsonl"). The value is never stored or returned.
  • reconcile.py:115 — return 1 if errors else 0: the exit code reflects owner-level inventory errors only (docstring :13-14 states this as the design). Clone-pass failure is not an input.
  • reconcile.py:102-105 — the dated report reconcile-<today>.md is written before the clone pass (:108), so the report cannot and does not record whether the clones it triggered succeeded; its mirror count is explicitly "missing on disk before clone pass" (:88).
  • clone_all.py:106-107 — return 0 if ok == len(plan) else 1: the callee's verdict exists and is discarded by its caller.
  • manifest_mod.build(root) (:114) runs after the clone pass and will list the repos as missing in MANIFEST.json — but per github-backup(fetch): a missing mirror can never trip the chronic alarm — 'missing' returns before any fail_days record, so the daily run exits 0 forever #3270, nothing reads MANIFEST as an alarm; the exit code is this system's stated alarm channel.

Probe (laptop, verbatim copies, sha256-matched)

Probe: ~/git/fleet/probe-2026-10-31-laneA-reconcileexit/ (laptop) — reconcile.py sha256 762a7639… identical to sandbox main 7d8a3ca5; the copied tree's config pointed at a probe backup root with one planned repo missing on disk; inventory/build_plan stubbed, the clone_all.py subprocess stubbed to a chosen return code, everything else (report write, manifest build, exit return) the real code:

laptop reconcile.py sha256: 762a763977e823247f1576fcf2d58fb83a29ff39521f7d8d16ba44635e073e25 MATCH
CASE clone_rc=1 errors=False -> main() returned 0; report mentions failure: False
CASE clone_rc=0 errors=False -> main() returned 0; report mentions failure: False
CASE clone_rc=0 errors=True  -> main() returned 1; report mentions failure: False

The control proves the exit channel works — for inventory errors only. Clone success and clone failure are indistinguishable in both the exit code and the dated report.

Why it matters

Reconcile is the weekly guarantee that nothing is missed (#3215): it is the only path that creates mirrors for newly planned repos. If that creation fails, the daily fetch cannot fetch a mirror that does not exist — and per #3270 a missing mirror never trips the daily chronic alarm either — so a failed clone pass plus a missing mirror is a repo with no backup and no alarm on any cadence, discovered at disaster-recovery time. The fix is small: the verdict already exists in clone_all.py's exit code; reconcile just has to keep it.

Related, not duplicates: #3270 (daily fetch's chronic alarm cannot see a missing mirror; its body notes the clone-pass-fails scenario as background, but its acceptance is entirely in fetch_mirrors.py). #3282 (the mirror contract design) adopts #3238/#3233/#3250/#3219/#3270/#3257/#3240/#3229 in its phases — reconcile's exit code and report are not among them; this filing is the reconcile-side recorded outcome its rule 3 ("every attempt ends in a recorded outcome") currently lacks. #3240 (atomic state writes) covers torn writes, not dropped exit codes.

Acceptance criteria

  • When the clone pass exits non-zero, reconcile.py exits non-zero (in addition to the existing inventory-error path), so the weekly timer unit surfaces the failure.
  • The dated reconcile report records the clone-pass outcome (attempted count / ok / fail, or at minimum pass vs fail with the failing repos named or pointed to clone-status.jsonl) — the report is amended or written after the clone pass, not before it alone.
  • A run with no missing mirrors, or a fully successful clone pass, still exits 0 when inventory is clean; the inventory-error exit behaviour is unchanged.
  • Regression coverage (script-level test or probe harness): clone-pass rc=1 → reconcile rc=1 and report names the failure; clone-pass rc=0 → reconcile rc=0.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    effort/sSmall: expected under 2 hours of work
    app/github-backupinfra/github-backup estate mirror system
    on Nov 1, 2026
  2. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  3. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed (timestamp correction to the note above)

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 1, 2026
  5. 9 remaining items

  6. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Triage task 4909 completed: reproduced the dropped clone-pass result on refreshed main and queued scoped implementation task #5889. The issue is now triaged; no competing PR exists.

  7. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/triagedTriaged and routed (see agent note)
    on Nov 2, 2026
  8. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  9. added a commit that references this issue on Nov 2, 2026
  10. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

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

Metadata

Metadata

Assignees

Labels

app/github-backupinfra/github-backup estate mirror systemeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions