{"record":{"id":"e63db9df8f5925a7","repo":"dgraph-io/dgraph","slug":"this-server-doesn-t-serve-group-id-v-e63db9","errorCode":null,"errorMessage":"This server doesn't serve group id: %v","messagePattern":"This server doesn't serve group id: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"worker/schema.go","lineNumber":232,"sourceCode":"\t\t\t\treturn nil, r.err\n\t\t\t}\n\t\t\tschemaNodes = append(schemaNodes, r.result.Schema...)\n\t\tcase <-ctx.Done():\n\t\t\treturn nil, ctx.Err()\n\t\t}\n\t}\n\n\treturn schemaNodes, nil\n}\n\n// Schema is used to get schema information over the network on other instances.\nfunc (w *grpcWorker) Schema(ctx context.Context, s *pb.SchemaRequest) (*pb.SchemaResult, error) {\n\tif ctx.Err() != nil {\n\t\treturn &emptySchemaResult, ctx.Err()\n\t}\n\n\tif !groups().ServesGroup(s.GroupId) {\n\t\treturn &emptySchemaResult, errors.Errorf(\"This server doesn't serve group id: %v\", s.GroupId)\n\t}\n\treturn getSchema(ctx, s)\n}\n\n// GetTypes processes the type requests and retrieves the desired types.\nfunc GetTypes(ctx context.Context, req *pb.SchemaRequest) ([]*pb.TypeUpdate, error) {\n\tif len(req.Types) == 0 && len(req.Predicates) > 0 {\n\t\treturn nil, nil\n\t}\n\n\tvar typeNames []string\n\tvar out []*pb.TypeUpdate\n\n\tif len(req.Types) == 0 {\n\t\ttypeNames = schema.State().Types()\n\t} else {\n\t\ttypeNames = req.Types\n\t}","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/worker/schema.go#L214-L250","documentation":"The internal gRPC Schema worker endpoint checks whether this server (Alpha) serves the requested group via groups().ServesGroup. If not, it rejects the request because schema is served only by the group's leader/member.","triggerScenarios":"A client (or another Alpha, e.g. via GraphQL 'getSchema' fan-out) sends pb.SchemaRequest with a GroupId that this Alpha does not belong to, typically after a zero reassignment or stale membership view.","commonSituations":"Stale client/cluster state after tablet moves; querying an Alpha that was removed from the group; race during Zero rebalancing; pointing a request at the wrong Alpha.","solutions":["Retry against the Alpha that currently serves the group (check Zero's state via /state endpoint)","Refresh membership: wait for the tablet move to complete after `moveTablet`","Verify the group ID in the request matches a group served by this server","Restart/rejoin the Alpha if its membership view is stale"],"exampleFix":"// before\nres, err := grpcWorker.Schema(ctx, &pb.SchemaRequest{GroupId: 1})\n// after\nif !servesGroup(1) {\n    // route request to correct alpha or refresh membership from zero\n}\nres, err := grpcWorker.Schema(ctx, &pb.SchemaRequest{GroupId: 1})","handlingStrategy":"retry","validationCode":"// check membership before calling\nif !alphaServesGroup(alphaAddr, groupID) { alphaAddr = routeToGroupOwner(groupID) }","typeGuard":null,"tryCatchPattern":"res, err := Schema(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"doesn't serve group\") {\n    // refresh membership from zero and retry on the right alpha\n    time.Sleep(200 * time.Millisecond)\n    res, err = Schema(ctx, reqWithRoutedGroup(req))\n}","preventionTips":["Check Zero's /state endpoint to route schema requests to the group's serving Alpha","Add retry-with-backoff for schema calls during tablet moves","Avoid pinning requests to specific Alpha addresses; use discovery"],"tags":["grpc","schema","group","membership"],"backgroundTag":"wrong-server-for-group","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}