{"record":{"id":"2428cba0665f05f9","repo":"vitessio/vitess","slug":"invalid-on-ddl-action-s","errorCode":null,"errorMessage":"invalid on-ddl action: %s","messagePattern":"invalid on-ddl action: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vtctl.go","lineNumber":3806,"sourceCode":"\t\t\t\tif len(*tabletTypesStrs) > 0 && strings.HasPrefix((*tabletTypesStrs)[0], discovery.InOrderHint) {\n\t\t\t\t\t(*tabletTypesStrs)[0] = strings.TrimPrefix((*tabletTypesStrs)[0], discovery.InOrderHint)\n\t\t\t\t\tinorder = true\n\t\t\t\t}\n\t\t\t\tfor i, tabletType := range *tabletTypesStrs {\n\t\t\t\t\ttabletTypes[i], err = topoproto.ParseTabletType(tabletType)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttabletTypes = textutil.SimulatedNullTabletTypeSlice\n\t\t\t}\n\t\t\tonddl := int32(textutil.SimulatedNullInt) // To signify no value has been provided\n\t\t\tif subFlags.Lookup(\"on-ddl\").Changed {    // Validate the provided value\n\t\t\t\tchanges = true\n\t\t\t\tival, valid := binlogdatapb.OnDDLAction_value[strings.ToUpper(*onDDL)]\n\t\t\t\tif !valid {\n\t\t\t\t\treturn fmt.Errorf(\"invalid on-ddl action: %s\", *onDDL)\n\t\t\t\t}\n\t\t\t\tonddl = ival\n\t\t\t}\n\t\t\tif !changes {\n\t\t\t\treturn errors.New(errWorkflowUpdateWithoutChanges)\n\t\t\t}\n\t\t\ttsp := tabletmanagerdatapb.TabletSelectionPreference_UNKNOWN\n\t\t\tif inorder {\n\t\t\t\ttsp = tabletmanagerdatapb.TabletSelectionPreference_INORDER\n\t\t\t}\n\t\t\trpcReq = &tabletmanagerdatapb.UpdateVReplicationWorkflowRequest{\n\t\t\t\tWorkflow:                  workflow,\n\t\t\t\tCells:                     *cells,\n\t\t\t\tTabletTypes:               tabletTypes,\n\t\t\t\tTabletSelectionPreference: &tsp,\n\t\t\t}\n\t\t\tif onddl != int32(textutil.SimulatedNullInt) {\n\t\t\t\trpcReq.(*tabletmanagerdatapb.UpdateVReplicationWorkflowRequest).OnDdl = new(binlogdatapb.OnDDLAction(onddl))","sourceCodeStart":3788,"sourceCodeEnd":3824,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vtctl.go#L3788-L3824","documentation":"When updating a workflow (e.g. MoveTables/VReplication update), the --on-ddl flag value is validated against the binlogdatapb.OnDDLAction enum map (upper-cased). If the string is not one of the known enum names, this error is returned before any topo change.","triggerScenarios":"Running `vtctldclient Workflow update <ks>/<wf> --on-ddl <value>` where value is not IGNORE/STOP/EXEC/EXEC_IGNORE (case-insensitive).","commonSituations":"Typo like 'execute' or 'skip'; lowercase variants like 'execignore' without underscore; scripts passing an old flag value from a previous Vitess version.","solutions":["Use one of the valid values (case-insensitive): IGNORE, STOP, EXEC, EXEC_IGNORE","Run `vtctldclient Workflow update --help` to see allowed --on-ddl values","Normalize the value in scripts to upper case before passing"],"exampleFix":"// before\nvtctldclient Workflow update commerce/sales --on-ddl execute\n// after\nvtctldclient Workflow update commerce/sales --on-ddl EXEC","handlingStrategy":"validation","validationCode":"validOnDDL := map[string]bool{\"IGNORE\":true,\"STOP\":true,\"EXEC\":true,\"EXEC_IGNORE\":true}\nif !validOnDDL[strings.ToUpper(onDDL)] {\n\treturn fmt.Errorf(\"--on-ddl must be one of IGNORE|STOP|EXEC|EXEC_IGNORE, got %s\", onDDL)\n}","typeGuard":null,"tryCatchPattern":"if err := updateWorkflow(...); err != nil {\n\tif strings.Contains(err.Error(), \"invalid on-ddl action\") {\n\t\treturn fmt.Errorf(\"use EXEC_IGNORE etc. (upper-cased enum names): %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Use tab-completion/help output for --on-ddl values","Uppercase the flag value in wrapper scripts","Pin allowed values in a shell completion or config schema"],"tags":["vtctl","workflow","validation","go"],"backgroundTag":"invalid-enum-value","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}