vitessio/vitess · error

cannot find tablet: %+v

Error message

cannot find tablet: %+v

What it means

During vtcombo InitTabletMap's health-check loop, ts.GetTablet fails for a tablet that was just added to the local tabletMap, so the error reports 'cannot find tablet' with the alias. It means the topo no longer (or never did) contain a Tablet record for that alias — an internal consistency failure of the local topo.

Source

Thrown at go/vt/vtcombo/tablet_map.go:236

			return 0, err
		}
	}

	// Rebuild the SrvVSchema object
	if err := ts.RebuildSrvVSchema(ctx, tpb.Cells); err != nil {
		return 0, fmt.Errorf("RebuildVSchemaGraph failed: %v", err)
	}

	// Register the tablet dialer for tablet server. main() forces the --tablet-protocol
	// flag to this value.
	tabletconn.RegisterDialer("internal", dialer)

	// run healthcheck on all vttablets
	tmc := tmclient.NewTabletManagerClient()
	for _, tablet := range tabletMap {
		tabletInfo, err := ts.GetTablet(ctx, tablet.alias)
		if err != nil {
			return 0, fmt.Errorf("cannot find tablet: %+v", tablet.alias)
		}
		tmc.RunHealthCheck(ctx, tabletInfo.Tablet)
	}

	return uid, nil
}

// DeleteKs deletes keyspace, shards and tablets with mysql databases
func DeleteKs(
	ctx context.Context,
	ts *topo.Server,
	ksName string,
	mysqld mysqlctl.MysqlDaemon,
	tpb *vttestpb.VTTestTopology,
) error {
	for key, tablet := range tabletMap {
		if tablet.keyspace == ksName {
			delete(tabletMap, key)

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Check the topo for the alias (vtctldclient GetTablet <alias>) and compare with the tablets vtcombo is creating.
  2. Clean stale topo entries from previous runs (delete tablets/topo paths under /vt) and restart vtcombo.
  3. Ensure --cells matches the cells used when creating tablets so GetTablet resolves the alias's cell.

Example fix

// before
--cells zone1,zone2  // tablet created only in zone1, topo for zone2 empty
// after
--cells zone1
Defensive patterns

Strategy: validation

Validate before calling

// Go: confirm the alias exists in topo before running health checks
if _, err := ts.GetTablet(ctx, alias); err != nil {
    log.Info("skipping health check; tablet missing in topo", slog.Any("alias", alias))
    return
}

Try / catch

if err := InitTabletMap(...); err != nil {
    if strings.Contains(err.Error(), "cannot find tablet") {
        // compare topo tablet records against vtcombo's tabletMap; clean stale state
    }
}

Prevention

When it happens

Trigger: InitTabletMap iterating tabletMap where ts.GetTablet(ctx, tablet.alias) errors: tablet record missing from topo (CreateTablet failed silently or was rolled back), alias cell mismatch, or topo read failure.

Common situations: Stale topo state from a prior vtcombo run conflicting with the new in-memory tabletMap; topo server flakiness; wrong --cells configuration so the alias's cell isn't served by the topo backend.

Related errors


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