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
spawn launch fails with "failed to parse JSON" when stdin is a pipe (non-interactive) #34
spawn launch fails with failed to parse input: failed to parse JSON: unexpected end of JSON input when called without a TTY (e.g. from a Java subprocess or piped stdin).
Steps to reproduce
# From an EC2 instance, without a TTY:
sudo spawn launch test --instance-type t4g.nano --ami ami-xxx --region us-east-1 --ttl 5m -y
# → failed to parse input: failed to parse JSON: unexpected end of JSON inputecho""| spawn launch test --instance-type t4g.nano --ami ami-xxx --region us-east-1 --ttl 5m -y
# → same error
Works fine with a real TTY (ssh -t ec2-user@host "spawn launch ...").
Root cause
When stdin is a pipe (not a TTY), spawn interprets stdin as a JSON input stream (truffle pipe mode: truffle search | spawn launch). When the pipe is empty or the caller is a Java thread, the JSON parse fails immediately.
Impact
This blocks nf-spawn (the Nextflow executor plugin) from launching tasks: when Nextflow calls spawn via ProcessBuilder, stdin is a pipe, so every spawn launch call fails.
Expected
spawn launch with explicit flags (--instance-type, --ami, --region, -y) should not try to read JSON from stdin. If stdin is not a TTY and no JSON is received within a timeout, it should proceed with the explicit flags.
Or: add a --no-pipe / --direct flag that suppresses the truffle pipe mode.
Context
spawn 0.36.6
Called from nf-spawn Nextflow plugin via Java ProcessBuilder
Activity
fix(launch): non-interactive stdin (#34) and STS→IMDS identity fallba…