{"record":{"id":"ff15c646fb919cce","repo":"vitessio/vitess","slug":"unsupported-strategy-v","errorCode":null,"errorMessage":"Unsupported strategy: %+v","messagePattern":"Unsupported strategy: %\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vttablet/onlineddl/executor.go","lineNumber":2865,"sourceCode":"\t\treturn failMigration(err)\n\t}\n\tif specialMigrationExecuted {\n\t\treturn nil\n\t}\n\n\t// OK, nothing special about this ALTER. Let's go ahead and execute it.\n\tswitch onlineDDL.Strategy {\n\tcase schema.DDLStrategyOnline, schema.DDLStrategyVitess:\n\t\tif err := e.ExecuteWithVReplication(ctx, onlineDDL, nil); err != nil {\n\t\t\treturn failMigration(err)\n\t\t}\n\tcase schema.DDLStrategyMySQL:\n\t\tif _, err := e.executeDirectly(ctx, onlineDDL); err != nil {\n\t\t\treturn failMigration(err)\n\t\t}\n\tdefault:\n\t\t{\n\t\t\treturn failMigration(fmt.Errorf(\"Unsupported strategy: %+v\", onlineDDL.Strategy))\n\t\t}\n\t}\n\treturn nil\n}\n\n// executeMigration executes a single migration. It analyzes the migration type:\n// - is it declarative?\n// - is it CREATE / DROP / ALTER?\n// - it is a Revert request?\n// - what's the migration strategy?\n// The function invokes the appropriate handlers for each of those cases.\nfunc (e *Executor) executeMigration(ctx context.Context, onlineDDL *schema.OnlineDDL) error {\n\tdefer e.triggerNextCheckInterval()\n\tfailMigration := func(err error) error {\n\t\treturn e.failMigration(ctx, onlineDDL, err)\n\t}\n\n\tddlAction, err := onlineDDL.GetAction(e.env.Environment().Parser())","sourceCodeStart":2847,"sourceCodeEnd":2883,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vttablet/onlineddl/executor.go#L2847-L2883","documentation":"executeMigration dispatches on the DDL strategy (e.g. vitess, mysql). If the strategy stored on the migration does not match any supported case, the migration is failed with 'Unsupported strategy'. This guards against invalid or unrecognized -ddl_strategy values reaching execution.","triggerScenarios":"Submitting an online DDL migration whose strategy (onlineDDL.Strategy, derived from the --ddl_strategy flag) is not one of vitess/mysql supported values, e.g. a typo or a strategy string that failed to normalize.","commonSituations":"Typo in ddl_strategy flag (e.g. 'gh-ost' on a build without it being a recognized value here, or misspelled 'vitess'), older clients sending strategies removed in newer versions, config drift between vtctld and vttablet versions.","solutions":["Resubmit the migration with an explicitly supported strategy, e.g. --ddl_strategy=\"vitess\" or \"mysql\"","Check the exact strategy string for typos or extra characters","Confirm vtctld and vttablet are the same version so strategy names match","Inspect the migration row's strategy field to see what was actually stored"],"exampleFix":"// before\nvtctldclient ApplySchema --ddl_strategy=\"veetess\" --sql \"ALTER TABLE t ADD COLUMN c INT\" ks\n// after\nvtctldclient ApplySchema --ddl_strategy=\"vitess\" --sql \"ALTER TABLE t ADD COLUMN c INT\" ks","handlingStrategy":"validation","validationCode":"var validStrategies = map[string]bool{\"vitess\": true, \"mysql\": true}\nif !validStrategies[strings.ToLower(strings.TrimSpace(strategy))] {\n    return fmt.Errorf(\"strategy %q not supported; use vitess or mysql\", strategy)\n}","typeGuard":null,"tryCatchPattern":"err := applySchema(ctx, sql, ddlStrategy)\nif err != nil && strings.Contains(err.Error(), \"Unsupported strategy\") {\n    // resubmit with --ddl_strategy=\"vitess\"\n}","preventionTips":["Pin ddl_strategy values in deployment templates to known-good strings","Spell-check strategy flags; avoid free-form values","Keep vtctld/vttablet versions consistent","Validate flags in CI before running schema migrations"],"tags":["online-ddl","ddl-strategy","configuration"],"backgroundTag":"unsupported-ddl-strategy","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}