wavetermdev/waveterm · error
job not started
Error message
job not started
What it means
JobInputCommand additionally requires that the job manager has an active job stream (IsJobStarted). If StartStream was never invoked, or the job already ended, input cannot be routed to any process and 'job not started' is returned.
Source
Thrown at pkg/jobmanager/mainserverconn.go:129
if !msc.SelfAuthenticated.Load() {
return nil, fmt.Errorf("not authenticated to server")
}
return WshCmdJobManager.PrepareConnect(msc, data)
}
func (msc *MainServerConn) JobStartStreamCommand(ctx context.Context, data wshrpc.CommandJobStartStreamData) error {
if !msc.PeerAuthenticated.Load() {
return fmt.Errorf("not authenticated")
}
return WshCmdJobManager.StartStream(msc)
}
func (msc *MainServerConn) JobInputCommand(ctx context.Context, data wshrpc.CommandJobInputData) error {
if !msc.PeerAuthenticated.Load() {
return fmt.Errorf("not authenticated")
}
if !WshCmdJobManager.IsJobStarted() {
return fmt.Errorf("job not started")
}
WshCmdJobManager.InputQueue.QueueItem(data.InputSessionId, data.SeqNum, data)
return nil
}
View on GitHub (pinned to a4447c1563)
Solutions
- Call JobStartStreamCommand first and confirm it succeeds before sending input
- Check WshCmdJobManager.IsJobStarted() on the client side before sending input and surface 'job ended' to the user instead of forwarding keystrokes
- Handle job-exit events to disable the input path when the stream terminates
Example fix
// before
conn.JobInputCommand(ctx, data) // job may not be running
// after
if !conn.PeerAuthenticated.Load() { return fmt.Errorf("not authenticated") }
if !WshCmdJobManager.IsJobStarted() {
return fmt.Errorf("cannot send input: job is not running")
}
return conn.JobInputCommand(ctx, data) Defensive patterns
Strategy: validation
Validate before calling
if !conn.PeerAuthenticated.Load() || !WshCmdJobManager.IsJobStarted() {
return fmt.Errorf("cannot send input: job not running")
} Try / catch
err := conn.JobInputCommand(ctx, data)
if err != nil && strings.Contains(err.Error(), "job not started") {
// surface job-ended state to the user instead of retrying
ui.ShowJobEnded()
} Prevention
- Track job lifecycle events and disable input when the stream ends
- Call JobStartStreamCommand before wiring input handlers
- Treat 'job not started' as terminal state, not a transient error
When it happens
Trigger: Calling JobInputCommand without a prior successful JobStartStreamCommand, or after the job stream has terminated (IsJobStarted returns false).
Common situations: User types into a terminal pane whose job died or was never launched; job ended while input was still queued from the client; a race where input is sent concurrently with job shutdown.
Related errors
- failed to authenticate to server: %w
- not authenticated
- peer not authenticated
- not authenticated to server
- builder rtinfo not found for builderid: %s
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/19f247452c29af23.
Report an issue: GitHub.