{"record":{"id":"2bc91ed6b1c2cad5","repo":"vitessio/vitess","slug":"found-unsupported-action-s","errorCode":null,"errorMessage":"found unsupported action %s","messagePattern":"found unsupported action (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vtctl.go","lineNumber":2491,"sourceCode":"\t\t\t\tfor _, wfErr := range wfErrs {\n\t\t\t\t\twr.Logger().Printf(\"\\tTablet: %d, Id: %d :: %s\\n\", wfErr.Tablet, wfErr.ID, wfErr.Description)\n\t\t\t\t}\n\t\t\t\treturn errors.New(\"errors starting workflow\")\n\t\t\t}\n\t\t}\n\tcase vReplicationWorkflowActionSwitchTraffic:\n\t\tdryRunResults, err = wf.SwitchTraffic(workflow.DirectionForward)\n\tcase vReplicationWorkflowActionReverseTraffic:\n\t\tdryRunResults, err = wf.ReverseTraffic()\n\tcase vReplicationWorkflowActionComplete:\n\t\tdryRunResults, err = wf.Complete()\n\tcase vReplicationWorkflowActionCancel:\n\t\terr = wf.Cancel()\n\tcase vReplicationWorkflowActionGetState:\n\t\twr.Logger().Printf(wf.CachedState() + \"\\n\")\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"found unsupported action %s\", originalAction)\n\t}\n\tif err != nil {\n\t\tlog.Warn(fmt.Sprintf(\" %s error: %v\", originalAction, wf))\n\t\treturn wrapError(wf, err)\n\t}\n\tif *dryRun {\n\t\tif len(*dryRunResults) > 0 {\n\t\t\twr.Logger().Printf(\"Dry Run results for %s run at %s\\nParameters: %s\\n\\n\", originalAction, time.Now().Format(time.RFC822), strings.Join(args, \" \"))\n\t\t\twr.Logger().Printf(\"%s\\n\", strings.Join(*dryRunResults, \"\\n\"))\n\t\t\treturn nil\n\t\t}\n\t}\n\twr.Logger().Printf(\"%s was successful for workflow %s.%s\\nStart State: %s\\nCurrent State: %s\\n\\n\",\n\t\toriginalAction, vrwp.TargetKeyspace, vrwp.Workflow, startState, wf.CurrentState())\n\treturn nil\n}\n\nfunc commandCreateLookupVindex(ctx context.Context, wr *wrangler.Wrangler, subFlags *pflag.FlagSet, args []string) error {","sourceCodeStart":2473,"sourceCodeEnd":2509,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vtctl.go#L2473-L2509","documentation":"After normalizing aliases (e.g. 'completed' to 'complete'), the action string must map to one of the implemented vreplication workflow actions in the switch statement. An action string that falls through all cases reaches the default branch and errors. The error quotes the original (pre-normalization) action the user supplied.","triggerScenarios":"Typo in the action, e.g. `vtctldclient Reshard complet`, `swichtraffic`, `canel`; passing a verb that exists in other tools but not here; shell scripts interpolating an empty or garbled action token.","commonSituations":"Shell script variable typo; migrating from older vtctlclient commands with different action names; case sensitivity mistakes.","solutions":["Use one of the supported actions: create, switchtraffic, reversetraffic, complete, cancel, show, starttraffic, stoptraffic, etc.","Run `vtctldclient <workflow> --help` to list valid actions","Fix shell interpolation so the action variable is populated correctly"],"exampleFix":"// before\nvtctldclient Reshard complet commerce.reshard\n// after\nvtctldclient Reshard complete commerce.reshard","handlingStrategy":"validation","validationCode":"const actions = [\"create\",\"switchtraffic\",\"reversetraffic\",\"complete\",\"cancel\",\"show\",\"starttraffic\",\"stoptraffic\",\"writetables\",\"dryrun\",\"retrytraffic\",\"showtraffic\",\"getstate\",\"updateheaders\",\"cancelmigratedtables\",\" finalizemigratedtables\"]\nif !actions.includes(action) { fail(\"unsupported action: \" + action) }","typeGuard":"func isVReplicationAction(a string) bool {\n  switch strings.ToLower(a) {\n  case \"create\", \"switchtraffic\", \"reversetraffic\", \"complete\", \"cancel\", \"show\":\n    return true\n  }\n  return false\n}","tryCatchPattern":null,"preventionTips":["Copy action names from --help output, not memory","Spell-check action variables in shell scripts (set -u helps catch empty vars)"],"tags":["vreplication","action-validation","vtctl"],"backgroundTag":"unsupported-action","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}