{"record":{"id":"852a6c673d34a72f","repo":"dgraph-io/dgraph","slug":"unable-to-find-group-d","errorCode":null,"errorMessage":"Unable to find group: %d","messagePattern":"Unable to find group: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"dgraph/cmd/zero/zero.go","lineNumber":810,"sourceCode":"func (s *Server) deletePredicates(ctx context.Context, group *pb.Group) error {\n\tif group == nil || group.Tablets == nil {\n\t\treturn nil\n\t}\n\tvar gid uint32\n\tfor _, tablet := range group.Tablets {\n\t\tgid = tablet.GroupId\n\t\tbreak\n\t}\n\tif gid == 0 {\n\t\treturn errors.Errorf(\"Unable to find group\")\n\t}\n\tstate, err := s.latestMembershipState(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tsg, ok := state.Groups[gid]\n\tif !ok {\n\t\treturn errors.Errorf(\"Unable to find group: %d\", gid)\n\t}\n\n\tpl := s.Leader(gid)\n\tif pl == nil {\n\t\treturn errors.Errorf(\"Unable to reach leader of group: %d\", gid)\n\t}\n\twc := pb.NewWorkerClient(pl.Get())\n\n\tfor pred := range group.Tablets {\n\t\tif _, found := sg.Tablets[pred]; found {\n\t\t\tcontinue\n\t\t}\n\t\tglog.Infof(\"Tablet: %v does not belong to group: %d. Sending delete instruction.\",\n\t\t\tpred, gid)\n\t\tin := &pb.MovePredicatePayload{\n\t\t\tPredicate: pred,\n\t\t\tSourceGid: gid,\n\t\t\tDestGid:   0,","sourceCodeStart":792,"sourceCodeEnd":828,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/dgraph/cmd/zero/zero.go#L792-L828","documentation":"After determining a group ID, deletePredicates fetches the latest membership state and looks up state.Groups[gid]. If the group no longer exists in Zero's membership state, the deletion cannot proceed and this formatted error is returned. It typically means the group disappeared between deriving the gid and the lookup — a membership race.","triggerScenarios":"UpdateMembership -> deletePredicates with a gid present on a tablet but absent from the freshly fetched ms.Groups (group removed/re-formed concurrently); stale tablet entries referencing decommissioned groups.","commonSituations":"Removing nodes/groups while predicate deletion is in flight; cluster rebalance moving the last tablets out of a group; restarting Zero with a fresh membership while old tablet assignments linger.","solutions":["Re-run the deletion once membership stabilizes; the group is gone so predicates for it likely need no cleanup.","Confirm the group's absence via Zero's /state endpoint; if the group should exist, check Zero logs for membership churn.","Avoid removing nodes/groups concurrently with tablet/predicate deletions.","If stale tablets persistently reference dead groups, prune the stale tablet entries or restart the cluster to rebuild membership."],"exampleFix":"// before\nsg, ok := state.Groups[gid]\nif !ok { return errors.Errorf(\"Unable to find group: %d\", gid) }\n\n// after (tolerate already-deleted groups)\nsg, ok := state.Groups[gid]\nif !ok {\n    glog.Warningf(\"Group %d no longer exists; skipping predicate deletion\", gid)\n    return nil\n}","handlingStrategy":"fallback","validationCode":"state := fetchZeroState(\"http://zero:6080/state\")\nif _, ok := state.Groups[gid]; !ok {\n    return fmt.Errorf(\"group %d already gone; skip predicate cleanup\", gid)\n}","typeGuard":null,"tryCatchPattern":"err := deletePredicates(ctx, group)\nif err != nil && strings.Contains(err.Error(), \"Unable to find group:\") {\n    glog.Warningf(\"group vanished mid-deletion (%v); treating as done\", err)\n    return nil\n}","preventionTips":["Serialize node/group removal with predicate deletion operations.","Confirm target group existence in /state before cleanup.","Treat vanished-group errors as benign completion in cleanup tooling."],"tags":["dgraph-zero","membership","race-condition","tablets"],"backgroundTag":"group-not-found","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}