Plesk

Error during migration: Unable to add database user: Password hash should be a 41-digit hexadecimal number

Symptoms

The following errors appear during migration:

Unable to create database user 'user' in subscription 'example.com': Command execution failed on the local server with non-zero exit code. command: /usr/local/psa/bin/database --create-dbuser user -passwd 'hidden' -domain example.com -database db -type mysql -server localhost:3306 -ignore-nonexistent-options exit code: 1 stdout: stderr: Unable to add database user: Password hash should be a 41-digit hexadecimal number

or

Plesk restore report problem: Execution of /usr/local/psa/admin/plib/api-cli/domain.php --update example.com -guid 938ccbdf-7592-445b-b3f4-8364c6ed1a95 -creation-date 2011-04-04 -hosting true -hst_type phys -do-not-apply-skeleton -ip 203.0.113.2 -www-root httpdocs -login user -passwd '' -passwd_type sym -hard_quota 1048576000B -shell /usr/local/psa/bin/chrootsh -ignore-nonexistent-options failed with return code 1.

or

Plesk restore report problem: Failed deployment of database user user of database db

Cause

Inconsistency on the source server.

Resolution

As a workaround:

  1. Remove affected database user from the source server.
  2. Perform migration of the affected subscription.
  3. Create the database user on the target server manually.

Note:  If deleting user on the source server is not an option it is possible to import affected database manually to the subscription as follows:

  1. Log in to Plesk on the source server
  2. Go to Subscriptions > example.com > Databases, click on Export Dump and create dump
  3. Log in to Plesk on the target server
  4. Navigate to Subscriptions > example.com > Databases and delete migrated database
  5. Click on Add Database button to create new database and fill in the information of the database/database user from the source server
  6. At the Subscriptions > example.com > Databases click on the Import Dump to import the database
  7. After importing click on the Check and Repair