{"record":{"id":"c294e5e0bdc91bfe","repo":"dgraph-io/dgraph","slug":"no-group-with-groupid-d-found","errorCode":null,"errorMessage":"No group with groupId %d found","messagePattern":"No group with groupId (.+?) found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dgraph/cmd/zero/zero.go","lineNumber":486,"sourceCode":"\t\ttablets = append(tablets, tab)\n\t}\n\n\treturn &pb.TabletResponse{\n\t\tTablets: tablets,\n\t}, nil\n}\n\n// RemoveNode removes the given node from the given group.\n// It's the user's responsibility to ensure that node doesn't come back again\n// before calling the api.\nfunc (s *Server) RemoveNode(ctx context.Context, req *pb.RemoveNodeRequest) (*pb.Status, error) {\n\tif req.GroupId == 0 {\n\t\treturn nil, s.Node.ProposePeerRemoval(ctx, req.NodeId)\n\t}\n\tzp := &pb.ZeroProposal{}\n\tzp.Member = &pb.Member{Id: req.NodeId, GroupId: req.GroupId, AmDead: true}\n\tif _, ok := s.state.Groups[req.GroupId]; !ok {\n\t\treturn nil, errors.Errorf(\"No group with groupId %d found\", req.GroupId)\n\t}\n\tif _, ok := s.state.Groups[req.GroupId].Members[req.NodeId]; !ok {\n\t\treturn nil, errors.Errorf(\"No node with nodeId %d found in group %d\", req.NodeId,\n\t\t\treq.GroupId)\n\t}\n\tif len(s.state.Groups[req.GroupId].Members) == 1 && len(s.state.Groups[req.GroupId].\n\t\tTablets) > 0 {\n\t\treturn nil, errors.Errorf(\"Move all tablets from group %d before removing the last node\",\n\t\t\treq.GroupId)\n\t}\n\tif err := s.Node.proposeAndWait(ctx, zp); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &pb.Status{}, nil\n}\n\n// Connect is used by Alpha nodes to connect the very first time with group zero.","sourceCodeStart":468,"sourceCodeEnd":504,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/dgraph/cmd/zero/zero.go#L468-L504","documentation":"RemoveNode validates that the group id supplied in the request exists in Zero's current cluster state before proposing the node's removal. If s.state.Groups has no entry for req.GroupId, the removal is aborted with this error.","triggerScenarios":"Calling /removeNode (or RemoveNode via TestRemoveNode) with a GroupId that doesn't exist — typo'd group id, a group already removed, or group id taken from stale /state output.","commonSituations":"Operator removing a dead Alpha using an outdated cluster listing; group numbers shifted after a cluster rebuild; running removeNode against a freshly restarted Zero with restored/older state.","solutions":["Fetch the current cluster state (curl localhost:6080/state) and use an existing GroupId that actually contains the node.","If the whole group is gone, no removal is needed — skip the call or remove via ProposePeerRemoval (omit GroupId so req.GroupId==0 path handles the node globally).","Re-check the node id/group mapping with dgraph zero tools before re-running the command.","Refresh Zero state / restart Zero so its membership reflects reality, then retry."],"exampleFix":"// before\nremoveNode(zeroAddr, nodeID, 7) // group 7 no longer exists\n// after\nstate := fetchZeroState(zeroAddr)\ngroup := findGroupContainingNode(state, nodeID)\nif group == 0 {\n    removeNode(zeroAddr, nodeID, 0) // peer removal path\n} else {\n    removeNode(zeroAddr, nodeID, group)\n}","handlingStrategy":"validation","validationCode":"state := fetchZeroState(zeroAddr)\nif _, ok := state.Groups[groupId]; !ok {\n    return fmt.Errorf(\"group %d does not exist; refresh state before removing node\", groupId)\n}","typeGuard":"func groupExists(state *pb.ClusterState, gid uint64) bool {\n    _, ok := state.Groups[gid]\n    return ok\n}","tryCatchPattern":"resp, err := zero.RemoveNode(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"No group with groupId\") {\n    state := fetchZeroState(zeroAddr)\n    req.GroupId = lookupGroupForNode(state, req.NodeId)\n    resp, err = zero.RemoveNode(ctx, req)\n}","preventionTips":["Always pull /state immediately before removeNode to get fresh group ids.","Script removals from parsed /state output, not hard-coded ids.","Re-check after cluster rebuilds or restores since group numbering can change.","Use the GroupId==0 peer-removal path when only the node id is known."],"tags":["zero","remove-node","cluster-administration","validation"],"backgroundTag":"unknown-group-id","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}