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

  1. Inspect the wrapped inner error for the source topo failure
  2. Verify source topo connectivity and permissions
  3. Retry the copy after the source topo recovers
  4. 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

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


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/848a3f0426e06f48. Report an issue: GitHub.