{"record":{"id":"ad5a34e8df7e2e60","repo":"vitessio/vitess","slug":"cell-param-required","errorCode":null,"errorMessage":"cell param required","messagePattern":"cell param required","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctld/api.go","lineNumber":417,"sourceCode":"\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tif cell != \"\" {\n\t\t\t\t\tresult, err := ts.FindAllTabletAliasesInShardByCell(ctx, keyspace, shard, []string{cell})\n\t\t\t\t\tif err != nil && !topo.IsErrType(err, topo.PartialResult) {\n\t\t\t\t\t\treturn result, err\n\t\t\t\t\t}\n\t\t\t\t\treturn result, nil\n\t\t\t\t}\n\t\t\t\tresult, err := ts.FindAllTabletAliasesInShard(ctx, keyspace, shard)\n\t\t\t\tif err != nil && !topo.IsErrType(err, topo.PartialResult) {\n\t\t\t\t\treturn result, err\n\t\t\t\t}\n\t\t\t\treturn result, nil\n\t\t\t}\n\n\t\t\t// Get all tablets in a cell.\n\t\t\tif cell == \"\" {\n\t\t\t\treturn nil, errors.New(\"cell param required\")\n\t\t\t}\n\t\t\treturn ts.GetTabletAliasesByCell(ctx, cell)\n\t\t}\n\n\t\t// Get tablet health.\n\t\tif parts := strings.Split(tabletPath, \"/\"); len(parts) == 2 && parts[1] == \"health\" {\n\t\t\ttabletAlias, err := topoproto.ParseTabletAlias(parts[0])\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn tabletHealthCache.Get(ctx, tabletAlias)\n\t\t}\n\n\t\ttabletAlias, err := topoproto.ParseTabletAlias(tabletPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctld/api.go#L399-L435","documentation":"In the tablets collection handler, when the request is not tablet-specific (no alias path) and no other filter applies, the code falls through to 'get all tablets in a cell'; an empty cell at that point means no cell could be determined, so the request is rejected with 'cell param required'.","triggerScenarios":"GET /api/tablets (no tablet alias, no cell query param, and no local cell fallback available) reaching the GetTabletAliasesByCell call with cell == \"\" — e.g. a GET /api/tablets/health-free path shape that is not the health endpoint.","commonSituations":"Scripts omitting the cell query param; deployments without a local cell configured so the earlier fallback fails silently into this path; URL format mistakes dropping the cell segment.","solutions":["Pass an explicit cell: GET /api/tablets?cell=<cell>.","Ensure the request originates from a vtctld with a configured local cell, or set the cell parameter explicitly.","To get a specific tablet, use its alias path (/api/tablets/<cell>-<uid>) instead.","Create cells in the topology if none exist (AddCellInfo) so listing can resolve a cell."],"exampleFix":"// before\ncurl http://localhost:15000/api/tablets\n// after\ncurl http://localhost:15000/api/tablets?cell=zone1","handlingStrategy":"validation","validationCode":"if cell == \"\" {\n    return fmt.Errorf(\"cannot list tablets: cell parameter is required\")\n}\nu := fmt.Sprintf(\"%s/api/tablets?cell=%s\", base, url.QueryEscape(cell))","typeGuard":null,"tryCatchPattern":"resp, err := http.Get(u)\nif err != nil || strings.Contains(body, \"cell param required\") {\n    // add ?cell=<name> and retry\n}","preventionTips":["Always supply the cell query param when listing tablets.","Configure a local cell on vtctld so defaults resolve.","Use tablet alias paths for per-tablet requests instead of collection + filter."],"tags":["http-api","vtctld","tablets","cell"],"backgroundTag":"missing-required-argument","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}