{"record":{"id":"651078830e5912a5","repo":"vitessio/vitess","slug":"fromts-getknowncells-w","errorCode":null,"errorMessage":"fromTS.GetKnownCells: %w","messagePattern":"fromTS\\.GetKnownCells: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/topo/helpers/copy.go","lineNumber":120,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t\tif _, err := toTS.UpdateShardFields(ctx, keyspace, shard, func(toSI *topo.ShardInfo) error {\n\t\t\t\ttoSI.Shard = si.CloneVT()\n\t\t\t\treturn nil\n\t\t\t}); err != nil {\n\t\t\t\treturn fmt.Errorf(\"UpdateShardFields(%v, %v): %w\", keyspace, shard, err)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// CopyTablets will create the tablets in the destination topo.\nfunc CopyTablets(ctx context.Context, fromTS, toTS *topo.Server) error {\n\tcells, err := fromTS.GetKnownCells(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"fromTS.GetKnownCells: %w\", err)\n\t}\n\n\tfor _, cell := range cells {\n\t\ttabletAliases, err := fromTS.GetTabletAliasesByCell(ctx, cell)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"GetTabletsByCell(%v): %w\", cell, err)\n\t\t} else {\n\t\t\tfor _, tabletAlias := range tabletAliases {\n\t\t\t\t// read the source tablet\n\t\t\t\tti, err := fromTS.GetTablet(ctx, tabletAlias)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"GetTablet(%v): %w\", tabletAlias, err)\n\t\t\t\t}\n\n\t\t\t\t// try to create the destination\n\t\t\t\terr = toTS.CreateTablet(ctx, ti.Tablet)\n\t\t\t\tif topo.IsErrType(err, topo.NodeExists) {\n\t\t\t\t\t// update the destination tablet","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/topo/helpers/copy.go#L102-L138","documentation":"CopyTablets wraps errors from fromTS.GetKnownCells(ctx) with a 'fromTS.GetKnownCells: ' prefix. This is the entry point of tablet copying: it enumerates the cells in the source topo so tablets can be listed per cell. Failure means the source topo's cell list could not be read, so no tablets are copied and the function aborts immediately.","triggerScenarios":"Calling topo/helpers.CopyTablets(ctx, fromTS, toTS) when GetKnownCells fails: source topo server unreachable, global cell unavailable, context canceled, or a corrupt cells directory in the topo backend.","commonSituations":"Misconfigured source topo implementation (e.g. pointed at a dead etcd cluster); k8s toposerver missing RBAC to list cells; zk ensemble quorum loss; short context deadlines in migration scripts.","solutions":["Verify the source topo backend is healthy and serving the global cell.","Check topo config flags (--topo_implementation, server addresses) match the source cluster.","Increase the context timeout and retry the copy.","Inspect the wrapped error for permission issues on the cells path and fix ACLs."],"exampleFix":"// before\ncells, err := fromTS.GetKnownCells(ctx)\nif err != nil {\n\treturn fmt.Errorf(\"fromTS.GetKnownCells: %w\", err)\n}\n// after\ncells, err := fromTS.GetKnownCells(ctx)\nif err != nil {\n\treturn vterrors.Wrapf(err, vtrpcpb.Code_INTERNAL, \"fromTS.GetKnownCells\")\n}","handlingStrategy":"retry","validationCode":"if _, err := fromTS.GetKnownCells(ctx); err != nil {\n\treturn fmt.Errorf(\"source topo cells unavailable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"cells, err := fromTS.GetKnownCells(ctx)\nif err != nil {\n\tif ctx.Err() != nil {\n\t\treturn ctx.Err()\n\t}\n\treturn fmt.Errorf(\"fromTS.GetKnownCells: %w\", err)\n}","preventionTips":["Check global topo backend health before CopyTablets.","For k8s toposerver, verify RBAC allows listing cells.","Keep context deadlines proportional to cell count."],"tags":["go","topo","etcd","network"],"backgroundTag":"topo-server-unreachable","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}