{"record":{"id":"7f591de5126d87c4","repo":"vitessio/vitess","slug":"gettablets-cluster-s-w","errorCode":null,"errorMessage":"GetTablets(cluster = %s): %w","messagePattern":"GetTablets\\(cluster = (.+?)\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtadmin/api.go","lineNumber":1509,"sourceCode":"\t\ttablets []*vtadminpb.Tablet\n\t\twg      sync.WaitGroup\n\t\ter      concurrency.AllErrorRecorder\n\t\tm       sync.Mutex\n\t)\n\n\tfor _, c := range clusters {\n\t\tif !api.authz.IsAuthorized(ctx, c.ID, rbac.TabletResource, rbac.GetAction) {\n\t\t\tcontinue\n\t\t}\n\n\t\twg.Add(1)\n\n\t\tgo func(c *cluster.Cluster) {\n\t\t\tdefer wg.Done()\n\n\t\t\tts, err := c.GetTablets(ctx)\n\t\t\tif err != nil {\n\t\t\t\ter.RecordError(fmt.Errorf(\"GetTablets(cluster = %s): %w\", c.ID, err))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tm.Lock()\n\t\t\ttablets = append(tablets, ts...)\n\t\t\tm.Unlock()\n\t\t}(c)\n\t}\n\n\twg.Wait()\n\n\tif er.HasErrors() {\n\t\treturn nil, er.Error()\n\t}\n\n\treturn &vtadminpb.GetTabletsResponse{\n\t\tTablets: tablets,\n\t}, nil","sourceCodeStart":1491,"sourceCodeEnd":1527,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtadmin/api.go#L1491-L1527","documentation":"API.GetTablets fans out to every configured cluster and calls c.GetTablets in a goroutine; a per-cluster failure is recorded with this wrapper (\"GetTablets(cluster = <ID>): <cause>\") on the shared error recorder, failing the overall request if any cluster errors.","triggerScenarios":"Calling vtadmin GetTablets when a cluster's tablet discovery fails: vtctld GetTablets RPC error, topo unreachable, or vttablet health/registration issues making the topo query fail.","commonSituations":"Tablets not yet registered in the topo; etcd/zk latency or outage; vtctld restarted or overloaded; wrong cluster ID configuration.","solutions":["Inspect the wrapped cause for the failing cluster ID and root error","Verify vtctld for that cluster is reachable and its GetTablets works (vtctldclient GetTablets)","Check topo server health and tablet registration records","Fix/remove the misconfigured cluster in vtadmin config"],"exampleFix":"// before\nts, err := c.GetTablets(ctx)\nif err != nil {\n\ter.RecordError(fmt.Errorf(\"GetTablets(cluster = %s): %w\", c.ID, err))\n\treturn\n}\n// after: ensure vtctld + topo healthy for that cluster\nts, err := c.GetTablets(ctx)\nif err != nil {\n\ter.RecordError(fmt.Errorf(\"GetTablets(cluster = %s): %w\", c.ID, err))\n\treturn\n}","handlingStrategy":"try-catch","validationCode":"// confirm vtctld GetTablets works before vtadmin fan-out\n_, err := vtctldClient.GetTablets(ctx, &vtctldatapb.GetTabletsRequest{})\nif err != nil {\n\tlog.Printf(\"vtctld tablet discovery broken: %v\", err)\n}","typeGuard":"func tabletsFailed(er concurrency.AllErrorRecorder) bool { return er.HasErrors() }","tryCatchPattern":"resp, err := client.GetTablets(ctx, req)\nif err != nil {\n\tif strings.Contains(err.Error(), \"GetTablets(cluster = \") {\n\t\t// extract cluster ID; check its vtctld/topo\n\t}\n\treturn err\n}","preventionTips":["Ensure tablets are registered in the topo (vttablet up and talking to topo)","Monitor topo server latency/outages","Validate cluster IDs in vtadmin config","Run vtctldclient GetTablets as a smoke test"],"tags":["vtadmin","tablets","vtctld","discovery"],"backgroundTag":"tablet-discovery-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}