{"record":{"id":"a2c79db00ed790c8","repo":"vitessio/vitess","slug":"action-startreplication-requires-tablet-alias","errorCode":null,"errorMessage":"action StartReplication requires <tablet alias>","messagePattern":"action StartReplication requires <tablet alias>","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vtctl.go","lineNumber":1099,"sourceCode":"\t}\n\n\ttabletAlias, err := topoproto.ParseTabletAlias(subFlags.Arg(0))\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = wr.VtctldServer().SetWritable(ctx, &vtctldatapb.SetWritableRequest{\n\t\tTabletAlias: tabletAlias,\n\t\tWritable:    true,\n\t})\n\treturn err\n}\n\nfunc commandStartReplication(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(\"action StartReplication requires <tablet alias>\")\n\t}\n\n\ttabletAlias, err := topoproto.ParseTabletAlias(subFlags.Arg(0))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = wr.VtctldServer().StartReplication(ctx, &vtctldatapb.StartReplicationRequest{\n\t\tTabletAlias: tabletAlias,\n\t})\n\treturn err\n}\n\nfunc commandStopReplication(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 {","sourceCodeStart":1081,"sourceCodeEnd":1117,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vtctl.go#L1081-L1117","documentation":"This error comes from the vtctl commandStartReplication handler when StartReplication is not given exactly one positional argument. StartReplication needs the <tablet alias> of the replica tablet on which to begin replicating from its source. Each vtctl command handler validates its own argument count, so an incorrect count fails immediately before any RPC is issued.","triggerScenarios":"Running `vtctl StartReplication` with no arguments or with more than one positional argument. subFlags.NArg() != 1 produces the error.","commonSituations":"Scripted replication setup where the tablet alias variable is empty; passing extra words like the keyspace alongside the alias; copy-pasting a command line where the alias was dropped.","solutions":["Re-run with exactly one alias: `vtctl StartReplication zone1-0000000101`.","Confirm the alias format (cell-uid, e.g. zone1-0000000101) is passed as a single token.","Verify any shell variable interpolating the alias is set and unquoted-empty is avoided.","Consult `vtctl StartReplication --help`."],"exampleFix":"// before\nvtctl StartReplication\n// after\nvtctl StartReplication zone1-0000000101","handlingStrategy":"validation","validationCode":"alias=\"zone1-0000000101\"\nif [ -z \"$alias\" ] || [ $# -ne 1 ]; then\n  echo \"usage: vtctl StartReplication <tablet alias>\" >&2\n  exit 2\nfi\nvtctl StartReplication \"$alias\"","typeGuard":null,"tryCatchPattern":"out, err := exec.Command(\"vtctl\", \"StartReplication\", alias).CombinedOutput()\nif err != nil {\n    if strings.Contains(string(out), \"requires <tablet alias>\") {\n        return fmt.Errorf(\"StartReplication needs exactly one alias arg; got argv: %v\", os.Args)\n    }\n    return err\n}","preventionTips":["Pass exactly one positional argument (the tablet alias) — no keyspace, no extra tokens.","Check alias variables for emptiness in automation before calling vtctl.","Keep flags separate from positional args and well-formed.","Validate the alias format (cell-uid) before running."],"tags":["vtctl","cli","missing-argument","replication"],"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"}