dgraph-io/dgraph · warning

Unable to find group: %d

Error message

Unable to find group: %d

What it means

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.

Source

Thrown at dgraph/cmd/zero/zero.go:810

func (s *Server) deletePredicates(ctx context.Context, group *pb.Group) error {
	if group == nil || group.Tablets == nil {
		return nil
	}
	var gid uint32
	for _, tablet := range group.Tablets {
		gid = tablet.GroupId
		break
	}
	if gid == 0 {
		return errors.Errorf("Unable to find group")
	}
	state, err := s.latestMembershipState(ctx)
	if err != nil {
		return err
	}
	sg, ok := state.Groups[gid]
	if !ok {
		return errors.Errorf("Unable to find group: %d", gid)
	}

	pl := s.Leader(gid)
	if pl == nil {
		return errors.Errorf("Unable to reach leader of group: %d", gid)
	}
	wc := pb.NewWorkerClient(pl.Get())

	for pred := range group.Tablets {
		if _, found := sg.Tablets[pred]; found {
			continue
		}
		glog.Infof("Tablet: %v does not belong to group: %d. Sending delete instruction.",
			pred, gid)
		in := &pb.MovePredicatePayload{
			Predicate: pred,
			SourceGid: gid,
			DestGid:   0,

View on GitHub (pinned to 759e242be6)

Solutions

  1. Re-run the deletion once membership stabilizes; the group is gone so predicates for it likely need no cleanup.
  2. Confirm the group's absence via Zero's /state endpoint; if the group should exist, check Zero logs for membership churn.
  3. Avoid removing nodes/groups concurrently with tablet/predicate deletions.
  4. If stale tablets persistently reference dead groups, prune the stale tablet entries or restart the cluster to rebuild membership.

Example fix

// before
sg, ok := state.Groups[gid]
if !ok { return errors.Errorf("Unable to find group: %d", gid) }

// after (tolerate already-deleted groups)
sg, ok := state.Groups[gid]
if !ok {
    glog.Warningf("Group %d no longer exists; skipping predicate deletion", gid)
    return nil
}
Defensive patterns

Strategy: fallback

Validate before calling

state := fetchZeroState("http://zero:6080/state")
if _, ok := state.Groups[gid]; !ok {
    return fmt.Errorf("group %d already gone; skip predicate cleanup", gid)
}

Try / catch

err := deletePredicates(ctx, group)
if err != nil && strings.Contains(err.Error(), "Unable to find group:") {
    glog.Warningf("group vanished mid-deletion (%v); treating as done", err)
    return nil
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of dgraph-io/dgraph@759e242be6 (2026-09-01). Data as JSON: /api/errors/852a6c673d34a72f. Report an issue: GitHub.