{"record":{"id":"992b13dff5760078","repo":"dgraph-io/dgraph","slug":"couldn-t-find-a-server-in-group-d","errorCode":null,"errorMessage":"Couldn't find a server in group %d","messagePattern":"Couldn't find a server in group (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"worker/backup.go","lineNumber":215,"sourceCode":"\tdefer closer.Done()\n\n\tbp := NewBackupProcessor(pstore, req)\n\tdefer bp.Close()\n\n\treturn bp.WriteBackup(closer.Ctx())\n}\n\n// BackupGroup backs up the group specified in the backup request.\nfunc BackupGroup(ctx context.Context, in *pb.BackupRequest) (*pb.BackupResponse, error) {\n\tglog.V(2).Infof(\"Sending backup request: %+v\\n\", in)\n\tif groups().groupId() == in.GroupId {\n\t\treturn backupCurrentGroup(ctx, in)\n\t}\n\n\t// This node is not part of the requested group, send the request over the network.\n\tpl := groups().AnyServer(in.GroupId)\n\tif pl == nil {\n\t\treturn nil, errors.Errorf(\"Couldn't find a server in group %d\", in.GroupId)\n\t}\n\tres, err := pb.NewWorkerClient(pl.Get()).Backup(ctx, in)\n\tif err != nil {\n\t\tglog.Errorf(\"Backup error group %d: %s\", in.GroupId, err)\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}\n\n// backupLock is used to synchronize backups to avoid more than one backup request\n// to be processed at the same time. Multiple requests could lead to multiple\n// backups with the same backupNum in their manifest.\nvar backupLock sync.Mutex\n\n// BackupRes is used to represent the response and error of the Backup gRPC call together to be\n// transported via a channel.\ntype BackupRes struct {","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/worker/backup.go#L197-L233","documentation":"BackupGroup routes backup requests to the correct raft group. When the local node is not part of the requested group it looks up any server in that group via groups().AnyServer; if none is found, no node currently serves that group and the request fails with this error.","triggerScenarios":"Calling BackupGroup with in.GroupId set to a group that has no reachable members — the group was removed, all its servers are down/dead, or the GroupId is simply wrong (e.g. typo or group index out of range).","commonSituations":"Requesting backup for group 2 in a single-group cluster; servers of the target group crashed or were decommissioned; stale membership data in the client; cluster was resized and the group no longer exists.","solutions":["Verify the GroupId exists and has healthy members (check Zero / raft membership)","Correct the GroupId in the backup request configuration","Restore/replace the downed servers of that group before retrying the backup","Refresh cluster membership on the caller so AnyServer resolves current members"],"exampleFix":"// before\nreq := &pb.BackupRequest{GroupId: 2} // group may not exist\n// after\nif groups().AnyServer(2) == nil {\n    return errors.New(\"group 2 has no available servers; check cluster membership\")\n}\nreq := &pb.BackupRequest{GroupId: 2}","handlingStrategy":"validation","validationCode":"if groups().AnyServer(in.GroupId) == nil {\n    return errors.Errorf(\"group %d has no available server; check membership before backup\", in.GroupId)\n}","typeGuard":null,"tryCatchPattern":"resp, err := BackupGroup(ctx, in)\nif err != nil && strings.Contains(err.Error(), \"Couldn't find a server in group\") {\n    // refresh membership, verify group id, and surface to operator\n}","preventionTips":["Confirm the GroupId exists and has healthy members before requesting backups","Monitor raft group health and alert when a group loses all servers","Refresh membership state after cluster resizes/decommissions","Avoid hardcoding group ids in backup configs; derive them from cluster state"],"tags":["grpc","cluster","membership","backup"],"backgroundTag":"no-server-for-group","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}