Symptoms
-
Plesk migration doesn't start with the error like below:
CONFIG_TEXT: Failed to check Plesk API connection to target Plesk server: Command execution failed on the local server with non-zero exit code.
command: /usr/local/psa/bin/secret_key --list
exit code: 1
stdout: ***hidden***
stderr: ***hidden*** -
The command from the error message
plesk bin secret_key --listruns for a long time and then fails with database error:CONFIG_TEXT: DB query failed: SQLSTATE[HY000] [2002] Connection refused
exit status 1 -
There are a lot of rows in the
SecretKeysandSecretKeysIpAddressestables in Pleskpsadatabase:# plesk db "select count(keyId) from SecretKeysIpAddresses;"
+--------------+
| count(keyId) |
+--------------+
| 319772 |
+--------------+# plesk db "select count(id) from SecretKeys;"
+-----------+
| count(id) |
+-----------+
| 319769 |
+-----------+
Cause
Too many entries in the SecretKeys and SecretKeysIpAddresses tables.
Resolution
Temporarily remove entries in the SecretKeys and SecretKeysIpAddresses tables until the migration is finished:
- Connect to the server via SSH
- Backup Secret Keys with the next command:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -uadmin psa SecretKeys > /root/SecretKeys_backup.sql
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -uadmin psa SecretKeysIpAddresses > /root/SecretKeysIpAddresses_backup.sql
- Remove the existing keys from the database:
# plesk db "TRUNCATE TABLE SecretKeys"
# plesk db "TRUNCATE TABLE SecretKeysIpAddresses"
- Re-start the migration process
- After the migration is finished, restore the keys:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin psa < /root/SecretKeys_backup
Since Plesk 18.0.33 restoration step can be ignored, as the Migrator recreates keys/records automatically
Comments
Please sign in to leave a comment.