{"record":{"id":"1e1dd50299dd8a21","repo":"vitessio/vitess","slug":"cannot-find-tablet-v","errorCode":null,"errorMessage":"cannot find tablet: %+v","messagePattern":"cannot find tablet: %\\+v","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtcombo/tablet_map.go","lineNumber":236,"sourceCode":"\t\t\treturn 0, err\n\t\t}\n\t}\n\n\t// Rebuild the SrvVSchema object\n\tif err := ts.RebuildSrvVSchema(ctx, tpb.Cells); err != nil {\n\t\treturn 0, fmt.Errorf(\"RebuildVSchemaGraph failed: %v\", err)\n\t}\n\n\t// Register the tablet dialer for tablet server. main() forces the --tablet-protocol\n\t// flag to this value.\n\ttabletconn.RegisterDialer(\"internal\", dialer)\n\n\t// run healthcheck on all vttablets\n\ttmc := tmclient.NewTabletManagerClient()\n\tfor _, tablet := range tabletMap {\n\t\ttabletInfo, err := ts.GetTablet(ctx, tablet.alias)\n\t\tif err != nil {\n\t\t\treturn 0, fmt.Errorf(\"cannot find tablet: %+v\", tablet.alias)\n\t\t}\n\t\ttmc.RunHealthCheck(ctx, tabletInfo.Tablet)\n\t}\n\n\treturn uid, nil\n}\n\n// DeleteKs deletes keyspace, shards and tablets with mysql databases\nfunc DeleteKs(\n\tctx context.Context,\n\tts *topo.Server,\n\tksName string,\n\tmysqld mysqlctl.MysqlDaemon,\n\ttpb *vttestpb.VTTestTopology,\n) error {\n\tfor key, tablet := range tabletMap {\n\t\tif tablet.keyspace == ksName {\n\t\t\tdelete(tabletMap, key)","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtcombo/tablet_map.go#L218-L254","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the topo for the alias (vtctldclient GetTablet <alias>) and compare with the tablets vtcombo is creating.","Clean stale topo entries from previous runs (delete tablets/topo paths under /vt) and restart vtcombo.","Ensure --cells matches the cells used when creating tablets so GetTablet resolves the alias's cell."],"exampleFix":"// before\n--cells zone1,zone2  // tablet created only in zone1, topo for zone2 empty\n// after\n--cells zone1","handlingStrategy":"validation","validationCode":"// Go: confirm the alias exists in topo before running health checks\nif _, err := ts.GetTablet(ctx, alias); err != nil {\n    log.Info(\"skipping health check; tablet missing in topo\", slog.Any(\"alias\", alias))\n    return\n}","typeGuard":null,"tryCatchPattern":"if err := InitTabletMap(...); err != nil {\n    if strings.Contains(err.Error(), \"cannot find tablet\") {\n        // compare topo tablet records against vtcombo's tabletMap; clean stale state\n    }\n}","preventionTips":["Wipe stale topo data between local vtcombo runs.","Keep --cells consistent with the cells tablets are created in.","Treat GetTablet failures in init loops as state inconsistency and log the alias for diagnosis."],"tags":["vtcombo","topology","tablet","healthcheck"],"backgroundTag":"tablet-not-found","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}