vitessio/vitess · error
--dry_run is only supported for SwitchTraffic, ReverseTraffi
Error message
--dry_run is only supported for SwitchTraffic, ReverseTraffic and Complete, not for %s
What it means
The --dry_run flag is only meaningful for the SwitchTraffic, ReverseTraffic, and Complete actions of a vreplication workflow. Passing --dry_run with any other action is rejected so users are not misled into thinking a preview occurred. The error names the actual action that was given.
Source
Thrown at go/vt/vtctl/vtctl.go:2386
}
if progress.SourceTableSize > 0 {
tableSizePct = 100.0 * progress.TargetTableSize / progress.SourceTableSize
}
fmt.Fprintf(&sSb2360, "%s: rows copied %d/%d (%d%%), size copied %d/%d (%d%%)\n",
table, progress.TargetRowCount, progress.SourceRowCount, rowCountPct,
progress.TargetTableSize, progress.SourceTableSize, tableSizePct)
}
s += sSb2360.String()
wr.Logger().Printf("\n%s\n", s)
}
return printDetails()
}
if *dryRun {
switch action {
case vReplicationWorkflowActionSwitchTraffic, vReplicationWorkflowActionReverseTraffic, vReplicationWorkflowActionComplete:
default:
return fmt.Errorf("--dry_run is only supported for SwitchTraffic, ReverseTraffic and Complete, not for %s", originalAction)
}
}
wr.WorkflowParams = vrwp
switch vrwp.WorkflowType {
case wrangler.MoveTablesWorkflow:
// If this is not a partial MoveTables, SourceShards is nil and all shards will be polled.
shardsWithStreams = vrwp.SourceShards
case wrangler.ReshardWorkflow:
shardsWithStreams = vrwp.TargetShards
default:
}
wr.WorkflowParams = vrwp
var dryRunResults *[]string
startState := wf.CachedState()
switch action {View on GitHub (pinned to 01a25a7d17)
Solutions
- Remove --dry_run for this action
- Restrict dry-run usage to SwitchTraffic, ReverseTraffic, or Complete actions
- Preview the change another way, e.g. inspect workflow state with `show`
Example fix
// before vtctldclient Reshard cancel commerce.reshard --dry_run // after vtctldclient Reshard complete commerce.reshard --dry_run # or drop --dry_run for cancel
Defensive patterns
Strategy: validation
Validate before calling
dryRunAllowed := map[string]bool{"switchtraffic": true, "reversetraffic": true, "complete": true}
if dryRun && !dryRunAllowed[action] {
// drop --dry_run or change action
} Prevention
- Only attach --dry_run to SwitchTraffic/ReverseTraffic/Complete invocations
- Keep dry-run and live-action script templates separate
When it happens
Trigger: `vtctldclient ... create --dry_run`, `cancel --dry_run`, `show --dry_run`, etc.; scripted dry-run attempts against StartTraffic/StopTraffic or Cancel actions.
Common situations: Users assuming dry-run is universally supported across workflow actions; converting a SwitchTraffic dry-run script to a Cancel action while keeping the flag.
Related errors
- invalid --limit value (%d), maximum number of rows to compar
- invalid format for external source cluster: %s
- invalid value for on-ddl: %v
- invalid action for Migrate: %s
- unknown workflow type passed: %v
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/2524793836160748.
Report an issue: GitHub.