{"record":{"id":"0791284c2d85ab6d","repo":"vitessio/vitess","slug":"gettabletmap-v-failed-w","errorCode":null,"errorMessage":"GetTabletMap(%v) failed: %w","messagePattern":"GetTabletMap\\((.+?)\\) failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/grpcvtctldserver/server.go","lineNumber":2325,"sourceCode":"\t}\n\n\t// Create a context for our per-cell RPCs, with a timeout upper-bounded at\n\t// the RemoteOperationTimeout.\n\t//\n\t// Per-cell goroutines may also cancel this context if they fail and the\n\t// request specified Strict=true to allow us to fail faster.\n\tctx, cancel := context.WithTimeout(ctx, topo.RemoteOperationTimeout)\n\tdefer cancel()\n\n\tvar tabletMap map[string]*topo.TabletInfo\n\n\tswitch {\n\tcase len(req.TabletAliases) > 0:\n\t\tspan.Annotate(\"tablet_aliases\", strings.Join(topoproto.TabletAliasList(req.TabletAliases).ToStringSlice(), \",\"))\n\n\t\ttabletMap, err = s.ts.GetTabletMap(ctx, req.TabletAliases, nil)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"GetTabletMap(%v) failed: %w\", req.TabletAliases, err)\n\t\t}\n\tcase req.Keyspace != \"\" && req.Shard != \"\":\n\t\tspan.Annotate(\"shard\", req.Shard)\n\n\t\ttabletMap, err = s.ts.GetTabletMapForShard(ctx, req.Keyspace, req.Shard)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"GetTabletMapForShard(%s, %s) failed: %w\", req.Keyspace, req.Shard, err)\n\t\t}\n\tdefault:\n\t\t// goto the req.Cells branch\n\t\ttabletMap = nil\n\t}\n\n\tif err != nil {\n\t\tswitch {\n\t\tcase topo.IsErrType(err, topo.PartialResult):\n\t\t\tif req.Strict {\n\t\t\t\treturn nil, err","sourceCodeStart":2307,"sourceCodeEnd":2343,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/grpcvtctldserver/server.go#L2307-L2343","documentation":"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.","triggerScenarios":"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.","commonSituations":"Stale tablet aliases referenced after a tablet was decommissioned, etcd/zookeeper outage, or a typo in an alias string.","solutions":["Verify each tablet alias exists (`vtctldclient GetTablets` or check topo directly) and remove stale aliases.","Check topo server connectivity/credentials from vtctld (etcd/zk endpoints, health).","Retry the RPC if the topo store was transiently unavailable."],"exampleFix":"// before\nvtctldclient GetTablets --tablet-aliases \"zone1-0000000101,zone1-0000009999\"\n// after\nvtctldclient GetTablets --tablet-aliases \"zone1-0000000101\"","handlingStrategy":"validation","validationCode":"aliases := strings.Join(topoproto.TabletAliasList(req.TabletAliases).ToStringSlice(), \",\")\nif err := checkAliasesInTopo(ctx, ts, req.TabletAliases); err != nil {\n    return fmt.Errorf(\"stale aliases %s: %w\", aliases, err)\n}","typeGuard":null,"tryCatchPattern":"tabletMap, err := s.ts.GetTabletMap(ctx, req.TabletAliases, nil)\nif err != nil {\n    return fmt.Errorf(\"GetTabletMap(%v) failed: %w\", req.TabletAliases, err)\n}","preventionTips":["Verify tablet aliases exist before calling GetTablets with aliases","Monitor topo store health (etcd/zk) from vtctld","Clean up stale tablets after decommissioning"],"tags":["vitess","topo","grpc","tablet"],"backgroundTag":"topo-lookup-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}