vitessio/vitess · error

GetTabletMap(%v) failed: %w

Error message

GetTabletMap(%v) failed: %w

What it means

GetTablets resolves tablets by alias by fetching the tablet records from the topo server via s.ts.GetTabletMap. If that topo lookup fails (topo unavailable, some/all aliases missing), the error is wrapped with the requested alias list for context.

Source

Thrown at go/vt/vtctl/grpcvtctldserver/server.go:2325

	}

	// Create a context for our per-cell RPCs, with a timeout upper-bounded at
	// the RemoteOperationTimeout.
	//
	// Per-cell goroutines may also cancel this context if they fail and the
	// request specified Strict=true to allow us to fail faster.
	ctx, cancel := context.WithTimeout(ctx, topo.RemoteOperationTimeout)
	defer cancel()

	var tabletMap map[string]*topo.TabletInfo

	switch {
	case len(req.TabletAliases) > 0:
		span.Annotate("tablet_aliases", strings.Join(topoproto.TabletAliasList(req.TabletAliases).ToStringSlice(), ","))

		tabletMap, err = s.ts.GetTabletMap(ctx, req.TabletAliases, nil)
		if err != nil {
			err = fmt.Errorf("GetTabletMap(%v) failed: %w", req.TabletAliases, err)
		}
	case req.Keyspace != "" && req.Shard != "":
		span.Annotate("shard", req.Shard)

		tabletMap, err = s.ts.GetTabletMapForShard(ctx, req.Keyspace, req.Shard)
		if err != nil {
			err = fmt.Errorf("GetTabletMapForShard(%s, %s) failed: %w", req.Keyspace, req.Shard, err)
		}
	default:
		// goto the req.Cells branch
		tabletMap = nil
	}

	if err != nil {
		switch {
		case topo.IsErrType(err, topo.PartialResult):
			if req.Strict {
				return nil, err

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Verify each tablet alias exists (`vtctldclient GetTablets` or check topo directly) and remove stale aliases.
  2. Check topo server connectivity/credentials from vtctld (etcd/zk endpoints, health).
  3. Retry the RPC if the topo store was transiently unavailable.

Example fix

// before
vtctldclient GetTablets --tablet-aliases "zone1-0000000101,zone1-0000009999"
// after
vtctldclient GetTablets --tablet-aliases "zone1-0000000101"
Defensive patterns

Strategy: validation

Validate before calling

aliases := strings.Join(topoproto.TabletAliasList(req.TabletAliases).ToStringSlice(), ",")
if err := checkAliasesInTopo(ctx, ts, req.TabletAliases); err != nil {
    return fmt.Errorf("stale aliases %s: %w", aliases, err)
}

Try / catch

tabletMap, err := s.ts.GetTabletMap(ctx, req.TabletAliases, nil)
if err != nil {
    return fmt.Errorf("GetTabletMap(%v) failed: %w", req.TabletAliases, err)
}

Prevention

When it happens

Trigger: Calling the GetTablets vtctld RPC with req.TabletAliases set while the topo cannot return the tablet records — alias does not exist, topo store connectivity issue, or permission problem.

Common situations: Stale tablet aliases referenced after a tablet was decommissioned, etcd/zookeeper outage, or a typo in an alias string.

Related errors


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