{"record":{"id":"55bbbace1d683e3b","repo":"dgraph-io/dgraph","slug":"unable-to-find-group","errorCode":null,"errorMessage":"Unable to find group","messagePattern":"Unable to find group","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"dgraph/cmd/zero/zero.go","lineNumber":802,"sourceCode":"\t}()\n\n\tif err := s.deletePredicates(ctx, group); err != nil {\n\t\tglog.Warningf(\"While deleting predicates: %v\", err)\n\t}\n\treturn &api.Payload{Data: []byte(\"OK\")}, nil\n}\n\nfunc (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 {","sourceCodeStart":784,"sourceCodeEnd":820,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/dgraph/cmd/zero/zero.go#L784-L820","documentation":"deletePredicates (invoked from UpdateMembership when a group's tablets must be purged) tries to determine the group ID by taking the GroupId of the first tablet in the group. If the group has no tablets (or the first tablet has GroupId 0), it cannot determine which group's leader to notify and returns this un-parameterized error.","triggerScenarios":"UpdateMembership processing a group whose Tablets slice is empty or whose tablets carry GroupId 0, triggering the deletePredicates cleanup path; e.g., a group was already drained but a deletion request still arrives.","commonSituations":"Race between tablet movement and predicate deletion during rebalancing; dropping a predicate concurrently with the last tablet being moved; replayed/late membership updates after a group was emptied.","solutions":["Retry/let the next UpdateMembership cycle run; this is usually a transient race while tablets are in flight.","Verify with Zero's /state that the target group still has tablets; if not, the deletion already completed and no action is needed.","Check for ping-ponging MoveTablet operations between groups and stabilize rebalancing.","If persistent, inspect Zero logs around UpdateMembership and report/patch the deletePredicates gid-derivation logic (use the group key instead of the first tablet)."],"exampleFix":"// before (derives gid from first tablet)\ngid = tablet.GroupId\nif gid == 0 { return errors.Errorf(\"Unable to find group\") }\n\n// after (pass gid explicitly)\nfunc (s *Server) deletePredicates(ctx context.Context, gid uint32, pred string) error {\n    if gid == 0 { return errors.Errorf(\"Unable to find group\") }","handlingStrategy":"retry","validationCode":"state := fetchZeroState(\"http://zero:6080/state\")\nif g, ok := state.Groups[gid]; !ok || len(g.Tablets) == 0 {\n    return fmt.Errorf(\"group %d has no tablets; predicate deletion is a no-op race\", gid)\n}","typeGuard":null,"tryCatchPattern":"err := deletePredicates(ctx, group)\nif err != nil && strings.Contains(err.Error(), \"Unable to find group\") {\n    // transient race during rebalance: re-run after membership settles\n    return retryAfter(ctx, 5*time.Second)\n}","preventionTips":["Don't run MoveTablet rebalancing and predicate deletion concurrently.","Verify group tablet counts via /state before deletion operations.","Retry membership-sensitive operations instead of failing hard."],"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"}