{"record":{"id":"848a3f0426e06f48","repo":"vitessio/vitess","slug":"getroutingrules-w","errorCode":null,"errorMessage":"GetRoutingRules: %w","messagePattern":"GetRoutingRules: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/topo/helpers/copy.go","lineNumber":217,"sourceCode":"\t\t\t\t\t// unintentionally breaking if we add new fields.\n\t\t\t\t\tproto.Merge(oldSR, sri.ShardReplication)\n\t\t\t\t\toldSR.Nodes = nodes\n\t\t\t\t\treturn nil\n\t\t\t\t}); err != nil {\n\t\t\t\t\tlog.Warn(fmt.Sprintf(\"UpdateShardReplicationFields(%v, %v, %v): %v\", cell, keyspace, shard, err))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// CopyRoutingRules will create the routing rules in the destination topo.\nfunc CopyRoutingRules(ctx context.Context, fromTS, toTS *topo.Server) error {\n\trr, err := fromTS.GetRoutingRules(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"GetRoutingRules: %w\", err)\n\t}\n\tif err := toTS.SaveRoutingRules(ctx, rr); err != nil {\n\t\tlog.Error(fmt.Sprintf(\"SaveRoutingRules(%v): %v\", rr, err))\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":199,"sourceCodeEnd":225,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/topo/helpers/copy.go#L199-L225","documentation":"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.","triggerScenarios":"Calling CopyRoutingRules when fromTS.GetRoutingRules fails due to source topo connectivity loss, backend timeout, or a corrupt routing rules node.","commonSituations":"Source topo outage during copyTopos; routing rules global key unreadable in etcd/ZK; permission problems on the routing rules path.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"rr, err := fromTS.GetRoutingRules(ctx)\nif err != nil {\n    return fmt.Errorf(\"source routing rules unreadable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"err := helpers.CopyRoutingRules(ctx, fromTS, toTS)\nif err != nil {\n    log.Errorf(\"routing rules copy failed, continuing without rules: %v\", err)\n}","preventionTips":["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"],"tags":["topo","routing-rules","source-topo"],"backgroundTag":"topo-routing-rules-read-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}