vitessio/vitess · error

fromTS.GetKnownCells: %w

Error message

fromTS.GetKnownCells: %w

What it means

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.

Source

Thrown at go/vt/topo/helpers/copy.go:120

				}
			}
			if _, err := toTS.UpdateShardFields(ctx, keyspace, shard, func(toSI *topo.ShardInfo) error {
				toSI.Shard = si.CloneVT()
				return nil
			}); err != nil {
				return fmt.Errorf("UpdateShardFields(%v, %v): %w", keyspace, shard, err)
			}
		}
	}

	return nil
}

// CopyTablets will create the tablets in the destination topo.
func CopyTablets(ctx context.Context, fromTS, toTS *topo.Server) error {
	cells, err := fromTS.GetKnownCells(ctx)
	if err != nil {
		return fmt.Errorf("fromTS.GetKnownCells: %w", err)
	}

	for _, cell := range cells {
		tabletAliases, err := fromTS.GetTabletAliasesByCell(ctx, cell)
		if err != nil {
			return fmt.Errorf("GetTabletsByCell(%v): %w", cell, err)
		} else {
			for _, tabletAlias := range tabletAliases {
				// read the source tablet
				ti, err := fromTS.GetTablet(ctx, tabletAlias)
				if err != nil {
					return fmt.Errorf("GetTablet(%v): %w", tabletAlias, err)
				}

				// try to create the destination
				err = toTS.CreateTablet(ctx, ti.Tablet)
				if topo.IsErrType(err, topo.NodeExists) {
					// update the destination tablet

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Verify the source topo backend is healthy and serving the global cell.
  2. Check topo config flags (--topo_implementation, server addresses) match the source cluster.
  3. Increase the context timeout and retry the copy.
  4. Inspect the wrapped error for permission issues on the cells path and fix ACLs.

Example fix

// before
cells, err := fromTS.GetKnownCells(ctx)
if err != nil {
	return fmt.Errorf("fromTS.GetKnownCells: %w", err)
}
// after
cells, err := fromTS.GetKnownCells(ctx)
if err != nil {
	return vterrors.Wrapf(err, vtrpcpb.Code_INTERNAL, "fromTS.GetKnownCells")
}
Defensive patterns

Strategy: retry

Validate before calling

if _, err := fromTS.GetKnownCells(ctx); err != nil {
	return fmt.Errorf("source topo cells unavailable: %w", err)
}

Try / catch

cells, err := fromTS.GetKnownCells(ctx)
if err != nil {
	if ctx.Err() != nil {
		return ctx.Err()
	}
	return fmt.Errorf("fromTS.GetKnownCells: %w", err)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/651078830e5912a5. Report an issue: GitHub.