Skip to content

fix(miner): bin/loopover-miner.js exits 1 on a secret-mount failure, outside the documented 0/2 exit-code contract #6162

Description

@JSONbored

Context

packages/loopover-miner/bin/loopover-miner.js:40-45's loadMinerFileSecrets() catch block calls process.exit(1) on failure. But packages/loopover-miner/docs/unattended-scheduling.md:15-18's documented exit-code contract only covers 0 (success) and 2 (failure — "Alert on this"). An operator wiring alerting strictly to exit code 2, per the doc's own phrasing, misses this real, reachable failure path — a broken GITHUB_TOKEN_FILE or similar secret-mount misconfiguration. The underlying throw comes from lib/env-file-indirection.js's loadMinerFileSecrets.

Requirements

  • Change bin/loopover-miner.js:40-45's catch block to exit with code 2 (matching the documented contract) instead of 1, so this failure path is captured by an operator's existing exit-code-2 alerting.
  • Double-check no other startup failure path in this same file uses exit code 1 for a similarly-reachable failure — if so, fix those too as part of the same pass (same root cause, same fix).
  • Do not change lib/env-file-indirection.js's loadMinerFileSecrets itself — the throw behavior is correct, only the exit-code translation at the CLI boundary is wrong.

Test Coverage Requirements

99%+ Codecov patch coverage on the changed exit-code path; add/update a CLI test asserting exit code 2 (not 1) on a simulated secret-mount failure.

Deliverables

  • Secret-mount failure now exits with code 2.
  • Any other similarly-miscoded startup failure paths in the same file fixed too.
  • Test asserting the corrected exit code.

Expected Outcome

An operator's exit-code-2 alerting catches a broken secret mount, matching the documented 0/2 exit-code contract.

Links & Resources

  • packages/loopover-miner/bin/loopover-miner.js:40-45
  • packages/loopover-miner/docs/unattended-scheduling.md:15-18
  • packages/loopover-miner/lib/env-file-indirection.js (loadMinerFileSecrets)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions