Repository navigation
Description
What's the problem
The host collector bundle_support_collect (lib/pithead/07-support-bundle.sh:237-336) does not deliver what the owner asked for. It is part of tracker #4032.
- The output is a
.tar.gz(07:244,07:330;46b-control-support-bundle.sh:23), not a.zip. - The window is "N hours back from now", clamped to 1-168 h (
07:216,07:219-235). It has no end time:journalctlgets only--since(07:265). - Only 15 hand-kept units are collected (
PITHEAD_SUPPORT_UNITS,07:217). The list missestari-wallet,wallet-rpc,pithead-lan-guard,pithead-lan-hold,pithead-firstboot,pithead-egress(service and timer),pithead-sync,pithead-journal-persistand more. Nothing else on the system journal is collected: no kernel log, no network, time, podman or systemd lines, no--list-boots. - Each unit is silently cut to its newest 2 MiB (
tail -c,07:239,07:266). A busymonerodorp2poolloses most of a long window and the bundle does not say so. - A bundle over 64 MiB is refused outright (
07:322-328). The owner gets "could not collect" (46b:17-20) and no way to narrow the window. - The bundle does not say how far back the journal reaches. journald is capped at
SystemMaxUse=200M(os/rootfs/Dockerfile:176), about 102 h at test load, below the 168 h the UI offers. - An empty unit file cannot be told apart from "nothing happened", "journal too short" or "unit missing".
What it impacts
- Owners cannot export a past incident window or the evidence around it.
- Maintainers get a partial, silently clipped record. The 2026-11-11 outage (Prod Tor client wedged for 15 h: Monero node peerless and tor auto-heal never escalated past a rejected NEWNYM #4045, Stop serving stratum work while the node is stale so rigs fail over to their backup pool #4046) is the case this must cover.
- Support bundle: add state snapshots and non-journal sources, each time-bounded so a wedged service cannot block it #4128, Dashboard: time-frame picker and one-click .zip export, always available, with docs and a browser test #4129, DIY parity: the same windowed .zip from the dashboard and from
./pithead support-bundle --since/--until#4130 and End-to-end proof on the appliance: download the support-bundle zip through the dashboard, with Tor wedged and with monerod stopped #4131 build on this collector and its zip and manifest. pithead recovery-bundleshares this function (07:338-360), so it changes too.
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. A second agent verified it. 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. Not verified: whether quadlet containers write their stdout to journald, so whether journalctl -u <unit> already holds container output. The developer must check this first on a provisioned guest and record the answer in the PR.
How important is it
Release blocker for v2.0.4 (owner, 2026-11-12 and 2026-11-15). Every other issue in this set depends on it. Part of #4032.
Acceptance criteria
-
bundle_support_collectwrites one.zip(mode 600) namedsupport-bundle-<UTC timestamp>.zip. The control verb stores it as<id>.zip, and the download route (dashboard/mining_dashboard/web/views/download_views.py:52) and the retention code serve it under that name. No.tar.gzis produced by the appliance support-bundle paths. The archive opens with the stockunzipand a desktop zip tool. - The collector and the control request take an explicit start and end time (UTC, RFC 3339), passed to
journalctl --sinceand--until../pithead recovery-bundleaccepts--sinceand--until. With neither, the window is the last 72 h. The oldhoursvalue is still accepted. - A start after the end, an unparsable time, or an end in the future is rejected with a clear message and nothing is collected. A start older than the oldest retained entry is clamped to it, and the manifest records the requested and the effective window.
- The zip holds the whole system journal for the window (all units, redacted) in one file, plus
journalctl -kfor the window andjournalctl --list-boots. - A per-unit file exists for every
pithead*service and timer and every quadlet-generated unit installed on the box. The list is derived at collect time from the installed unit files and quadlet output, not from a hand-kept string. A guest test installs a new dummy unit and sees it collected without a code change. - Silent
tail -ctruncation is gone. A documented size policy keeps the bundle useful: each file keeps both the oldest and newest lines of its window, within a stated per-file cap and a stated total cap, and a marker line inside the file says what was dropped. The 64 MiB all-or-nothing refusal is replaced by degrading under that policy. -
manifest.jsonlists every file with its window, byte size, whether it was truncated (and how many bytes or lines were dropped), and every step that failed or timed out with the reason. It also records the oldest retained journal entry, the journald disk usage and effective settings, the requested and effective window, the pithead version and the collection time. - A unit with no lines in the window, a journal shorter than the window and a missing unit are each recorded in the manifest as distinct states.
- The journald cap in
os/rootfs/Dockerfileis raised so retention covers the longest window the UI will offer at measured log volume. If the cap is not raised, the dashboard limits the picker to the retained range (Dashboard: time-frame picker and one-click .zip export, always available, with docs and a browser test #4129) and the manifest says so. The PR states which, and shows the measured figure. - Existing redaction (
bundle_redact_logand friends) runs on every new file. The seeded-secret tests intests/stack/control/test-control-support-bundle.shandtests/integration/selftest/selftest-support-bundle.share extended so a seeded secret in the whole-journal, kernel and per-unit files never reaches the zip. - The tier-1 shell tests use a journalctl stub that honours
--sinceand--until, so window content is asserted, not only argv. They unzip the result and check the manifest fields above. -
make checkpasses.
Possible solutions
- Build the zip with
python3 -Iandzipfile, which the collector already uses for the SQLite step (07:294-319). The stockzipbinary is not known to be on the appliance. This is not verified. - Derive the unit list with
systemctl list-unit-files 'pithead*'plus the quadlet output directory used bylib/pithead/36-quadlet-units.sh, or by reading the installed unit directory and generator output. - Size policy options: keep a head and a tail slice per file; or drop oldest first with a marker. Pick one and document it in
docs/operations.md. - Raise
SystemMaxUsein proportion to/datafree space, if the image can read it at boot, or choose a fixed larger cap. Measure first.
Activity
./pithead support-bundle --since/--until#4130Support bundle: bound the total-cap shrink, keep files that fit whole…
Trim the support-bundle test under the file budget (#4127)
Support bundle: restore the deleted rows, add a control-verb leg and …
Support bundle: include the whole end second so the newest journal li…
Support bundle collector: one .zip of the whole journal for a chosen …
pithead-developer commentedon Nov 16, 2026
Merged in #4134.
Tor diagnostics snapshot: circuits, consensus, guards, bootstrap and …