{"record":{"id":"469f6284b05a55fd","repo":"vitessio/vitess","slug":"getcellinfonames-command-takes-no-parameter","errorCode":null,"errorMessage":"GetCellInfoNames command takes no parameter","messagePattern":"GetCellInfoNames command takes no parameter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/cell_info.go","lineNumber":139,"sourceCode":"\t}\n\tif subFlags.NArg() != 1 {\n\t\treturn errors.New(\"the <cell> argument is required for the DeleteCellInfo command\")\n\t}\n\tcell := subFlags.Arg(0)\n\n\t_, err := wr.VtctldServer().DeleteCellInfo(ctx, &vtctldatapb.DeleteCellInfoRequest{\n\t\tName:  cell,\n\t\tForce: *force,\n\t})\n\treturn err\n}\n\nfunc commandGetCellInfoNames(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {\n\tif err := subFlags.Parse(args); err != nil {\n\t\treturn err\n\t}\n\tif subFlags.NArg() != 0 {\n\t\treturn errors.New(\"GetCellInfoNames command takes no parameter\")\n\t}\n\tnames, err := wr.TopoServer().GetCellInfoNames(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\twr.Logger().Printf(\"%v\\n\", strings.Join(names, \"\\n\"))\n\treturn nil\n}\n\nfunc commandGetCellInfo(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {\n\tif err := subFlags.Parse(args); err != nil {\n\t\treturn err\n\t}\n\tif subFlags.NArg() != 1 {\n\t\treturn errors.New(\"the <cell> argument is required for the GetCellInfo command\")\n\t}\n\n\t// We use a strong read, because users using this command want the","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/cell_info.go#L121-L157","documentation":"Returned by the GetCellInfoNames vtctl command when the caller supplies arguments. GetCellInfoNames lists all cell names stored in the topology and accepts no parameters; passing any argument is a client-side usage error.","triggerScenarios":"Running `vtctldclient GetCellInfoNames <something>` — any extra positional token triggers the error.","commonSituations":"Confusing GetCellInfoNames with GetCellInfo (which does take a <cell> argument) and passing a cell name; a script appending a leftover argument.","solutions":["Re-run with no positional arguments: `vtctldclient GetCellInfoNames`","If you intended to fetch one cell's details, use `GetCellInfo <cell>` instead"],"exampleFix":"// before\nvtctldclient GetCellInfoNames zone1\n// after\nvtctldclient GetCellInfoNames","handlingStrategy":"validation","validationCode":"args := flagSet.Args()\nif len(args) != 0 {\n    return errors.New(\"GetCellInfoNames command takes no parameter\")\n}","typeGuard":"func takesNoArgs(args []string) bool { return len(args) == 0 }","tryCatchPattern":"if err := commandGetCellInfoNames(ctx, wr, subFlags, args); err != nil {\n    if strings.Contains(err.Error(), \"takes no parameter\") {\n        log.Printf(\"usage: GetCellInfoNames (no arguments)\")\n    }\n    return err\n}","preventionTips":["Do not confuse GetCellInfoNames (no args) with GetCellInfo <cell> (one arg)","Strip stray arguments before invoking in shell pipelines"],"tags":["cli","argument-validation","topology","vtctldclient"],"backgroundTag":"unexpected-argument","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}