wavetermdev/waveterm · error
failed to get jobs: %w
Error message
failed to get jobs: %w
What it means
GetAllJobManagerStatus retrieves every waveobj.Job via wstore.DBGetAllObjsByType and maps them to JobManagerStatusUpdate entries. This error wraps a failure of the underlying type-scoped DB enumeration, before any per-job processing begins.
Source
Thrown at pkg/jobcontroller/jobcontroller.go:157
func isJobManagerRunning(job *waveobj.Job) bool {
return job.JobManagerStatus == JobManagerStatus_Running
}
func GetJobManagerStatus(ctx context.Context, jobId string) (string, error) {
job, err := wstore.DBGet[*waveobj.Job](ctx, jobId)
if err != nil {
return "", fmt.Errorf("failed to get job: %w", err)
}
if job == nil {
return JobManagerStatus_Done, nil
}
return job.JobManagerStatus, nil
}
func GetAllJobManagerStatus(ctx context.Context) ([]*wshrpc.JobManagerStatusUpdate, error) {
allJobs, err := wstore.DBGetAllObjsByType[*waveobj.Job](ctx, waveobj.OType_Job)
if err != nil {
return nil, fmt.Errorf("failed to get jobs: %w", err)
}
var statuses []*wshrpc.JobManagerStatusUpdate
for _, job := range allJobs {
statuses = append(statuses, &wshrpc.JobManagerStatusUpdate{
JobId: job.OID,
JobManagerStatus: job.JobManagerStatus,
})
}
return statuses, nil
}
func GetBlockJobStatus(ctx context.Context, blockId string) (*wshrpc.BlockJobStatusData, error) {
block, err := wstore.DBGet[*waveobj.Block](ctx, blockId)
if err != nil {
return nil, fmt.Errorf("failed to get block: %w", err)
}View on GitHub (pinned to a4447c1563)
Solutions
- Inspect the wrapped error for the wstore root cause
- Retry with a live context
- Repair/restore the wave DB if corruption is indicated
- Return an empty list instead of failing if statuses are best-effort
Example fix
// before
statuses, err := jobcontroller.GetAllJobManagerStatus(ctx)
if err != nil {
return err
}
// after
statuses, err := jobcontroller.GetAllJobManagerStatus(ctx)
if err != nil {
log.Printf("failed to enumerate job statuses: %v", err)
statuses = nil
} Defensive patterns
Strategy: fallback
Validate before calling
if ctx.Err() != nil {
return errors.New("context canceled; skip enumeration")
} Try / catch
statuses, err := jobcontroller.GetAllJobManagerStatus(ctx)
if err != nil {
log.Printf("using empty job status list: %v", err)
statuses = []*wshrpc.JobManagerStatusUpdate{}
} Prevention
- Treat status enumeration as best-effort with an empty-list fallback
- Check context validity before batch reads
- Alert on repeated failures — may indicate DB corruption
- Keep wave DB backups
When it happens
Trigger: Calling GetAllJobManagerStatus when wstore.DBGetAllObjsByType[*waveobj.Job](ctx, OType_Job) fails — DB I/O error, corrupted job records, or canceled context.
Common situations: DB corruption affecting the job table; context cancellation during app shutdown; disk full preventing reads.
Related errors
- failed to get job: %w
- failed to get block: %w
- error getting tab: %w
- error getting client data: %w
- error getting object: %w
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/2f2d0e65e8942e37.
Report an issue: GitHub.