wavetermdev/waveterm · error

getting connected job ids: %w

Error message

getting connected job ids: %w

What it means

After listing jobs, `wsh jobdebug list` queries JobControllerConnectedJobsCommand (5s timeout) to mark which jobs have live managers; failure is wrapped as 'getting connected job ids' (cmd/wshcmd-jobdebug.go:171). Note the job list itself may already have succeeded — this second RPC is the one that failed.

Source

Thrown at cmd/wsh/cmd/wshcmd-jobdebug.go:171

	jobDebugAttachJobCmd.Flags().StringVar(&attachJobIdFlag, "jobid", "", "job id to attach (required)")
	jobDebugAttachJobCmd.MarkFlagRequired("jobid")
	jobDebugAttachJobCmd.Flags().StringVar(&attachBlockIdFlag, "blockid", "", "block id to attach to (required)")
	jobDebugAttachJobCmd.MarkFlagRequired("blockid")

	jobDebugDetachJobCmd.Flags().StringVar(&detachJobIdFlag, "jobid", "", "job id to detach (required)")
	jobDebugDetachJobCmd.MarkFlagRequired("jobid")
}

func jobDebugListRun(cmd *cobra.Command, args []string) error {
	rtnData, err := wshclient.JobControllerListCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 5000})
	if err != nil {
		return fmt.Errorf("getting job debug list: %w", err)
	}

	connectedJobIds, err := wshclient.JobControllerConnectedJobsCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 5000})
	if err != nil {
		return fmt.Errorf("getting connected job ids: %w", err)
	}

	connectedMap := make(map[string]bool)
	for _, jobId := range connectedJobIds {
		connectedMap[jobId] = true
	}

	if jobDebugJsonFlag {
		jsonData, err := json.MarshalIndent(rtnData, "", "  ")
		if err != nil {
			return fmt.Errorf("marshaling json: %w", err)
		}
		fmt.Printf("%s\n", string(jsonData))
		return nil
	}

	fmt.Printf("%-36s %-25s %-9s %-10s %-6s %-30s %-8s %-10s %-8s\n", "OID", "Connection", "Connected", "Manager", "Reason", "Cmd", "ExitCode", "Stream", "Attached")
	for _, job := range rtnData {

View on GitHub (pinned to a4447c1563)

Solutions

  1. Simply retry `wsh jobdebug list` — the failure is often transient network/transport
  2. Check connection stability (wsh conn show) between the wsh client and the app
  3. If timeouts recur under load, close background job traffic or restart the app before listing

Example fix

// before
wsh jobdebug list   # second rpc dropped
// after
wsh jobdebug list   # retry; jobs then show Connected column correctly
Defensive patterns

Strategy: retry

Validate before calling

wsh conn show >/dev/null || exit 1

Try / catch

wsh jobdebug list || { sleep 2; wsh jobdebug list; }

Prevention

When it happens

Trigger: Running `wsh jobdebug list` where the second RPC for connected job ids fails or times out, usually from a flaky connection between wsh and the Wave app.

Common situations: Intermittent ssh/socket drops mid-command; app busy handling job traffic so the second 5s RPC expires; reconnecting remote sessions.

Related errors


AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01). Data as JSON: /api/errors/7f49287a8088fe53. Report an issue: GitHub.