vitessio/vitess · error
workflow %s does not exist
Error message
workflow %s does not exist
What it means
Before executing a vreplication workflow action, the code builds a VReplicationWorkflow object and checks wf.Exists(). If the workflow does not exist in the target keyspace and the requested action is anything other than 'create', the command fails. This guards actions like SwitchTraffic, Complete, or Cancel against operating on a nonexistent workflow.
Source
Thrown at go/vt/vtctl/vtctl.go:2337
case wrangler.MoveTablesWorkflow:
vrwp.RenameTables = *renameTables
case wrangler.ReshardWorkflow:
case wrangler.MigrateWorkflow:
default:
return fmt.Errorf("unknown workflow type passed: %v", workflowType)
}
vrwp.KeepData = *keepData
vrwp.KeepRoutingRules = *keepRoutingRules
}
vrwp.WorkflowType = workflowType
vrwp.ShardSubset = *shards
wf, err := wr.NewVReplicationWorkflow(ctx, workflowType, vrwp)
if err != nil {
log.Warn(fmt.Sprintf("NewVReplicationWorkflow returned error %+v", wf))
return err
}
if !wf.Exists() && action != vReplicationWorkflowActionCreate {
return fmt.Errorf("workflow %s does not exist", ksWorkflow)
}
if len(vrwp.ShardSubset) > 0 {
if workflowType == wrangler.MoveTablesWorkflow && action != vReplicationWorkflowActionCreate && wf.IsPartialMigration() {
log.Info(fmt.Sprintf("Subset of shards: %s have been specified for keyspace %s, workflow %s, for action %s", vrwp.ShardSubset, target, workflowName, action))
} else {
return errors.New("The --shards option can only be specified for existing Partial MoveTables workflows")
}
}
printCopyProgress := func() error {
copyProgress, err := wf.GetCopyProgress()
if err != nil {
return err
}
if copyProgress != nil {
wr.Logger().Printf("\nCopy Progress (approx):\n")
var tables []stringView on GitHub (pinned to 01a25a7d17)
Solutions
- List existing workflows with `vtctldclient workflow --keyspace <ks> list` to confirm the exact name and keyspace
- Correct the <keyspace.workflow> argument spelling/case
- If the workflow already completed, no further action is needed — skip the command
- Use `create` action first if you intended to start the workflow
Example fix
// before vtctldclient Reshard complete commerce.reshard01 # workflow never created // after vtctldclient Reshard create --targetks commerce --tablesc.customer,commerce.corder ...
Defensive patterns
Strategy: validation
Validate before calling
workflows, err := vtctldclient workflow --keyspace commerce list // confirm the target workflow name exists before running the action
Type guard
func keyspaceWorkflowArg(ks, wf string) string {
if ks == "" || wf == "" || strings.ContainsAny(wf, ".") { return "" }
return ks + "." + wf
} Try / catch
out, err := runVtctldclient(args...)
if err != nil && strings.Contains(out, "does not exist") {
// verify workflow name/keyspace, or treat as already-cleaned-up
} Prevention
- List workflows before acting on them
- Record workflow names consistently after create
- Remember Complete/Cancel are often one-shot — don't re-run
When it happens
Trigger: Running e.g. `vtctldclient Reshard complete ks.reshard` when no reshard workflow named `reshard` exists in keyspace `ks`; mistyping the workflow name; the workflow was already fully removed (completed and garbage-collected) in a prior invocation; targeting the wrong keyspace.
Common situations: Re-running a Complete/Cancel step after it already succeeded and cleaned up; wrong keyspace.workflow string; workflow name case mismatch; reshard was never started.
Related errors
- unknown workflow type passed: %v
- value out of range
- both atomic copy and partial mode cannot be specified for th
- invalid workflow
- multiple source keyspaces for a single workflow
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/795a27271ba0f4c3.
Report an issue: GitHub.