Symptoms
When using a non-root system user on a Plesk migration, the migration fails to start with one of the following error messages:
PLESK_ERROR: SSH connection to the source server can not be used: there is unexpected output when executing commands. Clean output is required by migrator to execute commands and consume their output, and to run “rsync” tool (for file transfer) which uses SSH connection as transport and does not work if there is any unexpected output.
PLESK_ERROR: Failed to fetch basic information about resellers, clients and domains data from source servers
Cause: Command execution failed on the local server with non-zero exit code.
command: /bin/mkdir -p /root/plesk_migrator
exit code: 1
stdout:
stderr: /bin/mkdir: cannot create directory ‘/root’: Permissions denied
That is a critical error, migration was stopped.
PLESK_ERROR: SSH connection to the source server ‘source’ (203.0.113.2) can not be used: command “bin/true” executed by SSH returned non-zero exit code. Check that the user used to connect to the server has “/bin/sh” or “/bin/bash” as its shell.
PLESK_ERROR: Error message or request description : Error: launchpad error (Error code = 2): == STDERR ==================== Cannot request remote agent status using command line /var/cache/2013100110274185/PleskX.pl: Died at AgentConfig.pm line 23. at AgentConfig.pm line 23 AgentConfig::AUTOLOAD() called at /var/cache/2013100110274185/PleskX.pl line 298 main::writeMigrationResult() called at /var/cache/2013100110274185/PleskX.pl line 304
PLESK_ERROR: Cannot request remote agent status using command line /var/cache/20150318093912860/PleskX.pl: which: no ruby in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin)
Can’t open perl script “/var/cache/20150318093912860/PleskX.pl”: No such file or directory
PLESK_ERROR: Failed to fetch basic information about resellers, clients and domains data from source servers
Cause: Failed to execute SQL query on Plesk database: failed to parse JSON returned by SQL script.
Query:
SELECT Subscriptions.id as subscription_id, clients.id, login, pname
FROM clients
LEFT JOIN Subscriptions ON
Subscriptions.object_id = clients.id
AND Subscriptions.object_type = ‘client’
WHERE clients.type = ‘reseller’
Command’s exit code: 255
Command’s stdout:
Command’s stderr: Died at AgentConfig.pm line 23.
That is a critical error, migration was stopped.
Cause
The Plesk migration was started with a non-root user.
Resolution
In a Plesk migration, it is required to use the root system user when connecting to the source server: Authenticate with its password or authenticate via SSH keys
Note: It is possible to migrate with a non-root user in case of Migrating From a Linux Server With Custom Hosting