dgraph-io/dgraph · error

while parsing predicate got

Error message

while parsing predicate got: %q

What it means

upgradeManifest migrates a manifest written by an older Dgraph version (case 2103, i.e. v21.03) to the current schema. ACL predicate strings in m.Groups must be converted via x.AttrFrom2103; this error is thrown when a predicate stored in the 21.03 format cannot be parsed/converted.

Solutions

  1. Inspect the manifest's Groups predicates and fix or remove malformed entries.
  2. Upgrade through intermediate Dgraph versions so manifests are converted stepwise.
  3. Take a fresh backup with the new version instead of reusing the old manifest.
  4. Restore ACL data and re-export a backup with the current version.

Example fix

// before: hand-edited predicate in manifest
"Groups": {"1": ["dgraph.x.unknown"]}
// after: use predicates created by the 21.03 format or regenerate via backup
dgraph backup --dst s3://bucket/new-backup
Defensive patterns

Strategy: validation

Validate before calling

if m.Version == 2103 {
    for gid, preds := range m.Groups {
        for _, p := range preds {
            if _, err := x.AttrFrom2103(p); err != nil {
                return fmt.Errorf("group %s has unparsable predicate %q: %v", gid, p, err)
            }
        }
    }
}

Prevention

When it happens

Trigger: GetManifest loads a manifest whose version field is 2103 and a group's ACL predicate string cannot be converted by AttrFrom2103 — e.g. manifest written by an even older version, hand-edited predicate, or corrupt ACL data in the manifest.

Common situations: Upgrading a cluster across several versions (e.g. v20.x -> v23.x) skipping intermediate supported upgrade paths; manually edited manifests; ACL rules created under an incompatible format.

Related errors


AI-assisted analysis of dgraph-io/dgraph@759e242be6 (2026-09-01). Data as JSON: /api/errors/5965100c0a2d705b. Report an issue: GitHub.

Appendix: source

Thrown at worker/backup_manifest.go:189

			m.Groups[gid] = parsedPreds
		}
		for _, op := range m.DropOperations {
			switch op.DropOp {
			case pb.DropOperation_DATA:
				op.DropValue = fmt.Sprintf("%#x", x.RootNamespace)
			case pb.DropOperation_ATTR:
				op.DropValue = x.AttrInRootNamespace(op.DropValue)
			default:
				// do nothing for drop all and drop namespace.
			}
		}
	case 2103:
		for gid, preds := range m.Groups {
			parsedPreds := preds[:0]
			for _, pred := range preds {
				ns_attr, err := x.AttrFrom2103(pred)
				if err != nil {
					return errors.Errorf("while parsing predicate got: %q", err)
				}
				parsedPreds = append(parsedPreds, ns_attr)
			}
			m.Groups[gid] = parsedPreds
		}
		for _, op := range m.DropOperations {
			// We have a cluster wide drop data in v21.03.
			if op.DropOp == pb.DropOperation_ATTR {
				ns_attr, err := x.AttrFrom2103(op.DropValue)
				if err != nil {
					return errors.Errorf("while parsing the drop operation %+v got: %q",
						op, err)
				}
				op.DropValue = ns_attr
			}
		}
	case 2105:
		// pass

View on GitHub (pinned to 759e242be6)