feat(boot): warn when agent catalog empty and fetcher unconfigured #60

Merged
nrupard merged 1 commit from feat/VS-39-diagnose-unconfigured-fetcher into main 2026-06-16 18:53:07 +02:00
Owner

What

boot_agent_binary_fetcher now emits a single actionable warn when the settings.agentbinaryfetcher section is absent AND the agent binary catalog is empty. Previously both config paths (build_seed, boot_agent_binary_fetcher) returned None silently, so a fresh deploy served /meshagents/:id 404s (device enrollment "Linux x86_64 agent" download failed: 404) with no signal beyond the generic "agent binary catalog empty" line.

Why

Diagnosed on staging 2026-06-16: enrollment download 404s because the Forgejo fetcher is never configured (no VERVAIN_AGENT_FETCHER_* env, no config.json, no UI overlay) so the catalog stays empty. Nothing told the operator the fetcher was unconfigured or how to fix it.

Behavior

  • Section absent + catalog empty -> one warn naming the symptom and both remediation paths (VERVAIN_AGENT_FETCHER_* env seed, admin Settings UI).
  • Section absent + catalog non-empty (agents served from disk) -> silent, unchanged.
  • Configured / malformed / invalid-key / bad-source paths -> unchanged (already logged).
  • Return value unchanged in all cases (None when no fetcher built); boot is not affected.

Test

cargo build -p meshcentral, cargo clippy -p meshcentral --all-targets -- -D warnings, cargo test -p meshcentral (58 passed) in the dev compose container. The new line is a guarded log side-effect; existing boot tests cover the malformed-section path and the unchanged None return.

Note

This is subtask VS-39 of VS-36. It improves diagnosis only; it does NOT fix the staging outage. That still requires configuring the fetcher (env or UI) and confirming the signed meshagent-<id> + .minisig are published to the Forgejo generic package (VA-57).

#VS-39

## What `boot_agent_binary_fetcher` now emits a single actionable `warn` when the `settings.agentbinaryfetcher` section is absent AND the agent binary catalog is empty. Previously both config paths (`build_seed`, `boot_agent_binary_fetcher`) returned `None` silently, so a fresh deploy served `/meshagents/:id` 404s (device enrollment "Linux x86_64 agent" download failed: 404) with no signal beyond the generic "agent binary catalog empty" line. ## Why Diagnosed on staging 2026-06-16: enrollment download 404s because the Forgejo fetcher is never configured (no `VERVAIN_AGENT_FETCHER_*` env, no `config.json`, no UI overlay) so the catalog stays empty. Nothing told the operator the fetcher was unconfigured or how to fix it. ## Behavior - Section absent + catalog empty -> one `warn` naming the symptom and both remediation paths (`VERVAIN_AGENT_FETCHER_*` env seed, admin Settings UI). - Section absent + catalog non-empty (agents served from disk) -> silent, unchanged. - Configured / malformed / invalid-key / bad-source paths -> unchanged (already logged). - Return value unchanged in all cases (`None` when no fetcher built); boot is not affected. ## Test `cargo build -p meshcentral`, `cargo clippy -p meshcentral --all-targets -- -D warnings`, `cargo test -p meshcentral` (58 passed) in the dev compose container. The new line is a guarded log side-effect; existing boot tests cover the malformed-section path and the unchanged `None` return. ## Note This is subtask VS-39 of VS-36. It improves diagnosis only; it does NOT fix the staging outage. That still requires configuring the fetcher (env or UI) and confirming the signed `meshagent-<id>` + `.minisig` are published to the Forgejo generic package (VA-57). #VS-39
feat(boot): warn when agent catalog empty and fetcher unconfigured
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 4m59s
Create release / Create release from merged PR (pull_request) Has been skipped
caf3151761
A fresh deploy with no on-disk agent binaries and no settings.agentbinaryfetcher section served /meshagents/:id 404s with no diagnostic: build_seed and boot_agent_binary_fetcher both returned None silently, so the operator's only signal was the generic "agent binary catalog empty" line. boot_agent_binary_fetcher now emits one actionable warn naming the symptom (agent downloads will 404) and both remediation paths (VERVAIN_AGENT_FETCHER_* env or the admin Settings UI), gated on handle.is_empty() so on-disk-catalog deployments stay quiet.

#VS-39

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nrupard deleted branch feat/VS-39-diagnose-unconfigured-fetcher 2026-06-16 18:53:07 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-server!60
No description provided.