{"record":{"id":"cbb8c7e4d3598479","repo":"vitessio/vitess","slug":"the-tablet-alias-argument-is-required-for-the-ru","errorCode":null,"errorMessage":"the <tablet alias> argument is required for the RunHealthCheck command","messagePattern":"the <tablet alias> argument is required for the RunHealthCheck command","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vtctl.go","lineNumber":1237,"sourceCode":"\tvar cells []string\n\tif *cellsStr != \"\" {\n\t\tcells = strings.Split(*cellsStr, \",\")\n\t}\n\n\t_, err = wr.VtctldServer().RefreshStateByShard(ctx, &vtctldatapb.RefreshStateByShardRequest{\n\t\tKeyspace: keyspace,\n\t\tShard:    shard,\n\t\tCells:    cells,\n\t})\n\treturn err\n}\n\nfunc commandRunHealthCheck(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 <tablet alias> argument is required for the RunHealthCheck command\")\n\t}\n\ttabletAlias, err := topoproto.ParseTabletAlias(subFlags.Arg(0))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = wr.VtctldServer().RunHealthCheck(ctx, &vtctldatapb.RunHealthCheckRequest{\n\t\tTabletAlias: tabletAlias,\n\t})\n\treturn err\n}\n\nfunc commandSleep(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() != 2 {\n\t\treturn errors.New(\"the <tablet alias> and <duration> arguments are required for the Sleep command\")","sourceCodeStart":1219,"sourceCodeEnd":1255,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vtctl.go#L1219-L1255","documentation":"This error is returned by the vtctl commandRunHealthCheck handler when RunHealthCheck does not receive exactly one positional argument. The command requires a <tablet alias> to trigger an immediate health check run on that specific tablet. The handler enforces the argument count before parsing the alias and dispatching the RPC.","triggerScenarios":"Running `vtctl RunHealthCheck` with zero or multiple positional arguments (NArg() != 1).","commonSituations":"Assuming the command runs cluster-wide without an alias; empty alias variable in monitoring scripts; extra tokens appended after the alias.","solutions":["Re-run with exactly one alias: `vtctl RunHealthCheck zone1-0000000100`.","Verify the alias is a single token; quote if necessary.","Ensure scripts populate the alias variable before invoking.","Run `vtctl RunHealthCheck --help` to confirm usage."],"exampleFix":"// before\nvtctl RunHealthCheck\n// after\nvtctl RunHealthCheck zone1-0000000100","handlingStrategy":"validation","validationCode":"alias=\"zone1-0000000100\"\nif [ -z \"$alias\" ] || [ $# -ne 1 ]; then\n  echo \"usage: vtctl RunHealthCheck <tablet alias>\" >&2\n  exit 2\nfi\nvtctl RunHealthCheck \"$alias\"","typeGuard":null,"tryCatchPattern":"out, err := exec.Command(\"vtctl\", \"RunHealthCheck\", alias).CombinedOutput()\nif err != nil {\n    if strings.Contains(string(out), \"argument is required for the RunHealthCheck\") {\n        return fmt.Errorf(\"RunHealthCheck takes exactly one alias arg\")\n    }\n    return err\n}","preventionTips":["Always include exactly one tablet alias; the command is per-tablet, not cluster-wide.","Check alias variables for emptiness in monitoring scripts.","Keep flags and positional args well separated.","Confirm usage with --help."],"tags":["vtctl","cli","missing-argument","health-check"],"backgroundTag":"missing-required-cli-argument","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}