wavetermdev/waveterm · error

deleting job: %w

Error message

deleting job: %w

What it means

`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.

Source

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

		attachedBlock := "-"
		if job.AttachedBlockId != "" {
			if len(job.AttachedBlockId) >= 8 {
				attachedBlock = job.AttachedBlockId[:8]
			} else {
				attachedBlock = job.AttachedBlockId
			}
		}

		fmt.Printf("%-36s %-25s %-9s %-10s %-6s %-30s %-8s %-10s %-8s\n",
			job.OID, job.Connection, connectedStatus, job.JobManagerStatus, doneReason, job.Cmd, exitCode, streamStatus, attachedBlock)
	}
	return nil
}

func jobDebugDeleteRun(cmd *cobra.Command, args []string) error {
	err := wshclient.JobControllerDeleteJobCommand(RpcClient, jobIdFlag, &wshrpc.RpcOpts{Timeout: 5000})
	if err != nil {
		return fmt.Errorf("deleting job: %w", err)
	}

	fmt.Printf("Job %s deleted successfully\n", jobIdFlag)
	return nil
}

func jobDebugDeleteAllRun(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)
	}

	if len(rtnData) == 0 {
		fmt.Printf("No jobs to delete\n")
		return nil
	}

	deletedCount := 0

View on GitHub (pinned to a4447c1563)

Solutions

  1. Re-run `wsh jobdebug list` to confirm the jobid exists, then delete the correct OID
  2. Check connectivity to the Wave app if the wrapped error looks like a timeout/transport failure
  3. Retry the delete — deletion may have failed transiently

Example fix

// before
wsh jobdebug delete --jobid abc123   # not found
// after
wsh jobdebug list                    # get a valid OID
wsh jobdebug delete --jobid <valid-oid>
Defensive patterns

Strategy: validation

Validate before calling

wsh jobdebug list | grep -q "$jobid" || { echo "job $jobid not found"; exit 1; }

Try / catch

wsh jobdebug delete --jobid "$jobid" || { echo "delete failed: $?"; wsh jobdebug list; exit 1; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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