vitessio/vitess · error

failed reading tablet %v: %v

Error message

failed reading tablet %v: %v

What it means

In commandChangeTabletType's dry-run path, the tablet record is fetched from the topo server before simulating the type change. This error wraps a failed topo GetTablet call, meaning the tablet alias could not be read — usually because the tablet doesn't exist or the topo server is unavailable.

Source

Thrown at go/vt/vtctl/vtctl.go:1157

		return errors.New("the <tablet alias> and <db type> arguments are required for the ChangeTabletType command")
	}

	tabletAlias, err := topoproto.ParseTabletAlias(subFlags.Arg(0))
	if err != nil {
		return err
	}
	newType, err := parseTabletType(subFlags.Arg(1), topoproto.AllTabletTypes)
	if err != nil {
		return err
	}

	ctx, cancel := context.WithTimeout(ctx, topo.RemoteOperationTimeout)
	defer cancel()

	if *dryRun {
		ti, err := wr.TopoServer().GetTablet(ctx, tabletAlias)
		if err != nil {
			return fmt.Errorf("failed reading tablet %v: %v", tabletAlias, err)
		}
		if !topo.IsTrivialTypeChange(ti.Type, newType) {
			return fmt.Errorf("invalid type transition %v: %v -> %v", tabletAlias, ti.Type, newType)
		}
		wr.Logger().Printf("- %v\n", fmtTabletAwkable(ti))
		ti.Type = newType
		wr.Logger().Printf("+ %v\n", fmtTabletAwkable(ti))
		return nil
	}
	return wr.ChangeTabletType(ctx, tabletAlias, newType)
}

func commandPing(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {
	if err := subFlags.Parse(args); err != nil {
		return err
	}
	if subFlags.NArg() != 1 {
		return errors.New("the <tablet alias> argument is required for the Ping command")

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Verify the alias with `vtctl GetTablet <alias>` and correct it if wrong
  2. List tablets with `vtctl ListAllTablets <cell>` to find the right alias
  3. Check topo server connectivity and configuration
  4. If the tablet was removed, recreate/repair it or drop the command from the runbook

Example fix

// before
vtctl ChangeTabletType -dry-run zone1-000000100 REPLICA  # uid typo
// after
vtctl ListAllTablets zone1 | grep -i replica
vtctl ChangeTabletType -dry-run zone1-0000000100 REPLICA
Defensive patterns

Strategy: validation

Validate before calling

# Ensure the tablet alias resolves before changing type
if ! vtctl GetTablet "$ALIAS" >/dev/null 2>&1; then
  echo "tablet $ALIAS not found in topo"; exit 1
fi

Try / catch

if err := runVtctl("ChangeTabletType", "--dry-run", alias, tt); err != nil {
    if strings.Contains(err.Error(), "failed reading tablet") {
        // verify alias/topo; re-list tablets in the cell to find valid aliases
    }
}

Prevention

When it happens

Trigger: Running `vtctl ChangeTabletType --dry-run <alias> <type>` where the alias is wrong/misspelled, the tablet was deleted from the topo, or the topo server errors while reading the tablet record.

Common situations: Stale tablet alias after the tablet was decommissioned; alias built with wrong cell/uid; topo connectivity issues in CI; DNS/etcd misconfiguration.

Related errors


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