vitessio/vitess · error
the <tablet alias> and <duration> arguments are required for
Error message
the <tablet alias> and <duration> arguments are required for the Sleep command
What it means
This error is raised by the vtctl commandSleep handler when the Sleep command is not given exactly two positional arguments: a <tablet alias> and a <duration> (Go duration string like 1m30s). Sleep instructs the tablet to pause serving the given duration, mainly for testing. The handler enforces NArg() == 2 before parsing the alias and duration.
Source
Thrown at go/vt/vtctl/vtctl.go:1255
return errors.New("the <tablet alias> argument is required for the RunHealthCheck command")
}
tabletAlias, err := topoproto.ParseTabletAlias(subFlags.Arg(0))
if err != nil {
return err
}
_, err = wr.VtctldServer().RunHealthCheck(ctx, &vtctldatapb.RunHealthCheckRequest{
TabletAlias: tabletAlias,
})
return err
}
func commandSleep(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {
if err := subFlags.Parse(args); err != nil {
return err
}
if subFlags.NArg() != 2 {
return errors.New("the <tablet alias> and <duration> arguments are required for the Sleep command")
}
tabletAlias, err := topoproto.ParseTabletAlias(subFlags.Arg(0))
if err != nil {
return err
}
duration, err := time.ParseDuration(subFlags.Arg(1))
if err != nil {
return err
}
_, err = wr.VtctldServer().SleepTablet(ctx, &vtctldatapb.SleepTabletRequest{
TabletAlias: tabletAlias,
Duration: protoutil.DurationToProto(duration),
})
return err
}
func commandExecuteFetchAsApp(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {View on GitHub (pinned to 01a25a7d17)
Solutions
- Re-run with both arguments as single tokens: `vtctl Sleep zone1-0000000100 30s`.
- Use Go duration syntax without spaces (30s, 5m, 1h30m).
- Quote the duration if your shell interprets it oddly.
- Check `vtctl Sleep --help` for accepted formats.
Example fix
// before vtctl Sleep zone1-0000000100 // after vtctl Sleep zone1-0000000100 30s
Defensive patterns
Strategy: validation
Validate before calling
alias="zone1-0000000100" duration="30s" if [ -z "$alias" ] || [ -z "$duration" ] || [ $# -ne 2 ]; then echo "usage: vtctl Sleep <tablet alias> <duration>" >&2 exit 2 fi vtctl Sleep "$alias" "$duration"
Try / catch
out, err := exec.Command("vtctl", "Sleep", alias, duration).CombinedOutput()
if err != nil {
if strings.Contains(string(out), "Sleep command") {
return fmt.Errorf("need exactly 2 args (alias, duration like 30s)")
}
return err
} Prevention
- Pass exactly two positional args: alias then a Go-style duration (30s, 5m).
- Never put spaces inside the duration (use 1h30m, not "1 h 30 m").
- Quote the duration token in scripts.
- Validate duration format with a regex before invoking.
When it happens
Trigger: Running `vtctl Sleep` with fewer than two arguments (alias only or nothing) or more than two. NArg() != 2 triggers the error.
Common situations: Passing the duration with a space inside (e.g. `1 m`) so it splits into two tokens making NArg()==3; forgetting the duration; scripts missing one variable.
Related errors
- the <tablet alias> argument is required for the SetReadWrite
- action StartReplication requires <tablet alias>
- action StopReplication requires <tablet alias>
- the <tablet alias> and <db type> arguments are required for
- the <tablet alias> argument is required for the Ping command
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/209d5a1f451d2d67.
Report an issue: GitHub.