Symptoms
- Mail service cannot be activated on example.com. One of the following errors is displayed:
PLESK_ERROR: mailmng-outgoing failed: ERROR:__main__:UNIQUE constraint failed: vhost_ids.guid
PLESK_ERROR: mailmng-outgoing failed: ERROR:__main__:NOT NULL constraint failed: vhost_ids.domain_id
Cause
An orphaned entry with the guid of example.com already exists in the vhost_ids table of the outgoing mail limits /var/lib/plesk/mail/outgoing/data.db
database.
Resolution
-
Connect to the server via SSH
- Enable debug.
- Reproduce the error.
- Find the following entry in /var/log/plesk/panel.log:
CONFIG_TEXT: #7 /opt/psa/admin/plib/Mail/AbstractFacade.php(1670): Service_Driver_Mail_Plesk_Domain_Unix->addVhostId(string 'example.com', string '22ddab34-a039-4ef1-9f4c-cbeba73463fb')
- Disable debug.
- Backup the outgoing mail database:
# cp /var/lib/plesk/mail/outgoing/data.db{,.bkp}
- Open the outgoing mail database:
# sqlite3 /var/lib/plesk/mail/outgoing/data.db
- Check if the entry with guid from step 4 is in there:
# sqlite> select * from vhost_ids where guid="22ddab34-a039-4ef1-9f4c-cbeba73463fb";
22ddab34-a039-4ef1-9f4c-cbeba73463fb|49 - Check if it is orphaned(no domains with such id's in the domains table):
# sqlite> select * from domains where id=49
- Resolve the inconsistency:
- If the output in step 9 was empty, remove the orphaned entry from the vhosts_ids table:
# sqlite> delete from vhost_ids where guid="22ddab34-a039-4ef1-9f4c-cbeba73463fb";
- If the output in step 9 was not empty, apply the below solution from the "Multiple domains are affected" section.
- If the output in step 9 was empty, remove the orphaned entry from the vhosts_ids table:
- Connect to the server via SSH
- Backup the outgoing mail control database:
# cp /var/lib/plesk/mail/outgoing/data.db{,.bkp}
- Wipe the outgoing mail control database:
# plesk sbin mailmng-outgoing --destroy
- Recreate it:
# plesk sbin mailmng-outgoing --init
Comments
2 comments
That does not work for me. I don´t get this entry from panel.log. Any ideas?
Hi, Sebastian Baumann
In case none of the symptoms occur in your environment, I'd recommend starting with searching the exact symptoms. Usually, such exceptions are logged in /var/log/plesk/panel.log
You can also enable debug mode:
https://support.plesk.com/hc/en-us/articles/213408889
Please sign in to leave a comment.