vitessio/vitess · error
could not find tablet: %s
Error message
could not find tablet: %s
What it means
GetTabletHealthByAlias looks up a tablet's health data in the healthcheck's healthByAlias map. If the alias was never added, has been removed, or no health data has been recorded yet, it returns this error naming the alias.
Source
Thrown at go/vt/discovery/healthcheck.go:883
if target != nil {
hc.logger().Infof("couldn't find tablets for target: %v", target)
}
}
return ctx.Err()
case <-timer.C:
}
}
}
// GetTabletHealthByAlias results the TabletHealth of the tablet that matches the given alias
func (hc *HealthCheckImpl) GetTabletHealthByAlias(alias *topodata.TabletAlias) (*TabletHealth, error) {
hc.mu.Lock()
defer hc.mu.Unlock()
if hd, ok := hc.healthByAlias[tabletAliasString(topoproto.TabletAliasString(alias))]; ok {
return hd.SimpleCopy(), nil
}
return nil, fmt.Errorf("could not find tablet: %s", alias.String())
}
// GetTabletHealth results the TabletHealth of the tablet that matches the given alias and KeyspaceShardTabletType
// The data is retrieved from the healthData map.
func (hc *HealthCheckImpl) GetTabletHealth(kst KeyspaceShardTabletType, alias *topodata.TabletAlias) (*TabletHealth, error) {
hc.mu.Lock()
defer hc.mu.Unlock()
if hd, ok := hc.healthData[kst]; ok {
if th, ok := hd[tabletAliasString(topoproto.TabletAliasString(alias))]; ok {
return th, nil
}
}
return nil, fmt.Errorf("could not find tablet: %s", alias.String())
}
// isRegisteredHealthCheckLocked reports whether thc is the current healthcheck for tabletAlias.
// hc.mu must be locked before calling it.View on GitHub (pinned to 01a25a7d17)
Solutions
- Verify the tablet alias (cell-uid) is correct via vtctl GetTablet or the topology.
- Ensure AddTablet was called for this alias and the healthcheck watches the tablet's cell(s).
- Retry after a short delay if the tablet was just added — health data appears only after the first health check response.
- Confirm the tablet hasn't been removed/restarted (aliases change on re-init); refresh the alias from the topology.
Example fix
// before
hd, err := hc.GetTabletHealthByAlias(ctx, alias) // may not exist yet
// after
hd, err := hc.GetTabletHealthByAlias(ctx, alias)
if err != nil {
log.Infof("tablet %s not tracked (not added or removed): %v", alias, err)
return nil // treat as untracked, not fatal
} Defensive patterns
Strategy: fallback
Validate before calling
// confirm the tablet exists in topology first
ts := topo.Server()
_, err := ts.GetTablet(ctx, alias)
if err != nil {
return fmt.Errorf("alias %s not in topology: %w", alias, err)
} Try / catch
hd, err := hc.GetTabletHealthByAlias(ctx, alias)
if err != nil {
return nil, fmt.Errorf("tablet %s untracked in healthcheck: %w", alias, err)
} Prevention
- Call AddTablet and wait for the first health response before querying
- Refresh aliases from topology rather than caching them across restarts
- Ensure the healthcheck watches the tablet's cell
When it happens
Trigger: Calling HealthCheckImpl.GetTabletHealthByAlias with a TabletAlias that is not currently tracked — the tablet was never AddTablet-ed, was removed (RemoveTablet), or the healthcheck context hasn't received any health response for it.
Common situations: Race where the tablet was recently pruned from the healthcheck; querying an alias on a different cell than the healthcheck watches; querying immediately after creating the healthcheck before the first health pass; typo'd alias in tooling.
Related errors
- parse error
- failed to parse tablet-filters value %q: %v
- FindTablets(cluster = %s): %w
- DiscoverVTGates(cluster = %s): %w
- failed to discover %ss (cluster %s): %w
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/b5f799164ade1539.
Report an issue: GitHub.