{"record":{"id":"58156d584a2ea1d6","repo":"vitessio/vitess","slug":"cells-no-recovery-contains-cell-q-which-does-no","errorCode":null,"errorMessage":"--cells-no-recovery contains cell %q which does not exist in the topology (known cells: %v)","messagePattern":"--cells-no-recovery contains cell %q which does not exist in the topology \\(known cells: (.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtorc/logic/tablet_discovery.go","lineNumber":162,"sourceCode":"\t}\n\t// Trim whitespace so that \"--cells-no-recovery=cell1, cell2\" works the\n\t// same as \"--cells-no-recovery=cell1,cell2\". pflag's StringSliceVar\n\t// splits on commas but does not strip surrounding whitespace.\n\tfor i, cell := range cellsNoRecovery {\n\t\tcellsNoRecovery[i] = strings.TrimSpace(cell)\n\t}\n\tknownCells, err := ts.GetKnownCells(ctx)\n\tif err != nil {\n\t\tlog.Warn(fmt.Sprintf(\"failed to get known cells while validating --cells-no-recovery, skipping validation: %v\", err))\n\t\treturn nil\n\t}\n\tknownCellSet := make(map[string]struct{}, len(knownCells))\n\tfor _, cell := range knownCells {\n\t\tknownCellSet[cell] = struct{}{}\n\t}\n\tfor _, cell := range cellsNoRecovery {\n\t\tif _, ok := knownCellSet[cell]; !ok {\n\t\t\treturn fmt.Errorf(\"--cells-no-recovery contains cell %q which does not exist in the topology (known cells: %v)\", cell, knownCells)\n\t\t}\n\t}\n\tcellsNoRecoveryValidated.Store(true)\n\treturn nil\n}\n\n// initializeShardsToWatch parses the --clusters_to_watch flag-value\n// into a map of keyspace/shards.\nfunc initializeShardsToWatch() error {\n\tshardsToWatch = make(map[string][]*topodatapb.KeyRange)\n\tif len(clustersToWatch) == 0 {\n\t\treturn nil\n\t}\n\n\tfor _, ks := range clustersToWatch {\n\t\tif strings.Contains(ks, \"/\") && !strings.HasSuffix(ks, \"/\") {\n\t\t\t// Validate keyspace/shard parses.\n\t\t\tk, s, err := topoproto.ParseKeyspaceShard(ks)","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtorc/logic/tablet_discovery.go#L144-L180","documentation":"At vtorc startup, the --cells-no-recovery flag lists cells where primary health recovery should not run. validateCellsNoRecovery cross-checks every listed cell against the cells known to the topology and fails fast if any cell does not exist, including the known cell list in the message.","triggerScenarios":"OpenTabletDiscovery -> validateCellsNoRecovery when a cell named in --cells-no-recovery is absent from topo.GetKnownCells — typically a typo, a decommissioned cell, or a vtorc instance connected to a different topo than the cells belong to.","commonSituations":"Copy-pasting vtorc config between environments (staging vs prod cells), renaming cells during a datacenter migration, or stale flag values left after cell removal.","solutions":["List actual cells: vtctl --topo_implementation ... GetCellsInfo (or topo GetKnownCells) and correct --cells-no-recovery to match exactly","Remove decommissioned cells from the flag","Verify vtorc is connected to the correct topology (global vs local) — the cells must exist in the topo vtorc reads","Restart vtorc after fixing the flag; validation is re-run at OpenTabletDiscovery"],"exampleFix":"// before\n--cells-no-recovery zone1,zone2,zone3   # zone3 does not exist\n// after\n--cells-no-recovery zone1,zone2","handlingStrategy":"validation","validationCode":"# Validate --cells-no-recovery against the topology before starting vtorc\nKNOWN=$(vtctldclient GetCellsInfo 2>/dev/null | awk '{print $1}')\nfor cell in $(echo \"$CELLS_NO_RECOVERY\" | tr ',' ' '); do\n  if ! echo \"$KNOWN\" | grep -qx \"$cell\"; then\n    echo \"cell $cell not in topology\"; exit 1\n  fi\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate --cells-no-recovery from topo queries instead of hardcoding it","Remove cells from the flag as part of cell decommissioning runbooks","Keep per-environment vtorc configs separate; don't copy flags across envs","Check the error message's 'known cells' list — it tells you the exact valid values"],"tags":["vtorc","configuration","topology","cells"],"backgroundTag":"unknown-topology-cell","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}