{"record":{"id":"cc91b33d05da8d52","repo":"hibiken/asynq","slug":"asynq-err","errorCode":null,"errorMessage":"asynq: err","messagePattern":"asynq: err","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"inspector.go","lineNumber":747,"sourceCode":"// and reports the number of tasks archived.\nfunc (i *Inspector) ArchiveAllAggregatingTasks(queue, group string) (int, error) {\n\tif err := base.ValidateQueueName(queue); err != nil {\n\t\treturn 0, err\n\t}\n\tn, err := i.rdb.ArchiveAllAggregatingTasks(queue, group)\n\treturn int(n), err\n}\n\n// ArchiveTask archives a task with the given id in the given queue.\n// The task needs to be in pending, scheduled, or retry state, otherwise ArchiveTask\n// will return an error.\n//\n// If a queue with the given name doesn't exist, it returns an error wrapping ErrQueueNotFound.\n// If a task with the given id doesn't exist in the queue, it returns an error wrapping ErrTaskNotFound.\n// If the task is in already archived, it returns a non-nil error.\nfunc (i *Inspector) ArchiveTask(queue, id string) error {\n\tif err := base.ValidateQueueName(queue); err != nil {\n\t\treturn fmt.Errorf(\"asynq: err\")\n\t}\n\terr := i.rdb.ArchiveTask(queue, id)\n\tswitch {\n\tcase errors.IsQueueNotFound(err):\n\t\treturn fmt.Errorf(\"asynq: %w\", ErrQueueNotFound)\n\tcase errors.IsTaskNotFound(err):\n\t\treturn fmt.Errorf(\"asynq: %w\", ErrTaskNotFound)\n\tcase err != nil:\n\t\treturn fmt.Errorf(\"asynq: %w\", err)\n\t}\n\treturn nil\n}\n\n// CancelProcessing sends a signal to cancel processing of the task\n// given a task id. CancelProcessing is best-effort, which means that it does not\n// guarantee that the task with the given id will be canceled. The return\n// value only indicates whether the cancelation signal has been sent.\nfunc (i *Inspector) CancelProcessing(id string) error {","sourceCodeStart":729,"sourceCodeEnd":765,"githubUrl":"https://github.com/hibiken/asynq/blob/d135f1439bee74e989b7f9b41ecd542cc87f024a/inspector.go#L729-L765","documentation":"ArchiveTask returns fmt.Errorf(\"asynq: err\") — an uninformative, non-wrapped literal — when base.ValidateQueueName rejects the queue name (empty or whitespace-only). Unlike sibling call sites, the underlying validation error is not embedded with %w, so the message gives no detail beyond 'asynq: err'.","triggerScenarios":"Inspector.ArchiveTask(queue, id) with queue == \"\" or \"   \"; invalid queue name from config/env.","commonSituations":"Blank env var for queue name; template/config merge that dropped the queue key; passing an empty queue because a task-listing result was empty.","solutions":["Ensure the queue argument is a non-empty, trimmed string before calling ArchiveTask.","Call base.ValidateQueueName(queue) yourself first to get the descriptive error message.","Fix upstream config so a real queue name (e.g. \"default\") is always provided."],"exampleFix":"// before\ninsp.ArchiveTask(cfg.Queue, id) // cfg.Queue may be \"\"\n// after\nif base.ValidateQueueName(cfg.Queue) != nil { cfg.Queue = \"default\" }\ninsp.ArchiveTask(cfg.Queue, id)","handlingStrategy":"validation","validationCode":"if err := base.ValidateQueueName(queue); err != nil { return err } // yields the descriptive message","typeGuard":"func validQueue(q string) bool { return strings.TrimSpace(q) != \"\" }","tryCatchPattern":null,"preventionTips":["Validate queue names at config load time","Don't rely on the opaque 'asynq: err' text; pre-validate to get the real message","Reject blank queue names in your own CLI/config layer"],"tags":["queue-name","validation","opaque-error"],"backgroundTag":"empty-required-field","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"}