Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

Unable to activate the mail service on a domain: mailmng-outgoing failed: ERROR:__main__:UNIQUE constraint failed: vhost_ids.guid

 
backupdatabasedebugdomainsmail

Symptoms

  • Mail service cannot be activated on example.com. One of the following errors is displayed:

    mailmng-outgoing failed: ERROR:__main__:UNIQUE constraint failed: vhost_ids.guid

    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

One domain is affected

  1. Connect to the server via SSH

  2. Enable debug.
  3. Reproduce the error.
  4. Find the following entry in /var/log/plesk/panel.log:

    #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')

  5. Disable debug.
  6. Backup the outgoing mail database:

    # cp /var/lib/plesk/mail/outgoing/data.db{,.bkp}

  7. Open the outgoing mail database:

    # sqlite3 /var/lib/plesk/mail/outgoing/data.db

  8. 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

  9. Check if it is orphaned(no domains with such id's in the domains table):

    # sqlite> select * from domains where id=49

  10. 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. 

Multiple domains are affected

  1. Connect to the server via SSH
  2. Backup the outgoing mail control database:

    # cp /var/lib/plesk/mail/outgoing/data.db{,.bkp}

  3. Wipe the outgoing mail control database:

    # plesk sbin mailmng-outgoing --destroy

  4. Recreate it:

    # plesk sbin mailmng-outgoing --init

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Exploring Plesk’s Added Value Solutions So Far in 2023

Read More »

Unveiling Sitejet Builder: The Perfect Match for Your Effortless Website Creation Needs

Read More »

Dynamic List vs. Active List: A Comprehensive Comparison – Unveiling the Ultimate Winner!

Read More »
Knowledge Base

Websites on Plesk server are slow or show error 500 or PHP mail cannot be sent: ap_pass_brigade failed

Read More »

Mail stuck in the queue in the server with Plesk: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (13)

Read More »

Mail delivery does not work: do not list domain in BOTH mydestination and virtual_mailbox_domains

Read More »

Unable to send mail from Plesk server: deferred (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)

Read More »

Hosting Wiki

  • Server Redundancy
  • QMAIL
  • Sendmail
  • Bare Metal Server
  • Backup
  • PhpMyAdmin
  • phpPgAdmin
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • PHP
  • Domain
  • Plesk
  • SQL database
  • NoSQL Database
  • Web Server
  • DNS Server
  • SSH
  • Email Autoresponder
  • Mailing Lists
  • Email Alias
  • Email Virus Protection
  • Email Forwarding
  • Webmail
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family