wavetermdev/waveterm · error
error reading ready pipe: %w
Error message
error reading ready pipe: %w
What it means
The goroutine scanning the readiness pipe hit a read error (scanner.Err() != nil) instead of receiving the 'Wave-JobManagerStart' signal. The error is forwarded through startCh and returned to the caller, which kills the child process.
Source
Thrown at pkg/wshrpc/wshremote/wshremote_job.go:223
log.Printf("RemoteStartJobCommand: error reading stdout: %v\n", err)
} else {
log.Printf("RemoteStartJobCommand: stdout EOF\n")
}
}()
startCh := make(chan error, 1)
go func() {
scanner := bufio.NewScanner(readyPipeRead)
for scanner.Scan() {
line := scanner.Text()
log.Printf("RemoteStartJobCommand: ready pipe line: %s\n", line)
if strings.Contains(line, "Wave-JobManagerStart") {
startCh <- nil
return
}
}
if err := scanner.Err(); err != nil {
startCh <- fmt.Errorf("error reading ready pipe: %w", err)
} else {
log.Printf("RemoteStartJobCommand: ready pipe EOF\n")
startCh <- fmt.Errorf("job manager exited without start signal")
}
}()
timeoutCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
log.Printf("RemoteStartJobCommand: waiting for start signal\n")
select {
case err := <-startCh:
if err != nil {
cmd.Process.Kill()
log.Printf("RemoteStartJobCommand: error from start signal: %v\n", err)
return nil, err
}
log.Printf("RemoteStartJobCommand: received start signal\n")View on GitHub (pinned to a4447c1563)
Solutions
- Check the stderr goroutine logs for the jobmanager's own error output
- Ensure the installed wsh binary version supports the jobmanager ready-pipe protocol (re-run 'wsh init')
- Retry the job start; if persistent, inspect the wsh binary and its fd-3 usage
Defensive patterns
Strategy: retry
Validate before calling
out, err := exec.Command(wshPath, "--version").CombinedOutput()
if err != nil {
return fmt.Errorf("wsh binary unusable on remote: %v", err)
} Try / catch
rtn, err := server.RemoteStartJobCommand(ctx, data)
if err != nil {
if strings.Contains(err.Error(), "error reading ready pipe") {
// transient pipe failure: retry once after checking wsh version
}
return err
} Prevention
- Keep the remote wsh binary current ('wsh init')
- Never let other code touch the child's inherited fd 3
- Log stderr lines to diagnose the underlying I/O failure
When it happens
Trigger: Reading fd 3 (the ready pipe inherited via ExtraFiles) fails mid-stream — e.g. the fd was closed unexpectedly, the pipe buffer state is corrupt, or the child manipulated its inherited fd 3.
Common situations: Child process closing or reusing fd 3 incorrectly (version mismatch or a foreign 'wsh' binary); I/O errors on the pipe under extreme system stress.
Related errors
- cannot create ready pipe: %w
- cannot create stdin pipe: %w
- cannot create stdout pipe: %w
- cannot create stderr pipe: %w
- job manager exited without start signal
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/05f9ce8a99008822.
Report an issue: GitHub.