{"record":{"id":"b1e31296baa25e1f","repo":"hibiken/asynq","slug":"no-tasks-are-ready-for-processing","errorCode":null,"errorMessage":"no tasks are ready for processing","messagePattern":"no tasks are ready for processing","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"info","filePath":"internal/errors/errors.go","lineNumber":170,"sourceCode":"\t\treturn Unspecified\n\t}\n\te, ok := err.(*Error)\n\tif !ok {\n\t\treturn Unspecified\n\t}\n\tif e.Code == Unspecified {\n\t\treturn CanonicalCode(e.Err)\n\t}\n\treturn e.Code\n}\n\n/******************************************\n    Domain Specific Error Types & Values\n*******************************************/\n\nvar (\n\t// ErrNoProcessableTask indicates that there are no tasks ready to be processed.\n\tErrNoProcessableTask = errors.New(\"no tasks are ready for processing\")\n\n\t// ErrDuplicateTask indicates that another task with the same unique key holds the uniqueness lock.\n\tErrDuplicateTask = errors.New(\"task already exists\")\n\n\t// ErrTaskIdConflict indicates that another task with the same task ID already exist\n\tErrTaskIdConflict = errors.New(\"task id conflicts with another task\")\n)\n\n// TaskNotFoundError indicates that a task with the given ID does not exist\n// in the given queue.\ntype TaskNotFoundError struct {\n\tQueue string // queue name\n\tID    string // task id\n}\n\nfunc (e *TaskNotFoundError) Error() string {\n\treturn fmt.Sprintf(\"cannot find task with id=%s in queue %q\", e.ID, e.Queue)\n}","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/hibiken/asynq/blob/d135f1439bee74e989b7f9b41ecd542cc87f024a/internal/errors/errors.go#L152-L188","documentation":"ErrNoProcessableTask indicates Dequeue found no tasks ready for processing: all queues are empty, paused, or hold only scheduled/archived tasks. It is the normal, expected outcome of an idle broker and is returned by rdb.Dequeue (wrapped in an Operation error).","triggerScenarios":"Server processor calling Dequeue across configured queues with nothing pending; all queues paused; every pending task is scheduled for a future ProcessAt time; queue names in server config don't match where tasks were enqueued.","commonSituations":"Healthy idle systems (expected); server configured with queue names that differ from producer's queue names; producer writing to a different Redis; long scheduling delays making the system look starved.","solutions":["Verify server queue config includes the queues producers enqueue to.","Confirm both server and client point at the same Redis host/DB.","Check whether queues are paused (asynq queue state) and resume them if needed.","Treat this error as normal idleness in the processor loop rather than a failure."],"exampleFix":"// before\nmsg, err := r.Dequeue(qnames)\nif err != nil { return err }\n// after\nmsg, err := r.Dequeue(qnames)\nif errors.Is(errors.Unwrap(err), errors.ErrNoProcessableTask) {\n    return nil // idle: nothing to process\n} else if err != nil {\n    return err\n}","handlingStrategy":"fallback","validationCode":"// Check liveness before dequeue loops:\nfor _, q := range qnames { insp.Stats(q) /* verify queue reachable */ }","typeGuard":"func isNoProcessableTask(err error) bool {\n    var oe *errors.OpError // internal OpError wrapping\n    return errors.Is(err, errors.ErrNoProcessableTask) ||\n        strings.Contains(err.Error(), \"no tasks are ready for processing\")\n}","tryCatchPattern":"if err := processor.Dequeue(); err != nil {\n    if isNoProcessableTask(err) { time.Sleep(pollInterval); continue }\n    return err\n}","preventionTips":["Align server queue config with producer queue names","Verify both sides use the same Redis instance/DB","Check for paused queues when the system appears idle","Treat this error as normal idle signaling in processor loops"],"tags":["redis","dequeue","processor","idle"],"backgroundTag":"empty-result-set","analyzedSha":"d135f1439bee74e989b7f9b41ecd542cc87f024a","analyzedAt":"2026-09-07T19:02:34.660Z","contentChangedAt":"2026-09-07T19:02:34.660Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}