{"record":{"id":"2c8315694cdc337d","repo":"wavetermdev/waveterm","slug":"deleting-job-w","errorCode":null,"errorMessage":"deleting job: %w","messagePattern":"deleting job: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-jobdebug.go","lineNumber":245,"sourceCode":"\t\tattachedBlock := \"-\"\n\t\tif job.AttachedBlockId != \"\" {\n\t\t\tif len(job.AttachedBlockId) >= 8 {\n\t\t\t\tattachedBlock = job.AttachedBlockId[:8]\n\t\t\t} else {\n\t\t\t\tattachedBlock = job.AttachedBlockId\n\t\t\t}\n\t\t}\n\n\t\tfmt.Printf(\"%-36s %-25s %-9s %-10s %-6s %-30s %-8s %-10s %-8s\\n\",\n\t\t\tjob.OID, job.Connection, connectedStatus, job.JobManagerStatus, doneReason, job.Cmd, exitCode, streamStatus, attachedBlock)\n\t}\n\treturn nil\n}\n\nfunc jobDebugDeleteRun(cmd *cobra.Command, args []string) error {\n\terr := wshclient.JobControllerDeleteJobCommand(RpcClient, jobIdFlag, &wshrpc.RpcOpts{Timeout: 5000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"deleting job: %w\", err)\n\t}\n\n\tfmt.Printf(\"Job %s deleted successfully\\n\", jobIdFlag)\n\treturn nil\n}\n\nfunc jobDebugDeleteAllRun(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\tif len(rtnData) == 0 {\n\t\tfmt.Printf(\"No jobs to delete\\n\")\n\t\treturn nil\n\t}\n\n\tdeletedCount := 0","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-jobdebug.go#L227-L263","documentation":"`wsh jobdebug delete --jobid X` calls JobControllerDeleteJobCommand and wraps any RPC failure as 'deleting job' (cmd/wshcmd-jobdebug.go:245). The underlying error may be transport failure, an unknown job id, or a server-side refusal; the wrapper does not distinguish, so inspect the wrapped message.","triggerScenarios":"Running `wsh jobdebug delete --jobid <id>` where the id does not exist, the RPC times out (5s), or the job controller cannot perform the deletion.","commonSituations":"Deleting a job by an id copied from an old `jobdebug list` after it was already removed or pruned; typos in the jobid; connectivity drop to the app.","solutions":["Re-run `wsh jobdebug list` to confirm the jobid exists, then delete the correct OID","Check connectivity to the Wave app if the wrapped error looks like a timeout/transport failure","Retry the delete — deletion may have failed transiently"],"exampleFix":"// before\nwsh jobdebug delete --jobid abc123   # not found\n// after\nwsh jobdebug list                    # get a valid OID\nwsh jobdebug delete --jobid <valid-oid>","handlingStrategy":"validation","validationCode":"wsh jobdebug list | grep -q \"$jobid\" || { echo \"job $jobid not found\"; exit 1; }","typeGuard":null,"tryCatchPattern":"wsh jobdebug delete --jobid \"$jobid\" || { echo \"delete failed: $?\"; wsh jobdebug list; exit 1; }","preventionTips":["Always confirm the jobid exists via jobdebug list before deleting","Copy the exact OID, avoid manual retyping","Check connectivity if the wrapped error is a timeout"],"tags":["rpc","jobs","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"}