vitessio/vitess · warning
unable to get version for tablet %v: %v
Error message
unable to get version for tablet %v: %v
What it means
While validating that all replicas run the same vttablet build as the primary, GetVersion is called per replica; failures are recorded (not fatal) as "unable to get version for tablet %v: %v" in the validation error recorder.
Source
Thrown at go/vt/vtctl/grpcvtctldserver/server.go:5838
defer versionFuncMu.Unlock()
getVersionFromTablet = versionFunc
}
func GetVersionFunc() func(string) (string, error) {
versionFuncMu.Lock()
defer versionFuncMu.Unlock()
return getVersionFromTablet
}
// helper method to asynchronously get and diff a version
func (s *VtctldServer) diffVersion(ctx context.Context, primaryVersion string, primaryAlias *topodatapb.TabletAlias, alias *topodatapb.TabletAlias, wg *sync.WaitGroup, er concurrency.ErrorRecorder) {
defer wg.Done()
log.Info(fmt.Sprintf("Gathering version for %v", topoproto.TabletAliasString(alias)))
replicaVersion, err := s.GetVersion(ctx, &vtctldatapb.GetVersionRequest{
TabletAlias: alias,
})
if err != nil {
er.RecordError(fmt.Errorf("unable to get version for tablet %v: %v", alias, err))
return
}
if primaryVersion != replicaVersion.Version {
er.RecordError(fmt.Errorf("primary %v version %v is different than replica %v version %v", topoproto.TabletAliasString(primaryAlias), primaryVersion, topoproto.TabletAliasString(alias), replicaVersion))
}
}
// ApplyKeyspaceRoutingRules is part of the vtctlservicepb.VtctldServer interface.
func (s *VtctldServer) ApplyKeyspaceRoutingRules(ctx context.Context, req *vtctldatapb.ApplyKeyspaceRoutingRulesRequest) (*vtctldatapb.ApplyKeyspaceRoutingRulesResponse, error) {
span, ctx := trace.NewSpan(ctx, "VtctldServer.ApplyKeyspaceRoutingRules")
defer span.Finish()
span.Annotate("skip_rebuild", req.SkipRebuild)
span.Annotate("rebuild_cells", strings.Join(req.RebuildCells, ","))
resp := &vtctldatapb.ApplyKeyspaceRoutingRulesResponse{}
View on GitHub (pinned to 01a25a7d17)
Solutions
- Bring the failing replica tablet back up and re-run validation.
- Remove stale/decommissioned tablet aliases from the shard.
- Run version checks outside of rolling-upgrade windows, when all tablets are on the target version.
Defensive patterns
Strategy: fallback
Validate before calling
tab, err := ts.GetTablet(ctx, alias); if err != nil { log.Warn("alias not in topo; exclude from version check", slog.String("alias", topoproto.TabletAliasString(alias))) } Try / catch
if err := client.ValidateShard(ctx, req); err != nil { if strings.Contains(err.Error(), "unable to get version for tablet") { /* treat per-tablet; retry that tablet individually after it recovers */ } } Prevention
- Run version checks when all replicas are healthy
- Grep tablet logs for restarts before validation
- Clean up stale tablet aliases routinely
When it happens
Trigger: ValidateShard/ValidateKeyspace where GetVersion RPC to a replica alias fails — tablet down, restarting, or unreachable over gRPC.
Common situations: Replica is lagging back from a restart; alias belongs to a decommissioned tablet still in the topo; version-comparison runs during a rolling upgrade.
Related errors
- GetSchema(%v, nil, %v, %v) failed: %v
- GetVersion(%s) failed: %v
- GetSchema(%s, nil, %v, %v) (%v/%v) failed: %v
- tablet alias is nil
- can't get primary replication position: %v
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/045e072039e333b6.
Report an issue: GitHub.