{"record":{"id":"f4d1f757c059df8c","repo":"vitessio/vitess","slug":"workflow-has-to-be-defined-for-action-s","errorCode":null,"errorMessage":"workflow has to be defined for action %s","messagePattern":"workflow has to be defined for action (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vtctl.go","lineNumber":3749,"sourceCode":"\t\treturn err\n\t}\n\tif subFlags.NArg() < 2 {\n\t\treturn errors.New(usage)\n\t}\n\tif len(*shards) > 0 {\n\t\tlog.Info(fmt.Sprintf(\"Subset of shards specified: %d, %v\", len(*shards), strings.Join(*shards, \",\")))\n\t}\n\tkeyspace := subFlags.Arg(0)\n\taction := strings.ToLower(subFlags.Arg(1))\n\tvar workflow string\n\tvar err error\n\tif action != \"listall\" {\n\t\tkeyspace, workflow, err = splitKeyspaceWorkflow(subFlags.Arg(0))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif workflow == \"\" {\n\t\t\treturn fmt.Errorf(\"workflow has to be defined for action %s\", action)\n\t\t}\n\t}\n\t_, err = wr.TopoServer().GetKeyspace(ctx, keyspace)\n\tif err != nil {\n\t\twr.Logger().Errorf(\"Keyspace %s not found\", keyspace)\n\t}\n\tvar results map[*topo.TabletInfo]*sqltypes.Result\n\tif action == \"tags\" {\n\t\ttags := \"\"\n\t\tif subFlags.NArg() != 3 {\n\t\t\treturn errors.New(\"tags incorrectly specified, usage: Workflow keyspace.workflow tags <tags>\")\n\t\t}\n\t\ttags = strings.ToLower(subFlags.Arg(2))\n\t\tresults, err = wr.WorkflowTagAction(ctx, keyspace, workflow, tags)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {","sourceCodeStart":3731,"sourceCodeEnd":3767,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vtctl.go#L3731-L3767","documentation":"WorkflowCommands (Migration/Reshard/MoveTables type operations) requires a workflow name for every action except 'listall'. splitKeyspaceWorkflow succeeded but the workflow part was empty, so the command fails fast with this message.","triggerScenarios":"Running `vtctldclient Workflow <action> <keyspace>` (no /workflow suffix) for any action other than listall, e.g. `vtctldclient Workflow show commerce` instead of `Workflow show commerce/reshard1`.","commonSituations":"Forgetting the `/workflow` component of the argument; assuming the keyspace has a single implicit workflow; shell scripts stripping the part after a slash.","solutions":["Pass the workflow in the argument: `<keyspace>/<workflow>`","Use `listall` action first to discover workflow names: `vtctldclient Workflow listall commerce`","Fix the calling script to always include the workflow name"],"exampleFix":"// before\nvtctldclient Workflow status commerce\n// after\nvtctldclient Workflow status commerce/reshard1","handlingStrategy":"validation","validationCode":"keyspace, workflow, err := splitKeyspaceWorkflow(arg)\nif err != nil || (action != \"listall\" && workflow == \"\") {\n\treturn fmt.Errorf(\"use <keyspace>/<workflow> for action %s\", action)\n}","typeGuard":null,"tryCatchPattern":"if err := workflowAction(action, arg); err != nil {\n\tif strings.Contains(err.Error(), \"workflow has to be defined\") {\n\t\treturn fmt.Errorf(\"list workflows first: vtctldclient Workflow listall %s\", keyspace)\n\t}\n\treturn err\n}","preventionTips":["Discover workflow names with listall before other actions","Always pass the full <keyspace>/<workflow> identifier in scripts","Quote slash-containing args in shell to avoid word-splitting issues"],"tags":["vtctl","workflow","cli","go"],"backgroundTag":"missing-required-argument","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}