{"record":{"id":"fbd63dfbc968e39f","repo":"vitessio/vitess","slug":"no-local-cells-have-been-created-yet","errorCode":null,"errorMessage":"no local cells have been created yet","messagePattern":"no local cells have been created yet","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctld/api.go","lineNumber":345,"sourceCode":"\t\tkeyspacePath := getItemPath(r.URL.Path)\n\t\tparts := strings.SplitN(keyspacePath, \"/\", 2)\n\n\t\t// Request was incorrectly formatted.\n\t\tif len(parts) != 2 {\n\t\t\treturn nil, fmt.Errorf(\"invalid srvkeyspace path: %q  expected path: /srv_keyspace/<cell>/<keyspace>\", keyspacePath)\n\t\t}\n\n\t\tcell := parts[0]\n\t\tkeyspace := parts[1]\n\n\t\tif cell == \"local\" {\n\t\t\tif localCell == \"\" {\n\t\t\t\tcells, err := ts.GetCellInfoNames(ctx)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"could not fetch cell info: %v\", err)\n\t\t\t\t}\n\t\t\t\tif len(cells) == 0 {\n\t\t\t\t\treturn nil, errors.New(\"no local cells have been created yet\")\n\t\t\t\t}\n\t\t\t\tcell = cells[0]\n\t\t\t} else {\n\t\t\t\tcell = localCell\n\t\t\t}\n\t\t}\n\n\t\t// If a keyspace is provided then return the specified srvkeyspace.\n\t\tif keyspace != \"\" {\n\t\t\tsrvKeyspace, err := ts.GetSrvKeyspace(ctx, cell, keyspace)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"can't get server keyspace: %v\", err)\n\t\t\t}\n\t\t\treturn srvKeyspace, nil\n\t\t}\n\n\t\t// Else return the srvKeyspace from all keyspaces.\n\t\tsrvKeyspaces := make(map[string]any)","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctld/api.go#L327-L363","documentation":"When a tablet-listing request does not specify a cell, the handler falls back to the first cell from the topology (GetCellInfoNames). If the topology contains no cells at all, there is no default to choose and this error is returned. It signals an unconfigured/empty topology rather than a bad request per se.","triggerScenarios":"GET /api/tablets (or equivalent) with no cell parameter or localCell set, while ts.GetCellInfoNames returns an empty list — i.e. no cell infos are registered in the topology.","commonSituations":"Fresh Vitess deployment where no cells were created yet (vtctldclient AddCellInfo not run); wrong topo server/flags pointing vtctld at an empty etcd/zk namespace; topology wiped or recreated.","solutions":["Create at least one cell: vtctldclient AddCellInfo --root <root> <cell-name>.","Verify vtctld's topo flags point at the same topo backend your cells were registered in.","Explicitly pass a cell (cell=<name> query param) so the fallback is not needed.","Inspect topo health (vtctldclient GetCellInfoNames or topo tooling) to confirm cells exist."],"exampleFix":"// before\ncurl http://localhost:15000/api/tablets          # empty topo -> error\n// after\nvtctldclient AddCellInfo --root /vitess/zone1 zone1\ncurl http://localhost:15000/api/tablets?cell=zone1","handlingStrategy":"validation","validationCode":"cells, err := ts.GetCellInfoNames(ctx)\nif err != nil { return err }\nif len(cells) == 0 {\n    return fmt.Errorf(\"topology has no cells; run AddCellInfo before listing tablets\")\n}","typeGuard":null,"tryCatchPattern":"resp, err := http.Get(base + \"/api/tablets\")\nif err != nil || strings.Contains(body, \"no local cells have been created yet\") {\n    // create a cell first, or pass ?cell=<name>\n}","preventionTips":["Register cells (vtctldclient AddCellInfo) during deployment before other operations.","Point all components at the same topo backend/namespace.","Pass an explicit cell parameter when the topology may be empty."],"tags":["topology","cells","vtctld","http-api"],"backgroundTag":"empty-topology-no-cells","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}