{"record":{"id":"60612dffe5b2bf41","repo":"dgraph-io/dgraph","slug":"the-alpha-that-served-that-task-is-not-available","errorCode":null,"errorMessage":"the Alpha that served that task is not available","messagePattern":"the Alpha that served that task is not available","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"worker/queue.go","lineNumber":56,"sourceCode":"\n\t// Skip the network call if the required Alpha is me.\n\tmyRaftId := State.WALstore.Uint(raftwal.RaftId)\n\tif raftId == myRaftId {\n\t\tworker := (*grpcWorker)(nil)\n\t\treturn worker.TaskStatus(ctx, req)\n\t}\n\n\t// Find the Alpha with the required Raft ID.\n\tvar addr string\n\tfor _, group := range groups().state.GetGroups() {\n\t\tfor _, member := range group.GetMembers() {\n\t\t\tif member.GetId() == raftId {\n\t\t\t\taddr = member.GetAddr()\n\t\t\t}\n\t\t}\n\t}\n\tif addr == \"\" {\n\t\treturn nil, fmt.Errorf(\"the Alpha that served that task is not available\")\n\t}\n\n\t// Send the request to the Alpha.\n\tpool, err := conn.GetPools().Get(addr)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to reach the Alpha that served that task\")\n\t}\n\tclient := pb.NewWorkerClient(pool.Get())\n\treturn client.TaskStatus(ctx, req)\n}\n\n// TaskStatus retrieves metadata for a given task ID.\nfunc (*grpcWorker) TaskStatus(ctx context.Context, req *pb.TaskStatusRequest,\n) (*pb.TaskStatusResponse, error) {\n\ttaskId := req.GetTaskId()\n\tmeta, err := Tasks.get(taskId)\n\tif err != nil {\n\t\treturn nil, err","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/worker/queue.go#L38-L74","documentation":"After extracting the Raft ID from the task ID, TaskStatusOverNetwork looks through the cluster membership for the Alpha whose Raft member ID matches; if none matches (addr stays empty), it concludes the Alpha that served the task is gone and returns this error. The task's status cannot be fetched because the owning server is no longer part of the group.","triggerScenarios":"Querying the status of a task whose task ID encodes a raftId (taskId >> 32) that is not present in the current membership list — e.g. the Alpha that ran the task was removed, replaced, or its Raft ID changed.","commonSituations":"Cluster was resized/re-provisioned after the task started; an Alpha was permanently removed and re-added (new Raft ID); querying an old task ID against a brand-new cluster; ZooKeeper/membership data stale in older Dgraph deployments.","solutions":["Poll each remaining Alpha directly or check logs on the removed Alpha to learn the task's outcome","Re-run the backup/export operation if the originating Alpha is unrecoverable","Restore cluster membership consistency and verify all Alphas are registered, then retry","Treat the task ID as stale and obtain a fresh task ID from a new mutation"],"exampleFix":"// before\nmeta, err := worker.TaskStatusOverNetwork(ctx, req)\n// after\nmeta, err := worker.TaskStatusOverNetwork(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"not available\") {\n    // originating Alpha left the cluster; re-run the task\n    id, err := queue.Enqueue(newReq)\n}","handlingStrategy":"fallback","validationCode":"// Check the target raftId exists in membership before querying\nraftId := req.GetTaskId() >> 32\nif !membershipContains(raftId) {\n    return fmt.Errorf(\"originating alpha (raft %d) no longer in cluster\", raftId)\n}","typeGuard":"func originAlphaAvailable(taskID uint64, members []Member) bool {\n    raftID := taskID >> 32\n    for _, m := range members {\n        if m.GetId() == raftID { return true }\n    }\n    return false\n}","tryCatchPattern":"meta, err := worker.TaskStatusOverNetwork(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"not available\") {\n    meta = nil // fall back to re-running the task or checking logs\n}","preventionTips":["Persist task outcomes durably if you must survive cluster re-provisioning","Avoid querying task IDs older than the last cluster membership change","Keep cluster membership stable across task lifetimes"],"tags":["cluster","membership","distributed-systems","dgraph"],"backgroundTag":"node-unavailable","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}