Device-add one-liner cannot answer its own consent prompt under sudo's pty (sudo-rs on Ubuntu 26.04 / use_pty on 24.04): /dev/tty is sudo's inner pty fed by the dead curl pipe, the install is parked by SIGTTIN #2038
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#2038
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom (Whakatōhea Demo, device add, 2026-10-03)
Ben ran the published device-add one-liner on a stock Ubuntu 26.04.1 box (
whakatohea, 100.98.84.207):The agent installed, the standing
idss-agent.servicecame up, the P2-S3 menu (How should this machine contribute?,[1] Full install …,>) was drawn — and then nothing. Typing1+ Enter produced noChoose 1–2., no consent text, noType WIPE to consent. Re-running the one-liner reproduced it exactly. No error, no exit: a silent prompt, for over an hour.Evidence
/proc/26043/status:State: T (stopped),ShdPnd: 0000000000100000(bit 20 = SIGTTIN), wchando_signal_stop./proc/26043/fd/0 -> /dev/tty, which resolves to pts/0 — sudo's inner pty, not the user's pts/1./proc/26034/fd/0 -> pipe:[89641]— the inner pty's input source is the exhausted curl pipe.sudo -V→sudo-rs 0.2.13-0ubuntu1.2. Ubuntu 26.04 ships sudo-rs assudo; it always runs the command in its own pty./var/lib/idss/resume.jsonabsent,idss-agent.servicejournal silent since start: the request never paired. The code survives.Cause
GOTCHAS #113 (#938) fixed the
curl … | shEOF trap by reattaching/dev/ttyin the served script (internal/controlapi/installscript.go) and belt-and-braces in the binary (agent/cmd/agent/consent_input.go). Both assume/dev/ttyis the person's terminal. Undersudowith a pty (sudo-rs always; sudo 1.9.14+ withuse_pty, the Debian/Ubuntu default since 24.04),/dev/ttyis sudo's inner pty, whose input sudo feeds from its own stdin — the curl pipe. The user's keystrokes land on the outer pty and are never relayed. The consent prompt reads a terminal nobody can type into; the kernel job-control stop (SIGTTIN) makes it worse: the process is not even blocked inread(), it is stopped, sokill -TERMdoes nothing until a-CONT.Every surface that prints the one-liner prints the
sudoform:dashboard/src/lib/deviceAdd.ts:358(the CodeScreen),installscript.go:32/36(the script's own usage lines),docs/ux/wireframes/p2-device-add-cli/p2-s2-code-and-install-command.html. #2002 added the root refusal that makessudomandatory. So on any current Ubuntu the published doorway cannot answer its own consent prompt — the exact failure class #938 was meant to close, one layer further out.Fix (proposed — two-way door, ADR 0174)
Make the served script immune to the wrapper it is run under, rather than teaching every surface a new incantation:
Change the printed one-liner's shape so the script never rides stdin and sudo's stdin stays the real terminal. Inside sudo's pty there is no path back to the user's terminal, so no in-script
/dev/ttytrick can fix this; the fix is one layer out, in the command people copy. Recommended form (one line, no temp file, copy-pasteable):The shell evaluates
$(curl …)BEFORE sudo runs, sudo's fd 0 is the terminal, its pty relays keystrokes, and/dev/ttyinside is answerable. (curl … | sudo sh -s -- <CODE> < /dev/ttydoes NOT work: the script arrives on the pipe.curl -o f && sudo sh f <CODE>works but is two commands.)Update every printing surface to the new form:
deviceAdd.ts(installCommand),installscript.gousage/no-code lines, the agent'sconsentInputerror hint, the p2-s2 wireframe, ADR 0054's example,enroll_rent.go:273if the rented box path prints it too.consentInput(the binary's belt-and-braces): when/dev/ttyopens but is not the foreground, or when the first read is interrupted by SIGTTIN, fail loud naming the fix (run it as: sudo sh -c "$(curl -sSf https://<origin>/get)" sh <CODE>) instead of letting the kernel park the process. CatchSIGTTINviasignal.Notifyso the stop becomes a typed error, never a silentT.Seam test: render the script, run it with
dashunder a fakesudothat wraps the command in a fresh pty whose input is a closed pipe (the sudo-rs shape), assert the consent prompt is answered from the outer pty within the timeout. The existing #938 test covers the pipe-only case and stays green on this bug — that is why it was not caught.Acceptance
use_pty), the one-liner the control panel's CodeScreen prints reachesType WIPE to consent, acceptsWIPE, and prints✓ connection request sent.curl … | sudo sh -s --form prints one honest line naming the new form and exits non-zero within seconds — never a stopped process.go test ./internal/controlapi/... ./agent/... ./internal/join/...green; the dashboarddeviceAddunit test asserts the new command shape.Related
GOTCHAS #113 (#938), #2002 (root refusal), ADR 0054, ADR 0024,
internal/controlapi/installscript.go,agent/cmd/agent/consent_input.go,dashboard/src/lib/deviceAdd.ts.swarm-claim host=matou-dev-server-01 run=38170
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #2038 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
netbird upis a no-op on a device already on another mesh and records the foreign address as the mesh fact; a member Files placement writes a kanidm-only files-idp.nix onto the gateway and nothing detaches it — gatew… #2040