{"record":{"id":"458b238e1fde74be","repo":"vitessio/vitess","slug":"invalid-action-for-migrate-s","errorCode":null,"errorMessage":"invalid action for Migrate: %s","messagePattern":"invalid action for Migrate: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vtctl.go","lineNumber":2222,"sourceCode":"\n\twrapError := func(wf *wrangler.VReplicationWorkflow, err error) error {\n\t\twr.Logger().Errorf(\"\\n%s\\n\", err.Error())\n\t\tlog.Info(fmt.Sprintf(\"In wrapError wf is %+v\", wf))\n\t\twr.Logger().Infof(\"Workflow Status: %s\\n\", wf.CurrentState())\n\t\tif wf.Exists() {\n\t\t\tprintDetails()\n\t\t}\n\t\treturn err\n\t}\n\n\t// TODO: check if invalid parameters were passed in that do not apply to this action\n\toriginalAction := action\n\taction = strings.ToLower(action) // allow users to input action in a case-insensitive manner\n\tif workflowType == wrangler.MigrateWorkflow {\n\t\tswitch action {\n\t\tcase vReplicationWorkflowActionCreate, vReplicationWorkflowActionCancel, vReplicationWorkflowActionComplete:\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"invalid action for Migrate: %s\", action)\n\t\t}\n\t}\n\n\tswitch action {\n\tcase vReplicationWorkflowActionCreate:\n\t\tswitch workflowType {\n\t\tcase wrangler.MoveTablesWorkflow, wrangler.MigrateWorkflow:\n\t\t\tvar sourceTopo *topo.Server\n\t\t\tvar externalClusterName string\n\n\t\t\tsourceTopo = wr.TopoServer()\n\t\t\tif *sourceKeyspace == \"\" {\n\t\t\t\treturn errors.New(\"source keyspace is not specified\")\n\t\t\t}\n\t\t\tif workflowType == wrangler.MigrateWorkflow {\n\t\t\t\texternalClusterName, *sourceKeyspace, err = getSourceKeyspace(*sourceKeyspace)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err","sourceCodeStart":2204,"sourceCodeEnd":2240,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vtctl.go#L2204-L2240","documentation":"For Migrate workflows, commandVReplicationWorkflow only permits the actions create, cancel, and complete (compared after lowercasing). Any other action string returns this error naming the action. MoveTables and Reshard have their own larger action sets, so this restriction is Migrate-specific.","triggerScenarios":"Running `vtctl Migrate <action> ...` with an action like 'switchtraffic', 'reversetraffic', 'show', or 'validatedata' — actions that exist for MoveTables/Reshard but are meaningless for Migrate.","commonSituations":"Copy-pasting a MoveTables runbook and swapping the command name to Migrate; automation that iterates a generic action list; assuming Migrate supports traffic switching (it doesn't — traffic was never switched to the external source).","solutions":["Use only create, cancel, or complete with the Migrate command","If you intended traffic switching or monitoring, use MoveTables or Reshard instead","Review the Migrate command help for its supported actions","Fix automation scripts that apply the MoveTables action list to Migrate"],"exampleFix":"// before\nvtctl Migrate commerce.switchtraffic keyspace\n// after\nvtctl Migrate cancel customer.commerce   # or use MoveTables for switchtraffic\n","handlingStrategy":"validation","validationCode":"migrate_valid_action() {\n  case \"$(echo \"$1\" | tr '[:upper:]' '[:lower:]')\" in\n    create|cancel|complete) return 0 ;;\n    *) echo \"Migrate supports only create|cancel|complete, got: $1\"; return 1 ;;\n  esac\n}\nmigrate_valid_action \"$ACTION\" || exit 1","typeGuard":null,"tryCatchPattern":"if err := runVtctl(\"Migrate\", action, ...); err != nil {\n    if strings.Contains(err.Error(), \"invalid action for Migrate\") {\n        // redirect to MoveTables/Reshard if the action requires traffic management\n    }\n}","preventionTips":["Maintain per-command action lists in automation (Migrate ≠ MoveTables)","Remember Migrate never switches traffic — no switchtraffic/reversetraffic","Use MoveTables for workflows requiring show/validate/switchtraffic actions","Test scripts against the command help after Vitess upgrades"],"tags":["vtctl","vreplication","migrate","validation"],"backgroundTag":"invalid-workflow-action","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}