{"record":{"id":"a3e424801376a2a7","repo":"vitessio/vitess","slug":"w-failed-to-fetch-mysql-version-v","errorCode":null,"errorMessage":"%w: failed to fetch MySQL version: %v","messagePattern":"%w: failed to fetch MySQL version: (.+?)","errorType":"error_code","errorClass":"ErrMySQLShellPreCheck","httpStatus":null,"severity":"error","filePath":"go/vt/mysqlctl/mysqlshellbackupengine.go","lineNumber":529,"sourceCode":"\t\treturn false, fmt.Errorf(\"%w: mysql-shell needs to restore with updateGtidSet set to \\\"replace\\\" to work with Vitess\", ErrMySQLShellPreCheck)\n\t}\n\n\tif val, ok := loadFlags[\"progressFile\"]; !ok || val != \"\" {\n\t\treturn false, fmt.Errorf(\"%w: \\\"progressFile\\\" needs to be empty as vitess always starts a restore from scratch\", ErrMySQLShellPreCheck)\n\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}","sourceCodeStart":511,"sourceCodeEnd":547,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/mysqlctl/mysqlshellbackupengine.go#L511-L547","documentation":"When the mysqlShellSpeedUpRestore option is enabled, restorePreCheck fetches the target MySQL server version via Mysqld.GetVersionString to verify it supports disabling the redo log. This error wraps the failure to obtain that version string from the mysqld instance.","triggerScenarios":"ExecuteRestore -> restorePreCheck with mysqlShellSpeedUpRestore=true when GetVersionString fails on the underlying DBA connection, e.g. mysqld not running, socket/port misconfigured, or the query for @@version fails.","commonSituations":"Restore attempted before mysqld is fully started; wrong mysqld socket/port in the tablet's params; permissions issue preventing the super-query used to read the version.","solutions":["Confirm mysqld is running and reachable from the tablet (check socket/port settings)","Test manually: run `SELECT @@version` as the Vitess DBA user on the target instance","Fix or remove the mysqlShellSpeedUpRestore setting if the speed-up path is not required"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure mysqld is reachable first\nversion, err := mysqld.GetVersionString(ctx)\nif err != nil {\n    log.Warn(\"mysqld unreachable before restore\", slog.Any(\"error\", err))\n}","typeGuard":null,"tryCatchPattern":"if _, err := engine.ExecuteRestore(ctx, params, backupDir); err != nil {\n    if strings.Contains(err.Error(), \"failed to fetch MySQL version\") {\n        // verify mysqld is up, then retry restore\n    }\n}","preventionTips":["Confirm mysqld startup completed before triggering restore","Verify socket/port and DBA credentials in tablet params","Test `SELECT @@version` with the Vitess DBA user during setup"],"tags":["mysql-shell","backup-restore","mysql-version"],"backgroundTag":"mysql-connection-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}