{"record":{"id":"d6de8031f23fd740","repo":"vitessio/vitess","slug":"clone-execution-failed-v","errorCode":null,"errorMessage":"clone execution failed: %v","messagePattern":"clone execution failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"go/vt/mysqlctl/clone.go","lineNumber":131,"sourceCode":"\t\treturn replication.Position{}, errors.New(\"clone user not configured; set --db-clone-user flag\")\n\t}\n\n\t// Create the clone executor.\n\texecutor := &CloneExecutor{\n\t\tDonorHost:     donorTablet.MysqlHostname,\n\t\tDonorPort:     int(donorTablet.MysqlPort),\n\t\tDonorUser:     cloneConfig.User,\n\t\tDonorPassword: cloneConfig.Password,\n\t\tUseSSL:        cloneConfig.UseSSL,\n\t}\n\n\tlog.Info(fmt.Sprintf(\"Clone executor configured for donor %s:%d\", executor.DonorHost, executor.DonorPort))\n\n\t// Execute the clone operation.\n\t// Note: ExecuteClone will wait for mysqld to restart and for the CLONE plugin to report successful completion\n\t// success via performance_schema before returning.\n\tif err := executor.ExecuteClone(ctx, mysqld, mycnf, cloneRestartWaitTimeout); err != nil {\n\t\treturn replication.Position{}, fmt.Errorf(\"clone execution failed: %v\", err)\n\t}\n\n\t// After CLONE, keep going across the expected mysqld restart.\n\tctx, cancel := context.WithTimeout(ctx, clonePrimaryPositionTimeout)\n\tdefer cancel()\n\n\tpos, err := mysqld.PrimaryPosition(ctx)\n\tif err != nil {\n\t\treturn replication.Position{}, fmt.Errorf(\"failed to get position after clone: %v\", err)\n\t}\n\n\tlog.Info(fmt.Sprintf(\"Clone completed successfully at position %v\", pos))\n\treturn pos, nil\n}\n\n// CloneExecutor handles MySQL CLONE REMOTE operations for backup and replica provisioning.\n// It executes CLONE INSTANCE FROM on the recipient to clone data from a donor.\ntype CloneExecutor struct {","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/mysqlctl/clone.go#L113-L149","documentation":"The MySQL CLONE plugin operation executed by the clone executor failed. ExecuteClone waits for mysqld restart and for performance_schema to report clone success; any failure/timeout there is wrapped as 'clone execution failed'.","triggerScenarios":"CloneFromDonor where the donor rejects the clone (wrong credentials/user privileges), network failure between donor and recipient, CLONE plugin not installed, insufficient disk space, or timeout waiting for clone completion (cloneRestartWaitTimeout).","commonSituations":"Missing CLONE_ADMIN/BACKUP_ADMIN grants for clone user, firewall blocking donor:port, MySQL < 8.0.17 lacking CLONE plugin, large dataset exceeding timeout, mysqld failing to restart after clone.","solutions":["Inspect the wrapped inner error and mysqld/vttablet logs for the root cause.","Verify the CLONE plugin is installed on donor and recipient (`INSTALL PLUGIN clone SONAME 'mysql_clone.so'`).","Verify clone user privileges (BACKUP_ADMIN on donor, CLONE_ADMIN on recipient) and --db-clone-user settings.","Check network connectivity from recipient to donor host:port and disk space on the recipient.","Increase the clone restart/completion timeout for large datasets and retry."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-checks\n// 1) plugin installed: SELECT PLUGIN_NAME FROM information_schema.PLUGINS WHERE PLUGIN_NAME='clone';\n// 2) grants: donor BACKUP_ADMIN, recipient CLONE_ADMIN\n// 3) connectivity: nc -z donorHost donorPort","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"clone execution failed\") {\n\tlog.Error(\"clone failed\", slog.Any(\"error\", err))\n\t// inspect mysqld logs, fix root cause, then retry CloneFromDonor\n}","preventionTips":["Install CLONE plugin on donor and recipient","Grant clone user BACKUP_ADMIN/CLONE_ADMIN","Size timeouts for your dataset; monitor disk space","Test network path recipient -> donor before restore"],"tags":["mysql","clone","replication","timeout"],"backgroundTag":"clone-operation-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}