{"record":{"id":"2421451db2834ad0","repo":"dgraph-io/dgraph","slug":"tablets-are-empty-in-v","errorCode":null,"errorMessage":"Tablets are empty in %+v","messagePattern":"Tablets are empty in %\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"dgraph/cmd/zero/zero.go","lineNumber":415,"sourceCode":"\t\ts := float64(srcTablet.OnDiskBytes)\n\t\td := float64(dstTablet.OnDiskBytes)\n\t\tif dstTablet.Remove || (s == 0 && d > 0) || (s > 0 && math.Abs(d/s-1) > 0.1) {\n\t\t\tdstTablet.Force = false\n\t\t\ttablets = append(tablets, dstTablet)\n\t\t}\n\t}\n\n\tif len(tablets) > 0 {\n\t\tres = append(res, &pb.ZeroProposal{Tablets: tablets})\n\t}\n\treturn res, nil\n}\n\nfunc (s *Server) Inform(ctx context.Context, req *pb.TabletRequest) (*pb.TabletResponse, error) {\n\tctx, span := otel.Tracer(\"\").Start(ctx, \"Zero.Inform\")\n\tdefer span.End()\n\tif req == nil || len(req.Tablets) == 0 {\n\t\treturn nil, errors.Errorf(\"Tablets are empty in %+v\", req)\n\t}\n\n\tif req.GroupId == 0 {\n\t\treturn nil, errors.Errorf(\"Group ID is Zero in %+v\", req)\n\t}\n\n\ttablets := make([]*pb.Tablet, 0)\n\tunknownTablets := make([]*pb.Tablet, 0)\n\tfor _, t := range req.Tablets {\n\t\ttab := s.ServingTablet(t.Predicate)\n\t\tspan.SetAttributes(attribute.String(\"tablet_predicate\", t.Predicate))\n\t\tswitch {\n\t\tcase tab != nil && !t.Force:\n\t\t\ttablets = append(tablets, t)\n\t\tcase t.ReadOnly:\n\t\t\ttablets = append(tablets, &pb.Tablet{})\n\t\tdefault:\n\t\t\tunknownTablets = append(unknownTablets, t)","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/dgraph/cmd/zero/zero.go#L397-L433","documentation":"Zero.Inform is the gRPC endpoint Alphas call to report which tablets they serve. If the request is nil or carries no tablets, Zero rejects it because there is nothing to record — a report must contain at least one tablet.","triggerScenarios":"An Alpha calls Inform with an empty Tablets slice or a nil TabletRequest, e.g., during startup before any predicate is assigned, or a client calling the gRPC API directly with an empty request.","commonSituations":"Empty Alpha starting with no data directory sending an empty tablet report; custom scripts invoking Inform with a hand-built TabletRequest missing Tablets; a bug in Alpha-side tablet collection.","solutions":["Ensure the Alpha has data/predicates to report; an empty Alpha should not call Inform until it serves a tablet.","If calling the gRPC API directly, populate req.Tablets with at least one pb.Tablet and set GroupId.","Wait for the normal Alpha mutation/leader flow to populate tablets before expecting Inform to succeed.","Check Alpha logs for a bug that empties the tablet list before reporting."],"exampleFix":"// before\nzeroClient.Inform(ctx, &pb.TabletRequest{GroupId: 1})\n// after\nif len(tablets) == 0 {\n    return nil // nothing to report\n}\nzeroClient.Inform(ctx, &pb.TabletRequest{GroupId: 1, Tablets: tablets})","handlingStrategy":"validation","validationCode":"if req == nil || len(req.Tablets) == 0 {\n    return errors.New(\"nothing to report: tablets list is empty\")\n}","typeGuard":"func isReportable(req *pb.TabletRequest) bool {\n    return req != nil && len(req.Tablets) > 0\n}","tryCatchPattern":"resp, err := zeroClient.Inform(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"Tablets are empty\") {\n    log.Debug(\"skipping empty tablet report\")\n    return nil\n}","preventionTips":["Skip Inform calls when the Alpha serves no tablets.","Build TabletRequest from the actual serving-tablet set, never literals.","Assert req.Tablets non-empty in tests exercising Inform.","Check Alpha tablet collection logic if empty reports recur."],"tags":["zero","grpc","validation","tablet"],"backgroundTag":"empty-request-rejected","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}