{"record":{"id":"7f49287a8088fe53","repo":"wavetermdev/waveterm","slug":"getting-connected-job-ids-w","errorCode":null,"errorMessage":"getting connected job ids: %w","messagePattern":"getting connected job ids: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-jobdebug.go","lineNumber":171,"sourceCode":"\n\tjobDebugAttachJobCmd.Flags().StringVar(&attachJobIdFlag, \"jobid\", \"\", \"job id to attach (required)\")\n\tjobDebugAttachJobCmd.MarkFlagRequired(\"jobid\")\n\tjobDebugAttachJobCmd.Flags().StringVar(&attachBlockIdFlag, \"blockid\", \"\", \"block id to attach to (required)\")\n\tjobDebugAttachJobCmd.MarkFlagRequired(\"blockid\")\n\n\tjobDebugDetachJobCmd.Flags().StringVar(&detachJobIdFlag, \"jobid\", \"\", \"job id to detach (required)\")\n\tjobDebugDetachJobCmd.MarkFlagRequired(\"jobid\")\n}\n\nfunc jobDebugListRun(cmd *cobra.Command, args []string) error {\n\trtnData, err := wshclient.JobControllerListCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 5000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"getting job debug list: %w\", err)\n\t}\n\n\tconnectedJobIds, err := wshclient.JobControllerConnectedJobsCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 5000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"getting connected job ids: %w\", err)\n\t}\n\n\tconnectedMap := make(map[string]bool)\n\tfor _, jobId := range connectedJobIds {\n\t\tconnectedMap[jobId] = true\n\t}\n\n\tif jobDebugJsonFlag {\n\t\tjsonData, err := json.MarshalIndent(rtnData, \"\", \"  \")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"marshaling json: %w\", err)\n\t\t}\n\t\tfmt.Printf(\"%s\\n\", string(jsonData))\n\t\treturn nil\n\t}\n\n\tfmt.Printf(\"%-36s %-25s %-9s %-10s %-6s %-30s %-8s %-10s %-8s\\n\", \"OID\", \"Connection\", \"Connected\", \"Manager\", \"Reason\", \"Cmd\", \"ExitCode\", \"Stream\", \"Attached\")\n\tfor _, job := range rtnData {","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-jobdebug.go#L153-L189","documentation":"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.","triggerScenarios":"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.","commonSituations":"Intermittent ssh/socket drops mid-command; app busy handling job traffic so the second 5s RPC expires; reconnecting remote sessions.","solutions":["Simply retry `wsh jobdebug list` — the failure is often transient network/transport","Check connection stability (wsh conn show) between the wsh client and the app","If timeouts recur under load, close background job traffic or restart the app before listing"],"exampleFix":"// before\nwsh jobdebug list   # second rpc dropped\n// after\nwsh jobdebug list   # retry; jobs then show Connected column correctly","handlingStrategy":"retry","validationCode":"wsh conn show >/dev/null || exit 1","typeGuard":null,"tryCatchPattern":"wsh jobdebug list || { sleep 2; wsh jobdebug list; }","preventionTips":["Retry on transient drops — the list RPC may have succeeded before this one failed","Avoid running job listing over unstable ssh links","Check app load if the second 5s RPC repeatedly times out"],"tags":["rpc","jobs","network","wsh"],"backgroundTag":"rpc-request-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}