{"record":{"id":"90276c76e8556520","repo":"wavetermdev/waveterm","slug":"getting-job-debug-list-w","errorCode":null,"errorMessage":"getting job debug list: %w","messagePattern":"getting job debug list: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-jobdebug.go","lineNumber":166,"sourceCode":"\tjobDebugGetOutputCmd.Flags().StringVar(&jobIdFlag, \"jobid\", \"\", \"job id to get output for (required)\")\n\tjobDebugGetOutputCmd.MarkFlagRequired(\"jobid\")\n\n\tjobDebugStartCmd.Flags().StringVar(&jobConnFlag, \"conn\", \"\", \"connection name (required)\")\n\tjobDebugStartCmd.MarkFlagRequired(\"conn\")\n\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))","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-jobdebug.go#L148-L184","documentation":"`wsh jobdebug list` first calls JobControllerListCommand with a 5s timeout; any failure is wrapped as 'getting job debug list' (cmd/wshcmd-jobdebug.go:166). This is the server-side job registry query failing, typically due to RPC transport problems to the Wave client or job control plane.","triggerScenarios":"Running `wsh jobdebug list` (or --json) when the RPC client cannot reach the job controller — Wave app not running, socket broken, or 5s timeout exceeded.","commonSituations":"Debugging jobs from an environment where wsh cannot connect to the app; app under heavy load causing the 5s timeout; stale wsh session after app restart.","solutions":["Ensure the Wave Terminal app is running and the wsh RPC client is connected, then retry","Run `wsh connectionstate`/`wsh conn show` to check the underlying connection before debugging jobs","Restart the wsh session or reconnect the route if the client is stale"],"exampleFix":"// before\nwsh jobdebug list   # rpc timeout\n// after\nwsh conn show       # verify connectivity\nwsh jobdebug list","handlingStrategy":"retry","validationCode":"wsh conn show && echo ok || echo 'fix connection first'","typeGuard":null,"tryCatchPattern":"for i in 1 2 3; do\n  wsh jobdebug list && break\n  sleep 2\n done","preventionTips":["Run jobdebug commands only with a confirmed app connection","Watch for the 5s timeout under heavy app load","Reconnect wsh after restarting the Wave app"],"tags":["rpc","jobs","debugging","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"}