dgraph-io/dgraph · error
Tablet predicate is empty in %+v
Error message
Tablet predicate is empty in %+v
What it means
Zero's ShouldServe RPC validates an incoming Tablet request and requires a non-empty Predicate (the key/edge being served). An empty predicate means the request is malformed — Zero cannot look up or assign ownership without it — so it errors immediately before any tablet lookup.
Source
Thrown at dgraph/cmd/zero/zero.go:690
Member: m,
}
return resp, nil
}
// DeleteNamespace removes the tablets for deleted namespace from the membership state.
func (s *Server) DeleteNamespace(ctx context.Context, in *pb.DeleteNsRequest) (*pb.Status, error) {
err := s.Node.proposeAndWait(ctx, &pb.ZeroProposal{DeleteNs: in})
return &pb.Status{}, err
}
// ShouldServe returns the tablet serving the predicate passed in the request.
func (s *Server) ShouldServe(
ctx context.Context, tablet *pb.Tablet) (resp *pb.Tablet, err error) {
ctx, span := otel.Tracer("").Start(ctx, "Zero.ShouldServe")
defer span.End()
if tablet.Predicate == "" {
return resp, errors.Errorf("Tablet predicate is empty in %+v", tablet)
}
if tablet.GroupId == 0 && !tablet.ReadOnly {
return resp, errors.Errorf("Group ID is Zero in %+v", tablet)
}
// Check who is serving this tablet.
tab := s.ServingTablet(tablet.Predicate)
span.SetAttributes(attribute.String("tablet_predicate", tablet.Predicate))
if tab != nil && !tablet.Force {
// Someone is serving this tablet. Could be the caller as well.
// The caller should compare the returned group against the group it holds to check who's
// serving.
return tab, nil
}
// Read-only requests should return an empty tablet instead of asking zero
// to serve the predicate.
if tablet.ReadOnly {View on GitHub (pinned to 759e242be6)
Solutions
- Fix the caller so the Tablet message includes the predicate (the edge/UID key) before invoking ShouldServe.
- Upgrade alpha and Zero to matching versions to eliminate protocol skew.
- Check client code that constructs pb.Tablet for default/zero-value strings.
- If it recurs unexpectedly, capture the gRPC request (the error prints the Tablet via %+v) and inspect the calling component.
Example fix
// before
tablet, err := zero.ShouldServe(ctx, &pb.Tablet{GroupId: 1})
// after
tablet, err := zero.ShouldServe(ctx, &pb.Tablet{GroupId: 1, Predicate: "http://ex.com/friend"}) Defensive patterns
Strategy: validation
Validate before calling
if tablet.Predicate == "" {
return fmt.Errorf("cannot call ShouldServe with an empty predicate")
} Try / catch
resp, err := zero.ShouldServe(ctx, tablet)
if err != nil && strings.Contains(err.Error(), "predicate is empty") {
return fmt.Errorf("caller built an invalid Tablet message: %w", err)
} Prevention
- Validate pb.Tablet fields (non-empty Predicate) before every ShouldServe call.
- Keep alpha and Zero on compatible versions to avoid dropped fields.
- Add unit tests covering Tablet message construction.
When it happens
Trigger: Calling ShouldServe (used by alphas during tablet/oracle checks) with pb.Tablet{Predicate: ""}; buggy or misconfigured internal callers sending uninitialized Tablet structs.
Common situations: Version-skew between alpha and Zero where a field was dropped; hand-rolled clients/tests constructing Tablet messages incorrectly; corrupted internal state producing empty predicate strings.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Tablets are empty in %+v
- connection string cannot be empty
- Group ID is Zero in %+v
- Context has error: %v
- NO_ADDR: No address provided: %+v
AI-assisted analysis of dgraph-io/dgraph@759e242be6 (2026-09-01).
Data as JSON: /api/errors/685e27a9fda5a3a0.
Report an issue: GitHub.