{"record":{"id":"b585b65b10825a16","repo":"dgraph-io/dgraph","slug":"cannot-retrieve-predicate-information","errorCode":null,"errorMessage":"cannot retrieve predicate information","messagePattern":"cannot retrieve predicate information","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"worker/mutation.go","lineNumber":788,"sourceCode":"\t\t}\n\n\t\tfor _, field := range t.Fields {\n\t\t\tfieldName := field.Predicate\n\t\t\tns, attr := x.ParseNamespaceAttr(fieldName)\n\t\t\tif attr[0] == '~' {\n\t\t\t\tfieldName = x.NamespaceAttr(ns, attr[1:])\n\t\t\t}\n\n\t\t\tif _, ok := reqPredSet[fieldName]; !ok {\n\t\t\t\tfields = append(fields, fieldName)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Retrieve the schema for those predicates.\n\tschemas, err := GetSchemaOverNetwork(ctx, &pb.SchemaRequest{Predicates: fields})\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"cannot retrieve predicate information\")\n\t}\n\tschemaSet := make(map[string]struct{})\n\tfor _, schemaNode := range schemas {\n\t\tschemaSet[schemaNode.Predicate] = struct{}{}\n\t}\n\n\tfor _, t := range m.Types {\n\t\t// Verify all the fields in the type are already on the schema or come included in\n\t\t// this request.\n\t\tfor _, field := range t.Fields {\n\t\t\tfieldName := field.Predicate\n\t\t\tns, attr := x.ParseNamespaceAttr(fieldName)\n\t\t\tif attr[0] == '~' {\n\t\t\t\tfieldName = x.NamespaceAttr(ns, attr[1:])\n\t\t\t}\n\n\t\t\t_, inSchema := schemaSet[fieldName]\n\t\t\t_, inRequest := reqPredSet[fieldName]","sourceCodeStart":770,"sourceCodeEnd":806,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/worker/mutation.go#L770-L806","documentation":"After collecting all predicate names referenced by the type updates, verifyTypes fetches their current schema via GetSchemaOverNetwork. If that network call fails, the error is wrapped as 'cannot retrieve predicate information'. This is a wrapper around the underlying schema-fetch failure (network partition, Zero/Alpha unavailability, timeouts, or gRPC errors), so the root cause is in the wrapped error (err) included by Wrapf.","triggerScenarios":"verifyTypes is invoked from MutateOverNetwork with type updates; GetSchemaOverNetwork(ctx, &pb.SchemaRequest{Predicates: fields}) fails due to unreachable Zero, dropped gRPC connection, context deadline exceeded, or the node not being a leader / unable to serve the schema request.","commonSituations":"Zero or Alpha nodes down or restarting during a schema+mutation deployment; network partition between Alphas and Zero; firewall/security-group changes blocking the internal gRPC port; transient timeouts under load; misconfigured dgraph zero/alpha addresses.","solutions":["Inspect the wrapped cause in the error log (it follows 'cannot retrieve predicate information: ...') and fix that root issue (connectivity, Zero health, timeout)","Check cluster health: dgraph zero and alpha logs, /health endpoints, and that all alphas can reach Zero's internal port (5080)","Retry the mutation once the cluster is healthy — schema fetch failures are often transient","If timeouts are the cause, increase the client context deadline for the mutation request"],"exampleFix":"// before\nschemas, err := GetSchemaOverNetwork(ctx, req) // fails: zero unreachable\n\n// after (operator-side: ensure zero is reachable and healthy)\n# curl http://zero:6080/health\n# dgraph zero --my=zero:5080 --replicas 3\n# then retry the mutation","handlingStrategy":"retry","validationCode":"// Pre-check cluster reachability before large schema+mutation deployments\nfor _, addr := range []string{\"zero:6080\", \"alpha:8080\"} {\n\tresp, err := http.Get(fmt.Sprintf(\"http://%s/health\", addr))\n\tif err != nil || resp.StatusCode != 200 {\n\t\tlog.Fatalf(\"node %s unhealthy: %v\", addr, err)\n\t}\n}","typeGuard":null,"tryCatchPattern":"ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)\ndefer cancel()\n_, err := txn.Mutate(ctx, mu)\nif err != nil && strings.Contains(err.Error(), \"cannot retrieve predicate information\") {\n\t// transient: retry with backoff after checking Zero/Alpha health\n\terr = retry.Do(func() error { _, err := txn.Mutate(ctx, mu); return err })\n}","preventionTips":["Monitor Zero/Alpha health endpoints and alert on flapping nodes","Ensure internal ports (5080/7080) are open between Alphas and Zero","Use context deadlines with retry-with-backoff for schema-heavy mutations","Check the wrapped cause message first — this error is only a wrapper"],"tags":["network","schema","grpc","dgraph"],"backgroundTag":"schema-fetch-failed","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}