{"record":{"id":"d8ee3330269ad434","repo":"hibiken/asynq","slug":"queue-q-is-not-paused","errorCode":null,"errorMessage":"queue %q is not paused","messagePattern":"queue %q is not paused","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/rdb/inspect.go","lineNumber":2095,"sourceCode":"\tok, err := r.client.SetNX(context.Background(), key, r.clock.Now().Unix(), 0).Result()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !ok {\n\t\treturn fmt.Errorf(\"queue %q is already paused\", qname)\n\t}\n\treturn nil\n}\n\n// Unpause resumes processing of tasks from the given queue.\nfunc (r *RDB) Unpause(qname string) error {\n\tkey := base.PausedKey(qname)\n\tdeleted, err := r.client.Del(context.Background(), key).Result()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif deleted == 0 {\n\t\treturn fmt.Errorf(\"queue %q is not paused\", qname)\n\t}\n\treturn nil\n}\n\n// ClusterKeySlot returns an integer identifying the hash slot the given queue hashes to.\nfunc (r *RDB) ClusterKeySlot(qname string) (int64, error) {\n\tkey := base.PendingKey(qname)\n\treturn r.client.ClusterKeySlot(context.Background(), key).Result()\n}\n\n// ClusterNodes returns a list of nodes the given queue belongs to.\nfunc (r *RDB) ClusterNodes(qname string) ([]redis.ClusterNode, error) {\n\tkeyslot, err := r.ClusterKeySlot(qname)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclusterSlots, err := r.client.ClusterSlots(context.Background()).Result()\n\tif err != nil {","sourceCodeStart":2077,"sourceCodeEnd":2113,"githubUrl":"https://github.com/hibiken/asynq/blob/d135f1439bee74e989b7f9b41ecd542cc87f024a/internal/rdb/inspect.go#L2077-L2113","documentation":"Returned by RDB.Unpause when the queue has no paused-key, i.e. it is not currently paused. Unpause deletes the paused-key; if Del removes 0 keys the queue was never paused and this error is returned. Purely a state-validation error.","triggerScenarios":"Calling inspector.Unpause(queue) on a queue that is active (never paused or already unpaused), possibly concurrently unpaused by another process.","commonSituations":"Ops scripts that unpause all queues blindly; double-click/two workers handling the same unpause request; after a Redis restart where the paused key was lost.","solutions":["Check IsPaused(queue) before calling Unpause","Ignore this error when the goal is simply 'queue is running'","Centralize pause-state management to avoid races","Re-issue Pause if the paused key was unintentionally lost"],"exampleFix":"// before\nif err := inspector.Unpause(q); err != nil {\n    return err\n}\n// after\npaused, err := inspector.IsPaused(q)\nif err != nil { return err }\nif paused {\n    if err := inspector.Unpause(q); err != nil { return err }\n}","handlingStrategy":"validation","validationCode":"paused, err := inspector.IsPaused(q)\nif err != nil { return err }\nif !paused { return nil } // already running","typeGuard":null,"tryCatchPattern":"if err := inspector.Unpause(q); err != nil && !strings.Contains(err.Error(), \"not paused\") {\n    return err\n} // treat not-paused as success","preventionTips":["Check IsPaused before Unpause","Treat unpause as idempotent 'ensure running' semantics","Avoid multiple actors managing the same queue's paused state","After Redis restarts, re-sync intended pause state"],"tags":["redis","queue-state","conflict"],"backgroundTag":"invalid-state-transition","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"}