{"record":{"id":"51614ad7722e2140","repo":"dgraph-io/dgraph","slug":"unknown-group-for-member-v","errorCode":null,"errorMessage":"Unknown group for member: %+v","messagePattern":"Unknown group for member: %\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dgraph/cmd/zero/zero.go","lineNumber":360,"sourceCode":"\t\t\treturn tab\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (s *Server) createProposals(dst *pb.Group) ([]*pb.ZeroProposal, error) {\n\tvar res []*pb.ZeroProposal\n\tif len(dst.Members) > 1 {\n\t\treturn res, errors.Errorf(\"Create Proposal: Invalid group: %+v\", dst)\n\t}\n\n\ts.RLock()\n\tdefer s.RUnlock()\n\t// There is only one member. We use for loop because we don't know what the mid is.\n\tfor mid, dstMember := range dst.Members {\n\t\tgroup, has := s.state.Groups[dstMember.GroupId]\n\t\tif !has {\n\t\t\treturn res, errors.Errorf(\"Unknown group for member: %+v\", dstMember)\n\t\t}\n\t\tsrcMember, has := group.Members[mid]\n\t\tif !has {\n\t\t\treturn res, errors.Errorf(\"Unknown member: %+v\", dstMember)\n\t\t}\n\t\tif srcMember.Addr != dstMember.Addr ||\n\t\t\tsrcMember.Leader != dstMember.Leader {\n\n\t\t\tproposal := &pb.ZeroProposal{\n\t\t\t\tMember: dstMember,\n\t\t\t}\n\t\t\tres = append(res, proposal)\n\t\t}\n\t\tif !dstMember.Leader {\n\t\t\t// Don't continue to tablets if request is not from the leader.\n\t\t\treturn res, nil\n\t\t}\n\t\tif dst.SnapshotTs > group.SnapshotTs {","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/dgraph/cmd/zero/zero.go#L342-L378","documentation":"createProposals checks that each member in the incoming state belongs to a group Zero currently knows about. If dstMember.GroupId has no entry in s.state.Groups, the member is referencing an unknown/stale group and the update is rejected.","triggerScenarios":"An Alpha sends a membership update whose GroupId no longer exists in Zero's state — e.g., after the group was removed or Zero's state was reset while the Alpha still believes it belongs to that group.","commonSituations":"Zero's raft state wiped/restored from an older snapshot while Alphas keep old group IDs; leftover Alpha data directory reused after a cluster rebuild; group was removed via removeNode and the Alpha hasn't re-registered.","solutions":["Delete the stale Alpha's postings/writedirectory state or point it at the current cluster so it re-registers with a valid group.","Check /state on Zero for current group IDs and compare with the Alpha's reported group.","Restart Zero and ensure its raft state is the authoritative, most recent one (don't mix old p/ and zero directories).","Rebuild the cluster membership cleanly if group IDs diverged (backup, wipe, rejoin)."],"exampleFix":"// before\nalpha.StartWithStaleGroupDir(oldZeroDir)\n// after\nalpha.CleanStaleMembershipState() // or start with an empty p dir to rejoin\ngroups := fetchZeroState(\"http://zero:6080/state\")\nif !groupExists(groups, alpha.GroupId) { alpha.ResetGroupId() }\nalpha.Start()","handlingStrategy":"validation","validationCode":"state, _ := http.Get(\"http://zero:6080/state\")\nif !state.Groups[alpha.GroupId].exists {\n    alpha.ResetMembership(); alpha.Restart()\n}","typeGuard":"func groupKnown(groups map[uint64]*pb.Group, id uint64) bool {\n    _, ok := groups[id]\n    return ok\n}","tryCatchPattern":"_, err := zero.UpdateMembership(ctx, state)\nif err != nil && strings.Contains(err.Error(), \"Unknown group for member\") {\n    // stale membership: re-register Alpha\n    alpha.DeregisterAndRejoin(ctx)\n}","preventionTips":["Never reuse an old Zero raft/watermark directory with freshly built Alpha data.","Compare Alpha group ids against /state after any restore or rebuild.","Remove orphaned Alpha data dirs when rebuilding a cluster.","Keep zero and p directories from the same cluster generation together."],"tags":["zero","membership","stale-state","cluster-administration"],"backgroundTag":"unknown-group-id","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}