{"record":{"id":"aaffb4da07f502a6","repo":"dgraph-io/dgraph","slug":"the-server-doesn-t-serve-group-id-v","errorCode":null,"errorMessage":"The server doesn't serve group id: %v","messagePattern":"The server doesn't serve group id: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"worker/multi_tenancy.go","lineNumber":24,"sourceCode":"package worker\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/golang/glog\"\n\t\"github.com/pkg/errors\"\n\t\"golang.org/x/sync/errgroup\"\n\n\t\"github.com/dgraph-io/dgraph/v25/conn\"\n\t\"github.com/dgraph-io/dgraph/v25/protos/pb\"\n\t\"github.com/dgraph-io/dgraph/v25/x\"\n)\n\nfunc (w *grpcWorker) DeleteNamespace(ctx context.Context, req *pb.DeleteNsRequest) (*pb.Status, error) {\n\tvar emptyRes pb.Status\n\tif !groups().ServesGroup(req.GroupId) {\n\t\treturn &emptyRes, errors.Errorf(\"The server doesn't serve group id: %v\", req.GroupId)\n\t}\n\n\tif err := groups().Node.proposeAndWait(ctx, &pb.Proposal{DeleteNs: req}); err != nil {\n\t\treturn &emptyRes, errors.Wrapf(err, \"Delete namespace failed for namespace %d on group %d\",\n\t\t\treq.Namespace, req.GroupId)\n\t}\n\treturn &emptyRes, nil\n}\n\nfunc ProcessDeleteNsRequest(ctx context.Context, ns uint64) error {\n\t// Update the membership state to get the latest mapping of groups to predicates.\n\tif err := UpdateMembershipState(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Failed to update membership state while deleting namesapce\")\n\t}\n\n\tstate := GetMembershipState()\n\tg := new(errgroup.Group)\n","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/worker/multi_tenancy.go#L6-L42","documentation":"DeleteNamespace first checks that this Alpha actually serves the group named in the request (groups().ServesGroup). If not, it refuses to propose the namespace deletion and returns this error — the request must be routed to an Alpha in the group that owns the data.","triggerScenarios":"Calling Worker.DeleteNamespace (e.g. via dgraph namespace delete -a <alpha>) with a groupId this Alpha does not serve — the target namespace's tablets belong to a different group.","commonSituations":"Pointing the client at the wrong Alpha in a multi-group cluster; stale cluster topology assumptions after moves/rebalance; hardcoded group id in scripts; namespace moved to another group after a previous operation.","solutions":["Send the delete request to an Alpha that serves the target group (check /state or the membership state to map group id to Alphas).","Verify the correct groupId for the namespace — namespace 0 (guardians) and tablet placement determine the owning group.","Re-run with the correct --alpha address of a node in the owning group.","Refresh stale client tooling/scripts that assume a fixed group id."],"exampleFix":"// before\ndgraph namespace del -x 2 -a \"alpha-in-group-1:9080\"\n// after: target an alpha that serves group 2\ndgraph namespace del -x 2 -a \"alpha-in-group-2:9080\"","handlingStrategy":"validation","validationCode":"// resolve the group serving the namespace, pick an alpha from that group\nstate := getClusterState(zeroHTTPAddr)\nalpha := pickAlphaForGroup(state, targetGroupId)\nif alpha == \"\" { return errors.New(\"no alpha serves this group\") }","typeGuard":null,"tryCatchPattern":"_, err := wc.DeleteNamespace(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"doesn't serve group id\") {\n    // re-target the request at an alpha in the owning group\n}","preventionTips":["Check /state on Zero to map group ids to alpha addresses before multi-tenancy ops","Point namespace operations at an alpha in the group that owns the namespace's tablets","Avoid hardcoding group ids or alpha addresses in automation scripts"],"tags":["routing","multi-tenancy","grpc","cluster"],"backgroundTag":"wrong-alpha-routing","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}