Applicable to:
- Plesk for Linux
Symptoms
-
Attempt to change a mailbox password fails with the following error message:
CONFIG_TEXT: Unable to set password: Unable create account with ID "XXX".
-
Going to Domains > example.com > Mail Accounts, the quick Webmail access icon
might be missing
-
An XML API call retrieving Mail account details returns the following error message:
CONFIG_TEXT: <result>
<status>ok</status>
<mailname>
<id>632</id>
<name>info</name>
<mailbox>
<enabled>false</enabled>
<quota>-1</quota>
</mailbox>
<status>error</status>
<errcode>1002</errcode>
<errtext>Call to a member function hasPlainPassword() on boolean</errtext>
</mailname>
</result> -
An Acronis Backup fails to be created with the following error message in the Plesk log file
/var/log/plesk/panel.log
:CONFIG_TEXT: ERR [1] Call to a member function hasPlainPassword() on boolean
ERR [extension/acronis-backup] Execution of /opt/psa/admin/plib/modules/acronis-backup/scripts/create-meta.php failed with exit code 1 and the output:
...
11: /opt/psa/admin/plib/pm/ApiRpc.php:113
pm_ApiRpc->_call(string '<?xml version="1.0"?>
<mail><get_info><filter><site-id>28</site-id></filter><mailbox/><mailbox-usage/></get_info></mail>
')
Cause
Database inconsistency: A record is missing in the accounts table for the corresponding email address
Resolution
-
Connect to the server via SSH
-
# plesk db dump psa > psa.backup.sql
-
Get a list with all the affected mailboxes:
# plesk db "SELECT CONCAT(m.mail_name,'@',d.name) AS 'Email' FROM domains d, mail m WHERE d.id=m.dom_id AND m.account_id NOT IN (SELECT id FROM accounts)"
-
Fix all the affected mailboxes by adding the missing record in the database and creating a random 32 character password:
# plesk db -Ne "SELECT CONCAT(m.mail_name,'@',d.name), m.account_id FROM domains d, mail m WHERE d.id=m.dom_id AND m.account_id NOT IN (SELECT id FROM accounts)" | while read email accountId; do date; echo -e "Email affected: $email"; echo -e "Creating missing record..."; plesk db "INSERT accounts VALUES ($accountId, 'plain','')"; RANDOMPASS=''; RANDOMPASS=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1); echo -e "Adding 32 AlphaNumeric random password..."; plesk bin mail -u $email -passwd "$RANDOMPASS"; echo -e "Email fixed: $email\n"; done
- If necessary, assign a new password to the email addresses shown in the list retrieved in the Step 3
Comments
0 comments
Please sign in to leave a comment.