{"record":{"id":"4bf5eb60f5c23b72","repo":"vitessio/vitess","slug":"the-alias-argument-is-required-for-the-deletecel","errorCode":null,"errorMessage":"the <alias> argument is required for the DeleteCellsAlias command","messagePattern":"the <alias> argument is required for the DeleteCellsAlias command","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/cells_aliases.go","lineNumber":117,"sourceCode":"\t\t(*cells)[i] = strings.TrimSpace(cell)\n\t}\n\n\talias := subFlags.Arg(0)\n\t_, err := wr.VtctldServer().UpdateCellsAlias(ctx, &vtctldatapb.UpdateCellsAliasRequest{\n\t\tName: alias,\n\t\tCellsAlias: &topodatapb.CellsAlias{\n\t\t\tCells: *cells,\n\t\t},\n\t})\n\treturn err\n}\n\nfunc commandDeleteCellsAlias(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 <alias> argument is required for the DeleteCellsAlias command\")\n\t}\n\talias := subFlags.Arg(0)\n\n\t_, err := wr.VtctldServer().DeleteCellsAlias(ctx, &vtctldatapb.DeleteCellsAliasRequest{\n\t\tName: alias,\n\t})\n\treturn err\n}\n\nfunc commandGetCellsAliases(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(\"GetCellsAliases command takes no parameter\")\n\t}\n\taliases, err := wr.TopoServer().GetCellsAliases(ctx, true /*strongRead*/)\n\tif err != nil {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/cells_aliases.go#L99-L135","documentation":"Returned by the DeleteCellsAlias vtctl command when no <alias> argument is given. The alias identifies the CellsAlias object to delete from the topology, so it must be provided.","triggerScenarios":"Running `vtctldclient DeleteCellsAlias` with no alias, or with extra positional arguments.","commonSituations":"Empty alias variable in decommissioning scripts; passing cell names after the alias thinking they must be listed; confusing this with DeleteCellInfo (different command, different object).","solutions":["Re-run as `vtctldclient DeleteCellsAlias <alias>` with exactly one positional argument","Verify you are targeting the alias, not a cell — DeleteCellInfo is the cell-level command"],"exampleFix":"// before\nvtctldclient DeleteCellsAlias\n// after\nvtctldclient DeleteCellsAlias dcalias","handlingStrategy":"validation","validationCode":"args := flagSet.Args()\nif len(args) != 1 {\n    return errors.New(\"the <alias> argument is required for the DeleteCellsAlias command\")\n}\nalias := args[0]","typeGuard":"func hasExactlyOneArg(args []string) bool { return len(args) == 1 }","tryCatchPattern":"if err := commandDeleteCellsAlias(ctx, wr, subFlags, args); err != nil {\n    if strings.Contains(err.Error(), \"the <alias> argument is required\") {\n        log.Printf(\"usage: DeleteCellsAlias <alias>\")\n    }\n    return err\n}","preventionTips":["Pass only the alias — never list member cells positionally","Do not confuse with DeleteCellInfo which takes a cell name","Confirm the alias variable is non-empty in teardown scripts"],"tags":["cli","argument-validation","topology","cells-alias"],"backgroundTag":"missing-required-argument","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}