dgraph-io/dgraph · error
error deleting old predicate %s
Error message
error deleting old predicate %s
What it means
dropDeprecated iterates over deprecatedPreds and issues an ATTR drop operation through alterWithClient. When the Dgraph alter call fails for a given predicate, the error is wrapped as 'error deleting old predicate %s'. It means the schema migration could not remove a deprecated predicate from the v21.03 schema.
Source
Thrown at upgrade/change_v21.03.0.go:129
"dgraph.graphql.p_sha256hash": {},
}
var deprecatedTypes = map[string]struct{}{
"dgraph.type.cors": {},
"dgraph.graphql.history": {},
}
func dropDeprecated(dg *dgo.Dgraph) error {
if !Upgrade.Conf.GetBool(deleteOld) {
return nil
}
for pred := range deprecatedPreds {
op := &api.Operation{
DropOp: api.Operation_ATTR,
DropValue: pred,
}
if err := alterWithClient(dg, op); err != nil {
return errors.Wrapf(err, "error deleting old predicate %s", pred)
}
}
for typ := range deprecatedTypes {
op := &api.Operation{
DropOp: api.Operation_TYPE,
DropValue: typ,
}
if err := alterWithClient(dg, op); err != nil {
return errors.Wrapf(err, "error deleting old type %s", typ)
}
}
fmt.Println("Successfully dropped the deprecated predicates")
return nil
}
func upgradePersitentQuery() error {
dg, cb := x.GetDgraphClient(Upgrade.Conf, hasAclCreds())
defer cb()View on GitHub (pinned to 759e242be6)
Solutions
- Verify the Alpha address/credentials passed to the upgrade command are correct and reachable.
- Re-run the upgrade with admin ACL credentials (or --acl credentials) so alter operations are permitted.
- Check Alpha logs for the underlying alter failure and fix the root cause (e.g. read-only mode, disk full).
- Manually drop the predicate via /alter once the cluster is healthy and re-run upgrade.
Example fix
// before
if err := alterWithClient(dg, op); err != nil {
return errors.Wrapf(err, "error deleting old predicate %s", pred)
}
// after
if err := alterWithClient(dg, op); err != nil {
return errors.Wrapf(err, "error deleting old predicate %s (check ACL creds and Alpha connectivity)", pred)
} Defensive patterns
Strategy: try-catch
Validate before calling
curl -s http://localhost:8080/alter -XPOST -d '{"drop_attr": "old.pred"}' # verify alter works and creds are valid before upgrade Try / catch
if err := upgradeCORS(); err != nil {
if strings.Contains(err.Error(), "error deleting old predicate") {
// inspect wrapped cause: retry with admin ACL creds or drop predicate manually
}
return err
} Prevention
- Run the upgrade with admin/guardian ACL credentials
- Test alter endpoint reachability before starting the migration
- Keep the cluster writable (no drain/read-only mode) during upgrades
When it happens
Trigger: alterWithClient returns an error when dropping one of the predicates in deprecatedPreds — e.g. the Dgraph Alpha alter endpoint is unreachable, ACL forbids the operation, or the drop op is rejected server-side.
Common situations: Running the upgrade tool against a cluster where the user lacks alter permissions (ACL enabled without admin creds), Alpha address misconfigured in upgrade flags, or a network partition during schema migration.
Related errors
- error deleting old type %s
- error querying old ACL rules: %w
- unable to parse ACLs: %v
- unable to unmarshal ACL: %v :: %w
- error upgrading ACL rules: %w
AI-assisted analysis of dgraph-io/dgraph@759e242be6 (2026-09-01).
Data as JSON: /api/errors/bfd32a72df077a3e.
Report an issue: GitHub.