{"record":{"id":"b2c3f3e4bc3fc752","repo":"vitessio/vitess","slug":"missing-keyspace-q-in-cell-q","errorCode":null,"errorMessage":"missing keyspace %q in cell %q","messagePattern":"missing keyspace %q in cell %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vtctl.go","lineNumber":3590,"sourceCode":"\t}\n\tif subFlags.NArg() != 2 {\n\t\treturn errors.New(\"the <cell> and <keyspace> arguments are required for the GetSrvKeyspace command\")\n\t}\n\n\tcell := subFlags.Arg(0)\n\tkeyspace := subFlags.Arg(1)\n\n\tresp, err := wr.VtctldServer().GetSrvKeyspaces(ctx, &vtctldatapb.GetSrvKeyspacesRequest{\n\t\tKeyspace: keyspace,\n\t\tCells:    []string{cell},\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcellKs := resp.SrvKeyspaces[cell]\n\tif cellKs == nil {\n\t\treturn fmt.Errorf(\"missing keyspace %q in cell %q\", keyspace, cell)\n\t}\n\treturn printJSON(wr.Logger(), cellKs)\n}\n\nfunc commandUpdateThrottlerConfig(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) (err error) {\n\tenable := subFlags.Bool(\"enable\", false, \"Enable the throttler\")\n\tdisable := subFlags.Bool(\"disable\", false, \"Disable the throttler\")\n\tthreshold := subFlags.Float64(\"threshold\", 0, \"threshold for the either default check (replication lag seconds) or custom check\")\n\tcustomQuery := subFlags.String(\"custom-query\", \"\", \"custom throttler check query\")\n\tunthrottledApp := subFlags.String(\"unthrottle-app\", \"\", \"an app name to unthrottle\")\n\tthrottledApp := subFlags.String(\"throttle-app\", \"\", \"an app name to throttle\")\n\tthrottledAppRatio := subFlags.Float64(\"throttle-app-ratio\", throttle.DefaultThrottleRatio, \"ratio to throttle app (app specififed in --throttled-app)\")\n\tthrottledAppDuration := subFlags.Duration(\"throttle-app-duration\", throttle.DefaultAppThrottleDuration, \"duration after which throttled app rule expires (app specified in --throttled-app)\")\n\tthrottledAppExempt := subFlags.Bool(\"throttle-app-exempt\", false, \"exempt this app from being at all throttled. WARNING: use with extreme care, as this is likely to push metrics beyond the throttler's threshold, and starve other apps (app specified in --throttled-app)\")\n\tif err := subFlags.Parse(args); err != nil {\n\t\treturn err\n\t}\n\tcustomQuerySet := subFlags.Changed(\"custom-query\")","sourceCodeStart":3572,"sourceCodeEnd":3608,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vtctl.go#L3572-L3608","documentation":"GetSrvVSchema/GetKeyspace serving lookup returned the topo response, but the SrvKeyspaces map has no entry for the requested cell (nil value). The command refuses to print JSON for a missing serving-keyspace record. Indicates the keyspace has no tablets serving in that cell.","triggerScenarios":"Calling `vtctldclient GetSrvKeyspaces <keyspace> --cell <cell>` (code path at vtctl.go:3590) where resp.SrvKeyspaces[cell] is nil because no serving keyspace object exists in that cell.","commonSituations":"Querying a cell where the keyspace has no tablets; typo in --cell name; new cell added before any tablets were deployed; srv keyspace record not yet rebuilt after RefreshState.","solutions":["Verify the cell name is correct (`vtctldclient GetSrvKeyspaces` without --cell lists all)","Check tablets exist in that cell: `vtctldclient GetTablets --cell <cell>`","Rebuild the serving graph for the cell: `vtctldclient RebuildKeyspaceGraph <keyspace> --cells=<cell>`"],"exampleFix":"// before\nvtctldclient GetSrvKeyspaces commerce --cell region-us-typo\n// after\nvtctldclient GetSrvKeyspaces commerce --cell region-us-1","handlingStrategy":"validation","validationCode":"resp, err := wr.TopoServer().GetSrvKeyspaces(ctx, keyspace)\nif err == nil && (resp == nil || resp.SrvKeyspaces[cell] == nil) {\n\treturn fmt.Errorf(\"keyspace %s not serving in cell %s; run RebuildKeyspaceGraph\", keyspace, cell)\n}","typeGuard":null,"tryCatchPattern":"if err := getSrvKeyspaces(ks, cell); err != nil {\n\tif strings.Contains(err.Error(), \"missing keyspace\") {\n\t\t// fall back to listing all cells to diagnose\n\t}\n\treturn err\n}","preventionTips":["Confirm tablets exist in the target cell before querying srv keyspaces","Run RebuildKeyspaceGraph after adding a new cell","Validate cell names against the topo's Cells list in scripts"],"tags":["vtctl","topo","cell","go"],"backgroundTag":"missing-serving-keyspace","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}