From c033a26979de282be882a6a9ed263d175d91b17b Mon Sep 17 00:00:00 2001 From: claude-hdb Date: Tue, 14 Jul 2026 15:34:08 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20a=20watched=20mint=20must=20move=20?= =?UTF-8?q?=E2=80=94=20unbuffer=20the=20dots,=20name=20the=20log=20after?= =?UTF-8?q?=20the=20box?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Operator watched /tmp/new.log through a claude mint and saw not one message: cloud-init's progress dots are block-buffered the moment stdout is not a tty, so a redirected mint shows nothing for the whole install and then one burst — which reads exactly like a hang, on the very night three real hangs happened. PYTHONUNBUFFERED=1 on the cloud-init wait makes the dots arrive as dots; box new also prints how to watch the box's own full narration (incus exec -- tail -f /var/log/cloud-init-output.log); and the drill's logs are named for the box being minted (/tmp/mint-drill.log), not for the verb that mints it. --- bin/box | 7 ++++++- drill/drill.sh | 16 ++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/bin/box b/bin/box index 67218c0..5ce6ce7 100755 --- a/bin/box +++ b/bin/box @@ -599,6 +599,7 @@ cmd_new() { "${extra[@]}" wait_agent "$instance" echo "box: waiting for phase-1 (cloud-init)..." + echo "box: (its full narration, live: incus exec $name -- tail -f /var/log/cloud-init-output.log)" # A failed cloud-init used to print a screen of dots and the word "error", # with nothing to act on — the box's own log holds the reason, and nobody # was told it existed. Show it, and leave the box up to inspect. @@ -607,7 +608,11 @@ cmd_new() { # drill), the session can wedge open after the remote command has exited, # blocking forever on a websocket that will never close. Caught live: a # mint stuck at 'status: done'. Only shell/exec/tmux may own the terminal. - if ! incus exec "$instance" -- cloud-init status --wait &2 echo "box: cloud-init FAILED in $name. What it says:" >&2 incus exec "$instance" -- cloud-init status --long &1 | sed 's/^/ /' >&2 diff --git a/drill/drill.sh b/drill/drill.sh index 34071e9..7a8c13e 100755 --- a/drill/drill.sh +++ b/drill/drill.sh @@ -401,7 +401,7 @@ rm -rf "$badt" printf '\n minting a blank box (the DEFAULT template — no tooling, fast)…\n' t0=$SECONDS -if mint_box /tmp/tpl.log --name tpl; then +if mint_box /tmp/mint-tpl.log --name tpl; then ok "box new --name tpl, no --template ($((SECONDS - t0))s)" tt="$(incus config get tpl user.box.template 2>/dev/null)" [ "$tt" = blank ] && ok "the default template is blank (user.box.template=blank)" \ @@ -424,15 +424,15 @@ if mint_box /tmp/tpl.log --name tpl; then || no "blank box cannot resolve — DNS parity broken" box rm tpl --force >/dev/null 2>&1 && ok "blank box removed" || no "could not remove the blank box" else - no "blank mint FAILED — tail: $(tail -3 /tmp/tpl.log | tr '\n' ' ')" + no "blank mint FAILED — tail: $(tail -3 /tmp/mint-tpl.log | tr '\n' ' ')" fi printf '\n minting a claude box (cold, ~10 min)…\n' t0=$SECONDS -if mint_box /tmp/new.log --name drill --template claude; then +if mint_box /tmp/mint-drill.log --name drill --template claude; then ok "box new --name drill --template claude ($((SECONDS - t0))s)" else - no "box new FAILED — tail: $(tail -3 /tmp/new.log | tr '\n' ' ')" + no "box new FAILED — tail: $(tail -3 /tmp/mint-drill.log | tr '\n' ' ')" echo; echo "── cannot continue without a box"; printf ' %s\n' "${findings[@]}"; exit 1 fi @@ -486,11 +486,11 @@ box info archive | grep -q authed && ok "the snapshot followed the rename" || no # --- clone from a snapshot of a renamed box -------------------------------- printf '\n cloning from the snapshot…\n' -if mint_box /tmp/clone.log --name clone --from archive/authed; then +if mint_box /tmp/mint-clone.log --name clone --from archive/authed; then ok "new --from archive/authed (clone of a snapshot of a renamed box)" box exec clone -- true >/dev/null 2>&1 && ok "the clone is alive and enterable" || no "the clone is not enterable" else - no "clone FAILED — tail: $(tail -3 /tmp/clone.log | tr '\n' ' ')" + no "clone FAILED — tail: $(tail -3 /tmp/mint-clone.log | tr '\n' ' ')" fi # --- the escape hatch ------------------------------------------------------ @@ -517,10 +517,10 @@ wait_box archive && ok "archive is back up (agent answering)" \ # Sibling isolation needs a sibling. Clone from the snapshot — fast, no cold mint. printf '\n cloning a peer for the sibling probes…\n' -if mint_box /tmp/peer.log --name peer --from archive/authed && wait_box peer; then +if mint_box /tmp/mint-peer.log --name peer --from archive/authed && wait_box peer; then ok "peer minted from archive/authed and answering" else - no "peer clone failed or never answered — tail: $(tail -3 /tmp/peer.log | tr '\n' ' ')" + no "peer clone failed or never answered — tail: $(tail -3 /tmp/mint-peer.log | tr '\n' ' ')" fi # C1 — public egress (#15 A1; resolving the hostname also proves A5, gateway DNS)