dgraph-io/dgraph · error

while parsing the drop operation %+v got: %q

Error message

while parsing the drop operation %+v got: %q

What it means

During a v21.03 (case 2103) manifest upgrade, DropOperations with DropOp == ATTR carry DropValue predicate strings that must be converted with x.AttrFrom2103. This error is thrown when such a drop-operation value cannot be parsed into the new namespaced attribute format.

Source

Thrown at worker/backup_manifest.go:200

		}
	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
	}
	return nil
}

func readManifest(h UriHandler, path string) (*Manifest, error) {
	var m Manifest
	b, err := h.Read(path)
	if err != nil {
		return &m, errors.Wrap(err, "readManifest failed to read the file: ")
	}
	if err := json.Unmarshal(b, &m); err != nil {

View on GitHub (pinned to 759e242be6)

Solutions

  1. Remove or fix the malformed DropOperation entry in the manifest.
  2. Upgrade via intermediate Dgraph versions to convert the manifest properly.
  3. Take a new backup with the current Dgraph version.
  4. Compare the failing DropValue against expected 21.03 attribute format and correct it.

Example fix

// before: old-format DropValue that fails conversion
{"DropOp":"ATTR","DropValue":"friend"}
// after: re-take the backup with the target version
dgraph backup --dst s3://bucket/new-backup
Defensive patterns

Strategy: validation

Validate before calling

if m.Version == 2103 {
    for _, op := range m.DropOperations {
        if op.DropOp == pb.DropOperation_ATTR {
            if _, err := x.AttrFrom2103(op.DropValue); err != nil {
                return fmt.Errorf("bad DropValue %q: %v", op.DropValue, err)
            }
        }
    }
}

Prevention

When it happens

Trigger: GetManifest on a 2103-version manifest whose DropOperations contain an ATTR entry with DropValue that AttrFrom2103 rejects — corrupt or foreign-format drop operation data in the manifest.

Common situations: Multi-version upgrades skipping intermediate releases; manifests edited or merged by tooling; drop operations recorded under a different Dgraph version format.

Related errors


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