device-add: the 608 MB VM-guest download is silent under 'fetching this community's pinned agent…', and a re-run downloads it all again #2003

Closed
opened 2026-09-30 01:12:22 +00:00 by ben · 2 comments
Owner

Symptom

After the one-liner prints idss: fetching this community's pinned agent from <apex>… the terminal is silent for the whole guest-bundle download. On bens-mac-04 joining Whakatōhea Demo by hand (2026-09-30 00:37Z → 00:51Z) that was 14 minutes of nothing at ~400 KB/s for the 608 MB vm-guest.tar.gz, under a line that says the agent (11 MB, done in a second) is being fetched. The owner cannot tell a healthy download from a hung one.

A second run of the same command downloads the whole bundle again: GuestPayload.StageGuest (internal/install/guestpayload.go:70) clears any residue and re-fetches unconditionally — there is no short-circuit on a slot that already carries the served bundle (the point #1753's addendum recorded; the gateway side now serves the X-IDSS-Release header and a Last-Modified, so the device has something to compare).

Cause

InstallAgent (internal/join/cli.go:96-105) stages the guest bundle inside the install command's first act, before the menu, and the stager logs only to slog — the terminal gets no line. Nothing prints progress, size or rate.

Fix

  • The install command prints one line before the stage names what it is fetching and how big it is (idss: fetching the VM guest image (608 MB) from <apex>…), and progress at a sane cadence (every 10 % or 30 s — a single overwritten line is fine on a tty, a dated line otherwise). A resumed attempt says so.
  • The stage short-circuits when the staged slot is already the served bundle: compare the served Last-Modified/X-IDSS-Release (or a HEAD's Content-Length + a recorded sha of what was unpacked) against a marker written beside the slot at unpack time. A match skips the fetch and says so in one line.
  • Seam tests for both: the progress writer over a scripted transfer, and the short-circuit over a matching marker.

The same run also failed at VM create on the cold install (filed alongside). Sibling of #1753 (compressed + resumable, closed).

Siblings

Found in the one hand run (bens-mac-04 → Whakatōhea Demo, 2026-09-30): #2002 #2004 #2005 #2006 #2007

## Symptom After the one-liner prints `idss: fetching this community's pinned agent from <apex>…` the terminal is silent for the whole guest-bundle download. On `bens-mac-04` joining Whakatōhea Demo by hand (2026-09-30 00:37Z → 00:51Z) that was **14 minutes** of nothing at ~400 KB/s for the 608 MB `vm-guest.tar.gz`, under a line that says the agent (11 MB, done in a second) is being fetched. The owner cannot tell a healthy download from a hung one. A second run of the same command downloads the whole bundle again: `GuestPayload.StageGuest` (`internal/install/guestpayload.go:70`) clears any residue and re-fetches unconditionally — there is no short-circuit on a slot that already carries the served bundle (the point #1753's addendum recorded; the gateway side now serves the `X-IDSS-Release` header and a `Last-Modified`, so the device has something to compare). ## Cause `InstallAgent` (`internal/join/cli.go:96-105`) stages the guest bundle inside the install command's first act, before the menu, and the stager logs only to slog — the terminal gets no line. Nothing prints progress, size or rate. ## Fix - The install command prints one line before the stage names what it is fetching and how big it is (`idss: fetching the VM guest image (608 MB) from <apex>…`), and progress at a sane cadence (every 10 % or 30 s — a single overwritten line is fine on a tty, a dated line otherwise). A resumed attempt says so. - The stage short-circuits when the staged slot is already the served bundle: compare the served `Last-Modified`/`X-IDSS-Release` (or a HEAD's `Content-Length` + a recorded sha of what was unpacked) against a marker written beside the slot at unpack time. A match skips the fetch and says so in one line. - Seam tests for both: the progress writer over a scripted transfer, and the short-circuit over a matching marker. ## Related The same run also failed at VM create on the cold install (filed alongside). Sibling of #1753 (compressed + resumable, closed). ## Siblings Found in the one hand run (bens-mac-04 → Whakatōhea Demo, 2026-09-30): #2002 #2004 #2005 #2006 #2007

swarm-claim host=elitebook-distributed-server-03 run=36153
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=36153 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #2003 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 2003,
  "status": "success",
  "commits": [
    "402b68a74237baf81d66f12f98ff93679e78e445"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/install/guestpayload.go",
    "internal/install/guestpayload_test.go",
    "internal/join/cli.go",
    "internal/join/install_guest_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/install/ ./internal/join/ ./internal/enrollwire/ ./internal/vm/",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/install/ ./internal/join/",
      "exit_code": 0
    },
    {
      "command": "go build -tags dev ./...",
      "exit_code": 0
    },
    {
      "command": "git push (pre-push go-ci gate: go test ./... + linters)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The install command prints one line before the stage naming what it fetches and how big (idss: fetching the VM guest image (608 MB) from <apex>...)": "progressReporter.announce() in internal/install/guestpayload.go prints the naming line with humanBytes(total) from the served Content-Length before the body streams; asserted by TestGuestPayload_NarratesProgress (checks 'fetching the VM guest image (200 B) from totara.example')",
    "Progress at a sane cadence (every 10% or 30s; overwritten line on a tty, dated line otherwise)": "progressReporter.maybeEmit/render in guestpayload.go emits at pct>=lastPct+10 || >=30s, \\r-overwritten on a tty (isTerminalWriter) and timestamped otherwise; asserted by TestGuestPayload_NarratesProgress (>=5 progress lines + closing 100%)",
    "A resumed attempt says so": "progressReporter.resuming(off) prints 'idss: link dropped — resuming the VM guest image from <n>...' on a 206 Range retry in download()",
    "The stage short-circuits when the staged slot is already the served bundle (compare Last-Modified/X-IDSS-Release/Content-Length against a marker written at unpack time)": "StageGuest HEADs the bundle (headServed), compares servedID.matches against readServedMarker(g.markerPath()) written by writeServedMarker at unpack time, and skips the fetch on a match; asserted by TestGuestPayload_ShortCircuitsMatchingSlot (HEADed, never GOT, one skip line)",
    "A match skips the fetch and says so in one line": "the skip branch prints 'idss: the VM guest image is already the current one (608 MB) — skipping the download'; asserted by TestGuestPayload_ShortCircuitsMatchingSlot",
    "Seam tests for both (progress writer over a scripted transfer; short-circuit over a matching marker)": "TestGuestPayload_NarratesProgress and TestGuestPayload_ShortCircuitsMatchingSlot in internal/install/guestpayload_test.go"
  },
  "summary": "The VM-guest download narrates itself on the operator's terminal and a re-run that already holds the served bundle skips the fetch via a HEAD/marker short-circuit.",
  "unproven_by_seam": "The seam fakes the HTTP transport and the tar/mv runner, so the progress cadence and the short-circuit are proven over scripted bytes, not a real 608 MB gateway pull; a live drive leg on a real cold join still owes the end-to-end proof, and the cross-run partial-tmpTar resume is out of scope (only a fully-staged slot short-circuits).",
  "blockers": []
}
**close-report** for #2003 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 2003, "status": "success", "commits": [ "402b68a74237baf81d66f12f98ff93679e78e445" ], "changed_files": [ "STATUS.md", "internal/install/guestpayload.go", "internal/install/guestpayload_test.go", "internal/join/cli.go", "internal/join/install_guest_test.go" ], "tests": [ { "command": "go test ./internal/install/ ./internal/join/ ./internal/enrollwire/ ./internal/vm/", "exit_code": 0 }, { "command": "go vet ./internal/install/ ./internal/join/", "exit_code": 0 }, { "command": "go build -tags dev ./...", "exit_code": 0 }, { "command": "git push (pre-push go-ci gate: go test ./... + linters)", "exit_code": 0 } ], "criteria": { "The install command prints one line before the stage naming what it fetches and how big (idss: fetching the VM guest image (608 MB) from <apex>...)": "progressReporter.announce() in internal/install/guestpayload.go prints the naming line with humanBytes(total) from the served Content-Length before the body streams; asserted by TestGuestPayload_NarratesProgress (checks 'fetching the VM guest image (200 B) from totara.example')", "Progress at a sane cadence (every 10% or 30s; overwritten line on a tty, dated line otherwise)": "progressReporter.maybeEmit/render in guestpayload.go emits at pct>=lastPct+10 || >=30s, \\r-overwritten on a tty (isTerminalWriter) and timestamped otherwise; asserted by TestGuestPayload_NarratesProgress (>=5 progress lines + closing 100%)", "A resumed attempt says so": "progressReporter.resuming(off) prints 'idss: link dropped — resuming the VM guest image from <n>...' on a 206 Range retry in download()", "The stage short-circuits when the staged slot is already the served bundle (compare Last-Modified/X-IDSS-Release/Content-Length against a marker written at unpack time)": "StageGuest HEADs the bundle (headServed), compares servedID.matches against readServedMarker(g.markerPath()) written by writeServedMarker at unpack time, and skips the fetch on a match; asserted by TestGuestPayload_ShortCircuitsMatchingSlot (HEADed, never GOT, one skip line)", "A match skips the fetch and says so in one line": "the skip branch prints 'idss: the VM guest image is already the current one (608 MB) — skipping the download'; asserted by TestGuestPayload_ShortCircuitsMatchingSlot", "Seam tests for both (progress writer over a scripted transfer; short-circuit over a matching marker)": "TestGuestPayload_NarratesProgress and TestGuestPayload_ShortCircuitsMatchingSlot in internal/install/guestpayload_test.go" }, "summary": "The VM-guest download narrates itself on the operator's terminal and a re-run that already holds the served bundle skips the fetch via a HEAD/marker short-circuit.", "unproven_by_seam": "The seam fakes the HTTP transport and the tar/mv runner, so the progress cadence and the short-circuit are proven over scripted bytes, not a real 608 MB gateway pull; a live drive leg on a real cold join still owes the end-to-end proof, and the cross-run partial-tmpTar resume is out of scope (only a fully-staged slot short-circuits).", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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
Matou/idss#2003
No description provided.