vitessio/vitess · error
GetRoutingRules: %w
Error message
GetRoutingRules: %w
What it means
CopyRoutingRules reads routing rules from the source topo with fromTS.GetRoutingRules to save them into the destination. This error wraps a failure of that read, meaning routing rules could not be fetched from the source topology.
Source
Thrown at go/vt/topo/helpers/copy.go:217
// unintentionally breaking if we add new fields.
proto.Merge(oldSR, sri.ShardReplication)
oldSR.Nodes = nodes
return nil
}); err != nil {
log.Warn(fmt.Sprintf("UpdateShardReplicationFields(%v, %v, %v): %v", cell, keyspace, shard, err))
}
}
}
}
return nil
}
// CopyRoutingRules will create the routing rules in the destination topo.
func CopyRoutingRules(ctx context.Context, fromTS, toTS *topo.Server) error {
rr, err := fromTS.GetRoutingRules(ctx)
if err != nil {
return fmt.Errorf("GetRoutingRules: %w", err)
}
if err := toTS.SaveRoutingRules(ctx, rr); err != nil {
log.Error(fmt.Sprintf("SaveRoutingRules(%v): %v", rr, err))
}
return nil
}
View on GitHub (pinned to 01a25a7d17)
Solutions
- Inspect the wrapped inner error for the source topo failure
- Verify source topo connectivity and permissions
- Retry the copy after the source topo recovers
- Recreate routing rules in the source if the node is corrupt
Defensive patterns
Strategy: try-catch
Validate before calling
rr, err := fromTS.GetRoutingRules(ctx)
if err != nil {
return fmt.Errorf("source routing rules unreadable: %w", err)
} Try / catch
err := helpers.CopyRoutingRules(ctx, fromTS, toTS)
if err != nil {
log.Errorf("routing rules copy failed, continuing without rules: %v", err)
} Prevention
- Health-check source topo reads before copying routing rules
- Back up routing rules before topo migration operations
- Remember CopyRoutingRules logs (not returns) SaveRoutingRules failures - verify destination rules after copy
When it happens
Trigger: Calling CopyRoutingRules when fromTS.GetRoutingRules fails due to source topo connectivity loss, backend timeout, or a corrupt routing rules node.
Common situations: Source topo outage during copyTopos; routing rules global key unreadable in etcd/ZK; permission problems on the routing rules path.
Related errors
- GetCellInfoNames(): %w
- GetShardReplication(%v, %v, %v): %w
- GetRoutingRules failed: %v
- could not get RoutingRules
- there are no cells in the topo
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/848a3f0426e06f48.
Report an issue: GitHub.