{"record":{"id":"20f0acea817e2bf5","repo":"vitessio/vitess","slug":"w-failed-to-parse-mysql-version-version-s","errorCode":null,"errorMessage":"%w: failed to parse MySQL version (version: %s): %v","messagePattern":"%w: failed to parse MySQL version \\(version: (.+?)\\): (.+?)","errorType":"error_code","errorClass":"ErrMySQLShellPreCheck","httpStatus":null,"severity":"error","filePath":"go/vt/mysqlctl/mysqlshellbackupengine.go","lineNumber":534,"sourceCode":"\t}\n\n\tif val, ok := loadFlags[\"skipBinlog\"]; !ok || val != true {\n\t\treturn false, fmt.Errorf(\"%w: \\\"skipBinlog\\\" needs to set to true\", ErrMySQLShellPreCheck)\n\t}\n\n\tif val, ok := loadFlags[\"loadUsers\"]; ok && val == true {\n\t\tshouldDeleteUsers = true\n\t}\n\n\tif mysqlShellSpeedUpRestore {\n\t\tversion, err := params.Mysqld.GetVersionString(ctx)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"%w: failed to fetch MySQL version: %v\", ErrMySQLShellPreCheck, err)\n\t\t}\n\n\t\t_, sv, err := ParseVersionString(version)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"%w: failed to parse MySQL version (version: %s): %v\", ErrMySQLShellPreCheck, version, err)\n\t\t}\n\n\t\tversionStr := fmt.Sprintf(\"%d.%d.%d\", sv.Major, sv.Minor, sv.Patch)\n\n\t\tcapableOf := mysql.ServerVersionCapableOf(versionStr)\n\t\tcapable, err := capableOf(capabilities.DisableRedoLogFlavorCapability)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"%w: error checking if server supports disabling redo log: %v\", ErrMySQLShellPreCheck, err)\n\t\t}\n\n\t\tif !capable {\n\t\t\treturn false, fmt.Errorf(\"%w: MySQL version doesn't support disabling the redo log (must be >=8.0.21, current version: %s)\", ErrMySQLShellPreCheck, versionStr)\n\t\t}\n\t}\n\n\treturn shouldDeleteUsers, nil\n}\n","sourceCodeStart":516,"sourceCodeEnd":552,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/mysqlctl/mysqlshellbackupengine.go#L516-L552","documentation":"After fetching the raw version string, restorePreCheck calls ParseVersionString to extract major/minor/patch components. This error is thrown when the version string returned by the server cannot be parsed by Vitess' version parser, so capability checking cannot proceed.","triggerScenarios":"ExecuteRestore -> restorePreCheck with mysqlShellSpeedUpRestore=true when ParseVersionString(version) returns an error for the server's version string (e.g. MariaDB or vendor-modified version strings that don't match the expected MySQL format).","commonSituations":"Running MySQL Shell restore speed-up against MariaDB or Percona builds with unusual version strings; patched/custom mysqld builds reporting non-standard @@version output.","solutions":["Check the actual `SELECT @@version` output and confirm it is a parseable MySQL-style version (e.g. 8.0.34)","Use a supported MySQL 8.0.21+ server for the mysql-shell speed-up restore","Disable mysqlShellSpeedUpRestore if the server flavor/version cannot be recognized"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"version, err := mysqld.GetVersionString(ctx)\nif err == nil {\n    if _, _, perr := mysqlctl.ParseVersionString(version); perr != nil {\n        log.Warn(\"unparseable MySQL version for mysql-shell speed-up\", slog.String(\"version\", version))\n    }\n}","typeGuard":null,"tryCatchPattern":"if _, err := engine.ExecuteRestore(ctx, params, backupDir); err != nil {\n    if strings.Contains(err.Error(), \"failed to parse MySQL version\") {\n        // disable mysqlShellSpeedUpRestore or switch to a standard MySQL server\n    }\n}","preventionTips":["Use standard MySQL 8.x servers for mysql-shell restores, not MariaDB or heavily patched builds","Check `SELECT @@version` output during provisioning","Keep mysqlShellSpeedUpRestore=false on flavors Vitess cannot parse"],"tags":["mysql-shell","backup-restore","version-parsing"],"backgroundTag":"mysql-version-parse-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}