vitessio/vitess · error

the <cell> argument is required for the DeleteCellInfo comma

Error message

the <cell> argument is required for the DeleteCellInfo command

What it means

commandDeleteCellInfo requires exactly one positional argument: the name of the cell whose CellInfo record should be removed from the global topology. The error is returned when subFlags.NArg() != 1. A --force flag exists to proceed even when the cell's topology server is unreachable, but the cell name itself is always required.

Source

Thrown at go/vt/vtctl/cell_info.go:123

	cell := subFlags.Arg(0)

	_, err := wr.VtctldServer().UpdateCellInfo(ctx, &vtctldatapb.UpdateCellInfoRequest{
		Name: cell,
		CellInfo: &topodatapb.CellInfo{
			ServerAddress: *serverAddress,
			Root:          *root,
		},
	})
	return err
}

func commandDeleteCellInfo(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {
	force := subFlags.Bool("force", false, "Proceeds even if the cell's topology server cannot be reached. The assumption is that you turned down the entire cell, and just need to update the global topo data.")
	if err := subFlags.Parse(args); err != nil {
		return err
	}
	if subFlags.NArg() != 1 {
		return errors.New("the <cell> argument is required for the DeleteCellInfo command")
	}
	cell := subFlags.Arg(0)

	_, err := wr.VtctldServer().DeleteCellInfo(ctx, &vtctldatapb.DeleteCellInfoRequest{
		Name:  cell,
		Force: *force,
	})
	return err
}

func commandGetCellInfoNames(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {
	if err := subFlags.Parse(args); err != nil {
		return err
	}
	if subFlags.NArg() != 0 {
		return errors.New("GetCellInfoNames command takes no parameter")
	}
	names, err := wr.TopoServer().GetCellInfoNames(ctx)

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Re-run as `vtctldclient DeleteCellInfo [--force] <cell>` with exactly one positional argument
  2. Check the script variable holding the cell name is not empty
  3. Use --force (flag form) rather than passing extra positional words

Example fix

// before
vtctldclient DeleteCellInfo --force
// after
vtctldclient DeleteCellInfo --force zone1
Defensive patterns

Strategy: validation

Validate before calling

args := flagSet.Args()
if len(args) != 1 {
    return errors.New("the <cell> argument is required for the DeleteCellInfo command")
}
cell := args[0]

Type guard

func hasExactlyOneArg(args []string) bool { return len(args) == 1 }

Try / catch

if err := commandDeleteCellInfo(ctx, wr, subFlags, args); err != nil {
    if strings.Contains(err.Error(), "the <cell> argument is required") {
        log.Printf("usage: DeleteCellInfo [--force] <cell>")
    }
    return err
}

Prevention

When it happens

Trigger: Running `vtctldclient DeleteCellInfo` with no positional argument, or with more than one, e.g. extra stray tokens after flags.

Common situations: Scripted teardown of a decommissioned cell where the cell variable was empty; copy-pasting the --force example and omitting <cell>; accidentally passing 'force' as a positional argument instead of the flag.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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