{"record":{"id":"570f27fc08889c85","repo":"vitessio/vitess","slug":"gettabletsbycell-v-failed-v","errorCode":null,"errorMessage":"GetTabletsByCell(%v) failed: %v","messagePattern":"GetTabletsByCell\\((.+?)\\) failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/wrangler/shard.go","lineNumber":99,"sourceCode":"\t}\n\n\t// Go through all the cells.\n\tfor _, cell := range cells {\n\t\tvar aliases []*topodatapb.TabletAlias\n\n\t\t// Get the ShardReplication object for that cell. Try\n\t\t// to find all tablets that may belong to our shard.\n\t\tsri, err := wr.ts.GetShardReplication(ctx, cell, keyspace, shard)\n\t\tswitch {\n\t\tcase topo.IsErrType(err, topo.NoNode):\n\t\t\t// No ShardReplication object. It means the\n\t\t\t// topo is inconsistent. Let's read all the\n\t\t\t// tablets for that cell, and if we find any\n\t\t\t// in our keyspace / shard, either abort or\n\t\t\t// try to delete them.\n\t\t\taliases, err = wr.ts.GetTabletAliasesByCell(ctx, cell)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"GetTabletsByCell(%v) failed: %v\", cell, err)\n\t\t\t}\n\t\tcase err == nil:\n\t\t\t// We found a ShardReplication object. We\n\t\t\t// trust it to have all tablet records.\n\t\t\taliases = make([]*topodatapb.TabletAlias, len(sri.Nodes))\n\t\t\tfor i, n := range sri.Nodes {\n\t\t\t\taliases[i] = n.TabletAlias\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"GetShardReplication(%v, %v, %v) failed: %v\", cell, keyspace, shard, err)\n\t\t}\n\n\t\t// Get the corresponding Tablet records. Note\n\t\t// GetTabletMap ignores ErrNoNode, and it's good for\n\t\t// our purpose, it means a tablet was deleted but is\n\t\t// still referenced.\n\t\ttabletMap, err := wr.ts.GetTabletMap(ctx, aliases, nil)\n\t\tif err != nil {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/wrangler/shard.go#L81-L117","documentation":"During DeleteShard, when the ShardReplication object for a cell is missing (topo inconsistency), the code falls back to listing all tablet aliases in that cell via GetTabletAliasesByCell to find tablets belonging to the keyspace/shard. This error wraps a failure of that fallback listing - the cell's tablet list could not be read from the topo server.","triggerScenarios":"ShardReplication is missing for a cell (fallback path triggers) AND GetTabletAliasesByCell fails for that cell - topo server outage, invalid cell alias, or the cell being unreachable.","commonSituations":"Partially torn-down cell whose ShardReplication nodes were deleted but the cell is still listed; etcd/zk connectivity problems to that cell; typo'd or decommissioned cell name in the shard's cell list.","solutions":["Check connectivity/health of the topo server for the failing cell.","Verify the cell name is valid and still registered (vtctldclient GetCellInfo <cell>).","Repair or manually clean the inconsistent ShardReplication state, then retry DeleteShard."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if _, err := ts.GetCellInfoNames(ctx); err != nil {\n    return fmt.Errorf(\"topo cells unreadable: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"err := wr.DeleteShard(ctx, keyspace, shard, evenIfServing, recursive)\nif err != nil && strings.Contains(err.Error(), \"GetTabletsByCell\") {\n    // check topo health for that cell, retry\n}","preventionTips":["Verify all cells' topo servers are reachable before multi-cell cleanup.","Keep ShardReplication objects consistent with actual tablets.","Remove decommissioned cells from shard cell lists promptly."],"tags":["go","topology","cell","inconsistency"],"backgroundTag":"topo-node-missing","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}