{"record":{"id":"84fd436c1316115b","repo":"vitessio/vitess","slug":"can-t-dial-mysqlctld-v","errorCode":null,"errorMessage":"can't dial mysqlctld: %v","messagePattern":"can't dial mysqlctld: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/mysqlctl/mysqld.go","lineNumber":417,"sourceCode":"\t}\n\tver.Patch, err = strconv.Atoi(string(v[3]))\n\tif err != nil {\n\t\treturn flavor, ver, fmt.Errorf(\"could not parse server version from: %s\", version)\n\t}\n\n\treturn\n}\n\n// RunMysqlUpgrade will run the mysql_upgrade program on the current\n// install.  Will be called only when mysqld is running with no\n// network and no grant tables.\nfunc (mysqld *Mysqld) RunMysqlUpgrade(ctx context.Context) error {\n\t// Execute as remote action on mysqlctld if requested.\n\tif socketFile != \"\" {\n\t\tlog.Info(fmt.Sprintf(\"executing Mysqld.RunMysqlUpgrade() remotely via mysqlctld server: %v\", socketFile))\n\t\tclient, err := mysqlctlclient.New(ctx, \"unix\", socketFile)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"can't dial mysqlctld: %v\", err)\n\t\t}\n\t\tdefer client.Close()\n\t\treturn client.RunMysqlUpgrade(ctx)\n\t}\n\n\tif mysqld.capabilities.hasMySQLUpgradeInServer() {\n\t\tlog.Warn(\"MySQL version has built-in upgrade, skipping RunMySQLUpgrade\")\n\t\treturn nil\n\t}\n\n\t// Since we started mysql with --skip-grant-tables, we should\n\t// be able to run mysql_upgrade without any valid user or\n\t// password. However, mysql_upgrade executes a 'flush\n\t// privileges' right in the middle, and then subsequent\n\t// commands fail if we don't use valid credentials. So let's\n\t// use dba credentials.\n\tparams, err := mysqld.dbcfgs.DbaConnector().MysqlParams()\n\tif err != nil {","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/mysqlctl/mysqld.go#L399-L435","documentation":"Mysqld.RunMysqlUpgrade was asked to execute remotely on a mysqlctld server (socketFile set), but the mysqlctl RPC client could not dial that server over the unix socket. The upgrade request never reached mysqlctld.","triggerScenarios":"Calling Mysqld.RunMysqlUpgrade while the mysqlctl remote-action socket (-mysqlctl_remote_socket / socketFile) is configured and mysqlctld is not running, has exited, or the socket path is wrong.","commonSituations":"mysqlctld crashed or was restarted between actions; wrong socket file path in flags; permission denied on /tmp socket; using remote-action mode without launching mysqlctld.","solutions":["Confirm mysqlctld is running and listening on the configured unix socket (`ls -l <socketFile>`)","Correct the --mysqlctl_remote_socket flag value","Restart mysqlctld, then retry the upgrade","If you don't need remote execution, unset the socket flag so RunMysqlUpgrade runs locally"],"exampleFix":"// before: remote mode with stale socket\nreturn mysqld.RunMysqlUpgrade(ctx) // socketFile points to dead server\n// after: restart mysqlctld first\nif _, err := os.Stat(socketFile); err != nil {\n    log.Warning(\"mysqlctld socket missing, running upgrade locally\")\n}\nreturn mysqld.RunMysqlUpgrade(ctx)","handlingStrategy":"retry","validationCode":"if _, err := os.Stat(socketFile); err != nil {\n    return fmt.Errorf(\"mysqlctld socket %s missing; is mysqlctld running?\", socketFile)\n}","typeGuard":null,"tryCatchPattern":"err := mysqld.RunMysqlUpgrade(ctx)\nif strings.Contains(err.Error(), \"can't dial mysqlctld\") {\n    // wait for mysqlctld and retry once\n    time.Sleep(2 * time.Second)\n    err = mysqld.RunMysqlUpgrade(ctx)\n}","preventionTips":["Run mysqlctld whenever -mysqlctl_remote_socket is configured","Monitor mysqlctld liveness","Clean stale socket files on restart","Use systemd supervision for mysqlctld"],"tags":["network","rpc","mysqlctl","unix-socket"],"backgroundTag":"connection-refused","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}