You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
buildLaunchCommand missing -y flag — spawn silently fails to launch when stdin is a pipe #18
SpawnTaskHandler.buildLaunchCommand() does not include -y (auto-approve cost estimate). Without -y, spawn 0.36.9 reads from stdin expecting a JSON cost-approval response. When called from a Java ProcessBuilder (no TTY, stdin is a pipe), spawn returns exit 0 with a "failed to parse JSON" error message — which nf-spawn's exitCode != 0 check misses, so it silently sets status = RUNNING without the instance ever launching.
buildLaunchCommand() also doesn't pass --ami. Without it, spawn auto-detects via SSM (ssm:GetParameter on /aws/service/ami-amazon-linux-latest/...), which requires the spored-instance-role to have that permission (tracked in spawn#38). To avoid that dependency, nf-spawn should pass ext.ami if provided:
String ami = (ext.ami ?:'') asStringif (ami) cmd.addAll(['--ami', ami])
I reproduced this against the actual code before acting, because the primary diagnosis doesn't hold on spawn 0.36.9 (the version cited). Results are mixed — one half doesn't reproduce, the other is real:
The -y / "silent exit-0 failure" half does NOT reproduce on 0.36.9
I ran nf-spawn's exact command (no -y, --instance-type t4g.nano, stdin piped/closed) against a real spawn 0.36.9 binary:
launch nf-test --instance-type t4g.nano --region us-east-1 --ttl 5m \
--on-complete terminate --wait-for-running=false --wait-for-ssh=false # no -y, stdin closed
→ EXIT=0, and the instance DID launch (i-8966…; `list` shows 1 instance)
No "failed to parse JSON", no silent no-op. Why: #34 (shipped in 0.36.9, PR #36) routes launch to one of three modes via launchMode(interactive, instanceType, stdinIsTTY):
The "parse stdin as truffle JSON" path (modePipe, the source of failed to parse input: failed to parse JSON) requires instanceType == "". nf-spawn always passes --instance-type, so it's modeFlags — stdin is never read.
The only stdin reads left in launch are two fmt.Scanln cost/locality prompts, both guarded by if !autoYes (launch.go:1380, 3148), and one of those only fires on a cross-region data-locality mismatch. On closed stdin Scanln returns an error harmlessly and proceeds — it doesn't abort with a JSON error.
So the repro in the issue looks like it was captured against a pre-0.36.9 / pre-#34 spawn, where --instance-type + piped stdin still hit the truffle-parse path. On 0.36.9 it's already fixed.
That said — adding -y is still correct and worth doing. It's harmless in modeFlags, and it future-proofs against the cost-approval prompt ever becoming reachable (e.g. the cross-region locality path, or a behavior change). Cheap insurance; no objection. Just want the issue's stated mechanism on record as not the actual 0.36.9 behavior, so we don't believe we fixed a silent-failure bug that wasn't there.
One correction to the issue body regardless of version: spawn does not "return exit 0 with a failed-to-parse error" — in the genuine pipe path it returns the error with a nonzero exit (return i18n.Te("error.input_parse_failed", err)). If a real run truly saw exit 0 + that message, that's a separate spawn bug and I'd want the spawn version (spawn version) + the literal stderr to chase it.
The --ami half is REAL ✅
Confirmed: without --ami, spawn auto-detects via ssm:GetParameter on /aws/service/ami-amazon-linux-latest/... (pkg/aws/ami.go:22-27,59), which needs the instance/caller role to have that SSM permission — exactly spawn#38 (open). Passing ext.ami when provided is a good way to sidestep that dependency. 👍
Suggested resolution
Both flag changes are reasonable to land in nf-spawn:
Add -y to buildLaunchCommand() — defensive, not a 0.36.9 bugfix.
Add optional --ami from ext.ami — real, avoids the spawn#38 SSM-permission dependency.
Want me to take both (with a guard test asserting -y is present and --ami is passed iff ext.ami is set)? If you can also share spawn version from the failing run, I'll confirm whether the silent-failure was a genuinely older binary or something still live.
Thank you — the version confusion makes sense. The head node AMI was baked with spawn 0.36.6 (installed via spawn_0.36.6_linux_arm64.rpm in the bake script). We upgraded spawn on the laptop to 0.36.9 before testing, but the head instance itself was still running 0.36.6, where the pipe-mode bug was live. That explains the observed behaviour.
The AMI bake script installs whichever version is latest from GitHub releases at bake time — so the next rebake will pick up 0.36.9 and the pipe issue goes away automatically.
Please do take both flag changes:-y for defensive forward-compat, and --ami from ext.ami to sidestep spawn#38. Both are clean improvements regardless of version.
spawn version from the failing run: 0.36.6 (confirmed from the instance; the laptop had 0.36.9 at the time of testing which caused the version mismatch).
Activity
scttfrdmn commentedon Jun 3, 2026
I reproduced this against the actual code before acting, because the primary diagnosis doesn't hold on spawn 0.36.9 (the version cited). Results are mixed — one half doesn't reproduce, the other is real:
The
-y/ "silent exit-0 failure" half does NOT reproduce on 0.36.9I ran nf-spawn's exact command (no
-y,--instance-type t4g.nano, stdin piped/closed) against a real spawn 0.36.9 binary:No "failed to parse JSON", no silent no-op. Why: #34 (shipped in 0.36.9, PR #36) routes
launchto one of three modes vialaunchMode(interactive, instanceType, stdinIsTTY):modePipe, the source offailed to parse input: failed to parse JSON) requiresinstanceType == "". nf-spawn always passes--instance-type, so it'smodeFlags— stdin is never read.fmt.Scanlncost/locality prompts, both guarded byif !autoYes(launch.go:1380, 3148), and one of those only fires on a cross-region data-locality mismatch. On closed stdinScanlnreturns an error harmlessly and proceeds — it doesn't abort with a JSON error.So the repro in the issue looks like it was captured against a pre-0.36.9 / pre-#34 spawn, where
--instance-type+ piped stdin still hit the truffle-parse path. On 0.36.9 it's already fixed.That said — adding
-yis still correct and worth doing. It's harmless inmodeFlags, and it future-proofs against the cost-approval prompt ever becoming reachable (e.g. the cross-region locality path, or a behavior change). Cheap insurance; no objection. Just want the issue's stated mechanism on record as not the actual 0.36.9 behavior, so we don't believe we fixed a silent-failure bug that wasn't there.One correction to the issue body regardless of version: spawn does not "return exit 0 with a failed-to-parse error" — in the genuine pipe path it returns the error with a nonzero exit (
return i18n.Te("error.input_parse_failed", err)). If a real run truly saw exit 0 + that message, that's a separate spawn bug and I'd want the spawn version (spawn version) + the literal stderr to chase it.The
--amihalf is REAL ✅Confirmed: without
--ami, spawn auto-detects viassm:GetParameteron/aws/service/ami-amazon-linux-latest/...(pkg/aws/ami.go:22-27,59), which needs the instance/caller role to have that SSM permission — exactly spawn#38 (open). Passingext.amiwhen provided is a good way to sidestep that dependency. 👍Suggested resolution
Both flag changes are reasonable to land in nf-spawn:
-ytobuildLaunchCommand()— defensive, not a 0.36.9 bugfix.--amifromext.ami— real, avoids the spawn#38 SSM-permission dependency.Want me to take both (with a guard test asserting
-yis present and--amiis passed iffext.amiis set)? If you can also sharespawn versionfrom the failing run, I'll confirm whether the silent-failure was a genuinely older binary or something still live.scttfrdmn commentedon Jun 3, 2026
Thank you — the version confusion makes sense. The head node AMI was baked with spawn 0.36.6 (installed via
spawn_0.36.6_linux_arm64.rpmin the bake script). We upgraded spawn on the laptop to 0.36.9 before testing, but the head instance itself was still running 0.36.6, where the pipe-mode bug was live. That explains the observed behaviour.The AMI bake script installs whichever version is
latestfrom GitHub releases at bake time — so the next rebake will pick up 0.36.9 and the pipe issue goes away automatically.Please do take both flag changes:
-yfor defensive forward-compat, and--amifromext.amito sidestep spawn#38. Both are clean improvements regardless of version.spawn versionfrom the failing run: 0.36.6 (confirmed from the instance; the laptop had 0.36.9 at the time of testing which caused the version mismatch).fix: add -y and optional --ami to spawn launch (#18) (#19)
chore(release): v0.2.2 (#20)