{"record":{"id":"ba0b6137470f2257","repo":"vitessio/vitess","slug":"gettabletsbycell-s-failed-w","errorCode":null,"errorMessage":"GetTabletsByCell(%s) failed: %w","messagePattern":"GetTabletsByCell\\((.+?)\\) failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/grpcvtctldserver/server.go","lineNumber":2408,"sourceCode":"\t\tm          sync.Mutex\n\t\twg         sync.WaitGroup\n\t\trec        concurrency.AllErrorRecorder\n\t\tallTablets []*topo.TabletInfo\n\t)\n\n\tfor _, cell := range cells {\n\t\twg.Add(1)\n\n\t\tgo func(cell string) {\n\t\t\tdefer wg.Done()\n\n\t\t\ttablets, err := s.ts.GetTabletsByCell(ctx, cell, nil)\n\t\t\tif err != nil {\n\t\t\t\tif req.Strict {\n\t\t\t\t\tlog.Info(fmt.Sprintf(\"GetTablets got an error from cell %s: %s. Running in strict mode, so canceling other cell RPCs\", cell, err))\n\t\t\t\t\tcancel()\n\t\t\t\t}\n\t\t\t\trec.RecordError(fmt.Errorf(\"GetTabletsByCell(%s) failed: %w\", cell, err))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tm.Lock()\n\t\t\tdefer m.Unlock()\n\t\t\tallTablets = append(allTablets, tablets...)\n\t\t}(cell)\n\t}\n\n\twg.Wait()\n\n\tif rec.HasErrors() {\n\t\tif req.Strict || len(rec.Errors) == len(cells) {\n\t\t\terr = rec.Error()\n\t\t\treturn nil, err\n\t\t}\n\t}\n","sourceCodeStart":2390,"sourceCodeEnd":2426,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/grpcvtctldserver/server.go#L2390-L2426","documentation":"In the cells-based path of GetTablets, vtctld queries every requested cell via s.ts.GetTabletsByCell and aggregates errors in an error recorder. Each per-cell failure is recorded with the cell name; with req.Strict set it also cancels the other cell RPCs immediately.","triggerScenarios":"Calling GetTablets without aliases/keyspace-shard (the cells path) while GetTabletsByCell fails for a cell — cell name not in topo, topo connectivity failure for that cell's backend, or empty/invalid cell.","commonSituations":"Multi-cell clusters where one cell's topo backend is down or a cell was removed but still listed in the request; misconfigured --cells value.","solutions":["Confirm all requested cell names exist in the topo (`vtctldclient GetCellsAliasInfo` / topo cell list).","Check connectivity to the failing cell's topo backend and fix the outage.","Remove the unhealthy/removed cell from the request, or run without Strict so other cells still return results."],"exampleFix":"// before\nvtctldclient GetTablets --cells \"zone1,zone3\"\n// after\nvtctldclient GetTablets --cells \"zone1,zone2\"","handlingStrategy":"fallback","validationCode":"cells, err := s.ts.GetCellInfoNames(ctx)\nif err != nil { return err }\nfor _, c := range req.Cells {\n    if !slices.Contains(cells, c) {\n        return fmt.Errorf(\"unknown cell %q\", c)\n    }\n}","typeGuard":null,"tryCatchPattern":"tablets, err := s.ts.GetTabletsByCell(ctx, cell, nil)\nif err != nil {\n    if req.Strict { cancel() }\n    rec.RecordError(fmt.Errorf(\"GetTabletsByCell(%s) failed: %w\", cell, err))\n    return\n}","preventionTips":["Only request cells that exist in the topo","Avoid Strict mode when partial results are acceptable during cell outages","Monitor per-cell topo health"],"tags":["vitess","topo","grpc","cells"],"backgroundTag":"topo-lookup-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}