Skip to content

Support bundle: add state snapshots and non-journal sources, each time-bounded so a wedged service cannot block it #4128

Closed

Description

@pithead-developer

What's the problem

The owner wants "pretty much every log on the system". Even with the whole journal from #4127, the bundle has no state snapshots and no non-journal sources. It is part of tracker #4032. Today it holds only host facts, rauc status, a config shape and two dashboard tables (lib/pithead/07-support-bundle.sh:249-320).

  • No doctor --json, and no monerod, Tari or P2Pool status (height, peers, sync flag). doctor_json runs only on the DIY path (07:169).
  • Tor is a grep of journal text (07:268). There is no guard list, no circuit state and no control-port snapshot.
  • No network state, time-sync state, podman ps -a with exit codes and image digests, rauc status --detailed or boot-slot state, coredump records, or Caddy access logs (failed logins).
  • Nothing from /data/pithead/support/ (the files the owner saved at the console) and nothing about /data/pithead state markers.
  • The SQLite step keeps only the newest 5000 rows per table (07:309), reads only history and events, skips silently when python3 or the DB is missing (07:294), and omits ping_failures (dashboard/mining_dashboard/service/storage_schema.py:254) and the control audit events.
  • No step is time-bounded. A wedged Tor, monerod or P2Pool could stall the collector (C15 of Let appliance owners download a redacted support bundle of past logs from the dashboard, and log why health pings fail #4032).

What it impacts

How I found it

This came from a read-only audit of develop at eb929ce on 2026-11-15, against the owner's request and the acceptance criteria of #4032, verified by a second agent. The owner said on 2026-11-15: "make sure 2.0.4 has the export logs feature also. i want to be able to select a time frame and then dump pretty much every log on the system into a zip file for download. this is so we can debug issues users face".

Evidence is the file:line list above, plus the audit finding that no code collects /data/pithead/support/ at all (C12). Not verified: whether coredumpctl and systemd-coredump are installed in the appliance image (the audit found systemd-coredump is not installed, so cores go to the kernel default). Also not verified: which Tor control-port auth method the host collector can use without reading the cookie into the bundle.

How important is it

Release blocker for v2.0.4 (owner, 2026-11-12). The 2026-11-12 acceptance criteria of #4032 name doctor --json, the status snapshots, Tor state, and "keeps working while Tor, monerod or P2Pool are down". Part of #4032.

Acceptance criteria

  • The zip contains doctor.json (from doctor --json), and a status snapshot each for monerod, Tari and P2Pool with height, peer count and sync flag. When a service cannot answer, the file says so and the manifest records the reason.
  • A Tor file holds bootstrap phase, entry guards and circuit state from the control port, and the guard section of the Tor state file. Every key and onion secret is excluded. A seeded fake key in the Tor state file never reaches the zip.
  • Network files: networkctl status, ip addr, ip route, resolvectl status, and the nft ruleset with addresses redacted. Time files: timedatectl status and the sync unit status.
  • podman ps -a output includes exit codes and image digests. rauc status --detailed and the boot-slot state are included. coredumpctl list metadata (no core files) is included, or the manifest says systemd-coredump is not installed.
  • Caddy access logs are included for the window only, including rotated generations, with auth headers, cookies and tokens in URLs removed. A seeded cookie and token never reach the zip.
  • Every file under /data/pithead/support/ is included and redacted. A bounded listing of /data/pithead state markers (names, sizes, times, small marker contents) is included.
  • The SQLite export has no 5000-row cap and covers the window for every history table, ping_failures and the control audit events. A missing DB or python3 is a manifest entry, not silence.
  • Every collector step runs under a hard time limit (a stated number of seconds per step and a stated total). A step that times out or fails is recorded in manifest.json with its name, reason and elapsed time, and the bundle is still produced.
  • A tier-1 test stubs each of Tor, monerod, P2Pool and Tari first to hang and then to refuse connections. The bundle completes within the total limit, and the manifest lists those steps as timed out or failed.
  • Redaction runs on every new text file. The seeded-secret test is extended to cover them.
  • make check passes.

Possible solutions

  • Run each step through timeout -k with a per-step limit and a small helper that appends to the manifest.
  • Query Tor with a short authenticated control-port call, or read only the guard lines of the state file with an allowlist so keys cannot leak.
  • For monerod and P2Pool, call the local status endpoints the dashboard already uses, with short connect and read timeouts. Not verified: whether doctor --json itself can block on a wedged service. If it can, run it under the same time limit or add per-probe timeouts to doctor.
  • Read SQLite read-only with a busy timeout so a locked DB cannot hang the step.

Activity

  1. added this to the v2.0.4 milestone on Nov 15, 2026
  2. added
    enhancement
    appliance
    release-blocker
    P1-user-facing
    on Nov 15, 2026
  3. pithead-developer commented on Nov 15, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #4127. I made no code changes for #4128. The issue says to start after #4127 merges, and #4127 is still open with no PR on develop (checked 2026-11-15). Both issues rewrite lib/pithead/07-support-bundle.sh, the zip writer and manifest.json. Building the per-step time limits, the manifest entries and the new collectors on the old collector would conflict with #4127's rewrite. This session read the issue and checked the dependency state only. No branch, PR or bench job exists. To unblock: #4127 merges to develop, the runner resumes this session, and work starts from the new develop. The questions to raise then are which Tor control-port auth the host collector can use without reading the cookie into the bundle, and whether doctor --json can hang on a wedged service. By default I would run doctor --json under the same per-step timeout and give it per-probe timeouts only if it can block.

    The runner resumes this issue when that one closes.

  4. added
    blocked
    on Nov 15, 2026
  5. pithead-developer commented on Nov 16, 2026

    @pithead-developer
    ContributorAuthor

    Owner ruling 2026-11-16 (2.0.4 scope review, "all as recommended"): conditional. The core stays in 2.0.4: per-step time limits with manifest entries, doctor.json, node status snapshots, and Tor control-port state (answer the control-port auth question first). If log export is the last thing holding the cut, the tail moves to v2.0.5: network and time state, coredump, Caddy access logs, and the support-dir listing.

  6. removed
    blocked
    on Nov 16, 2026
  7. pithead-developer commented on Nov 17, 2026

    @pithead-developer
    ContributorAuthor

    Merged in #4173.

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

    P1-user-facingapplianceenhancementrelease-blocker

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions