{"record":{"id":"d436d7071b74f3f9","repo":"vitessio/vitess","slug":"invalid-value-for-on-ddl-v","errorCode":null,"errorMessage":"invalid value for on-ddl: %v","messagePattern":"invalid value for on-ddl: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/vtctl.go","lineNumber":2135,"sourceCode":"\t*sourceShards = strings.TrimSpace(*sourceShards)\n\tdeferNonPKeys := subFlags.Bool(\"defer-secondary-keys\", true, \"Defer secondary index creation for a table until after it has been copied.\")\n\n\t// Reshard params\n\ttargetShards := subFlags.String(\"target_shards\", \"\", \"Reshard only. Target shards\")\n\t*targetShards = strings.TrimSpace(*targetShards)\n\tskipSchemaCopy := subFlags.Bool(\"skip_schema_copy\", false, \"Reshard only. Skip copying of schema to target shards\")\n\n\tif err := subFlags.Parse(args); err != nil {\n\t\treturn err\n\t}\n\n\tif subFlags.NArg() != 2 {\n\t\treturn errors.New(\"two arguments are needed: action, keyspace.workflow\")\n\t}\n\n\tonDDL = strings.ToUpper(onDDL)\n\tif _, ok := binlogdatapb.OnDDLAction_value[onDDL]; !ok {\n\t\treturn fmt.Errorf(\"invalid value for on-ddl: %v\", onDDL)\n\t}\n\n\taction := subFlags.Arg(0)\n\tksWorkflow := subFlags.Arg(1)\n\ttarget, workflowName, err := splitKeyspaceWorkflow(ksWorkflow)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = wr.TopoServer().GetKeyspace(ctx, target)\n\tif err != nil {\n\t\twr.Logger().Errorf(\"keyspace %s not found\", target)\n\t\treturn err\n\t}\n\n\tvrwp := &wrangler.VReplicationWorkflowParams{\n\t\tTargetKeyspace: target,\n\t\tWorkflow:       workflowName,\n\t\tDryRun:         *dryRun,","sourceCodeStart":2117,"sourceCodeEnd":2153,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/vtctl.go#L2117-L2153","documentation":"commandVReplicationWorkflow validates the --on-ddl flag against the known OnDDLAction enum values in binlogdatapb (e.g. IGNORE, STOP, EXEC, EXEC_IGNORE). The flag is uppercased first; if the value is still not in the enum, this error names the invalid value.","triggerScenarios":"Passing --on-ddl with a value not in {IGNORE, STOP, EXEC, EXEC_IGNORE} to MoveTables, Reshard, or Migrate — e.g. 'ignore' is fine (uppercased), but 'SKIP' or 'EXECUTE' are not.","commonSituations":"Using MySQL-ish terminology ('SKIP') instead of the Vitess enum; scripts written against another tool's flag vocabulary; lowercase values are fine, so the failure indicates a genuinely wrong word.","solutions":["Use one of: IGNORE, STOP, EXEC, EXEC_IGNORE (case-insensitive)","Check `vtctl MoveTables --help` for the accepted on-ddl values","Update scripts/configs that carry non-enum values","If you need different behavior, file/discuss a feature rather than inventing values"],"exampleFix":"// before\nvtctl MoveTables -on-ddl=SKIP ... \n// after\nvtctl MoveTables -on-ddl=EXEC_IGNORE ...\n","handlingStrategy":"validation","validationCode":"valid_on_ddl() {\n  case \"$(echo \"$1\" | tr '[:lower:]' '[:upper:]')\" in\n    IGNORE|STOP|EXEC|EXEC_IGNORE) return 0 ;;\n    *) echo \"invalid on-ddl: $1\"; return 1 ;;\n  esac\n}\nvalid_on_ddl \"$ON_DDL\" || exit 1","typeGuard":null,"tryCatchPattern":"if err := runVtctl(\"MoveTables\", \"--on-ddl=\"+onDDL, ...); err != nil {\n    if strings.Contains(err.Error(), \"invalid value for on-ddl\") {\n        // default to EXEC_IGNORE or surface enum options to the operator\n    }\n}","preventionTips":["Use only the enum values IGNORE, STOP, EXEC, EXEC_IGNORE","Define on-ddl choices as a fixed set in automation UIs/configs","Note case-insensitivity: casing is fine, wrong words are not","Keep vitess terminology in runbooks, not MySQL migration vocabularies"],"tags":["vtctl","vreplication","on-ddl","validation"],"backgroundTag":"invalid-flag-value","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}