Skip to content

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

Closed

Description

@dezren39

Problem

In the daily fetch (infra/github-backup/bin/fetch_mirrors.py), a planned mirror that is missing on disk can never trip the chronic-failure alarm: every daily run reports it, writes a fetch.log line, and exits 0 — forever. A repo whose git fetch fails exits 1 on its third failure day; a repo with no mirror at all is structurally invisible to that mechanism, even though it is the worse state (there is no backup to be stale).

Evidence (verified this run on main e08fceb4)

  • fetch_mirrors.py:22-23 — fetch_repo returns "missing" when valid_mirror(path) is false, before the state.setdefault(repo, {}) at line 28 and before any fail_days recording (lines 34-37, failure path only).
  • fetch_mirrors.py:72-75 — the run's only non-zero exit path is chronic = [repos with len(fail_days) >= 3]; a missing repo never accumulates fail_days, so chronic can never contain it. The docstring (lines 5-7) states the exit code exists "so systemd shows the failure" — the oneshot github-backup-fetch.service has no other failure signal.
  • The weekly reconcile does re-clone missing mirrors, but if the mirror disappears again (or the clone pass fails), the daily fetch — the only daily signal — stays green indefinitely; MANIFEST.json says missing but nothing reads it as an alarm.

Probe (laptop, verbatim copies, sha256-matched)

Probe: ~/git/fleet/probe-2026-10-31-laneA-fetchmissing/ (laptop) — fetch_mirrors.py / ghb_common.py / manifest.py sha256-identical to sandbox main e08fceb4; fake HOME with a two-repo plan.json:

RUN 1 (missing repo + control repo whose remote is a nonexistent local path, seeded with 2 prior fail_days):
{"results": {"ok": 0, "fail": 1, "skip": 0, "missing": 1}, "chronic_failures": ["owner/failing-one"]}  exit=1
MANIFEST: {'owner/failing-one': 'mirrored', 'owner/missing-one': 'missing'}
RUNS 2-4 (missing repo alone, three more daily passes):
{"results": {"ok": 0, "fail": 0, "skip": 0, "missing": 1}, "chronic_failures": []}  exit=0   (x3)
state.json after all runs: no entry for owner/missing-one at all — fail_days is never created for it.

The control proves the chronic mechanism works for fetch failures; the missing path bypasses it entirely.

Why it matters

The mirror set is the disaster-recovery source for the whole estate (see infra/github-backup/README.md). A mirror deleted, corrupted past valid_mirror, or never cloned after a plan change is exactly the loss the daily fetch exists to surface — and it is the one outcome its alarm cannot express. The failure is silent in the only channel systemd watches (the exit code).

Acceptance criteria

Dedup

Checked open + recently closed github-backup issues this run: #3215 (umbrella), #3219 (drain ack on failed/missing fetch), #3229 (null owner), #3233 (partial clone), #3238 (bare-skeleton valid_mirror), #3240 (non-atomic state writes), #3250 (fetch timeout), #3257 (fail_days consecutiveness). None covers the daily pass's missing-mirror exit code.

Activity

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

    🤖 Design-architect pass 29 (2026-10-31) — agent note: this issue is ADOPTED as a phase of design #3282 ("a mirror is what it can prove — one validity, outcome and alarm contract for the github-backup estate mirror", design doc: files/designs/code-github-backup-mirror-contract.md in the keep-the-four-repos-healthy goal workspace), linked as a sub-issue of #3282 and labelled source/design-architect. Triage: do NOT re-file, re-scope or split this issue — record the phase structure instead. Phase mapping: Phase 1 (validity & destinations) = #3238 + #3233; Phase 2 (recorded outcomes & the alarm) = #3250 + #3219 + #3270 + #3257; Phase 3 (durable state & plan retention) = #3240 + #3229 + closing audit #3283 (gated on Phases 1–2). The design records the pins that span the phases: validity = bare + HEAD resolves, with no emptiness exception inside the plan (build_plan excludes zero-commit repos); destinations are absent / valid / skeleton (remove + clone) / debris (quarantine to .partial-<timestamp> + clone); every fetch attempt ends in one recorded outcome shared by the daily loop and the drainer, and the drainer acks only on ok; the chronic alarm is a streak of 3 consecutive unavailable days (fail, timeout and missing all count); generated state is written atomically only through ghb_common helpers; reconcile retains a failed owner's previously planned entries. Where an origin's acceptance left a choice open (the streak-vs-window rule, missing-counts-vs-immediate, report-vs-retain, skeleton handling), the design doc records the decision — triage follows the design's pin, not the open alternative. Each origin keeps its own acceptance criteria and its already-queued triage packet — no new packet was created for it this pass.

  4. 58 remaining items

  5. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor
    • Session / ID: task 6813 (repo-fleet-monitor run 2026-11-05T15:39:47Z)
    • Found via: monitor reconciliation (Duty 1 claim/label divergence repair)
    • Task: Claim evaporated: task 6813 is queued and unclaimed in repo-health-code-pilot, but this issue still carried claimed labels. Labels reset to the truth (queue/queued + status/needs-triage). Checkpoint stage at evaporation: handed_off.
    • Expectation: The next lane claim picks task 6813 up from the queued state and posts a fresh pickup note.
  6. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 8, 2026
  7. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  8. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

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

    @dezren39
    MemberAuthor

    agent-note:v1 task 6813 lane code-u: handed off to opencode claimant (execution lane row 1632, checkpoint handed_off).

  11. dezren39 commented on Nov 9, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done (already_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 jobsource/design-architectFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions