vitessio/vitess · error

the <cell> argument is required for the GetCellInfo command

Error message

the <cell> argument is required for the GetCellInfo command

What it means

commandGetCellInfo fetches the CellInfo (server address, root) for a single cell and requires exactly one positional argument: the cell name. The error is returned when subFlags.NArg() != 1. It performs a strong read so users always see the latest user-generated topology data.

Source

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

		return err
	}
	if subFlags.NArg() != 0 {
		return errors.New("GetCellInfoNames command takes no parameter")
	}
	names, err := wr.TopoServer().GetCellInfoNames(ctx)
	if err != nil {
		return err
	}
	wr.Logger().Printf("%v\n", strings.Join(names, "\n"))
	return nil
}

func commandGetCellInfo(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 <cell> argument is required for the GetCellInfo command")
	}

	// We use a strong read, because users using this command want the
	// latest data, and this is user-generated, not used in any
	// automated process.
	cell := subFlags.Arg(0)
	ci, err := wr.TopoServer().GetCellInfo(ctx, cell, true /*strongRead*/)
	if err != nil {
		return err
	}
	return printJSON(wr.Logger(), ci)
}

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Re-run as `vtctldclient GetCellInfo <cell>` with exactly one positional argument
  2. Verify the shell variable holding the cell name is non-empty
  3. Use GetCellInfoNames first to list valid cell names

Example fix

// before
vtctldclient GetCellInfo
// after
vtctldclient GetCellInfo 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 GetCellInfo command")
}
cell := args[0]

Type guard

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

Try / catch

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

Prevention

When it happens

Trigger: Running `vtctldclient GetCellInfo` with no cell name, or with more than one positional argument.

Common situations: Forgetting the cell argument in ad-hoc debugging; an empty shell variable for the cell; confusing it with the no-argument GetCellInfoNames command.

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/63534c91effc2b2f. Report an issue: GitHub.