Article ID: 119488, created on Jan 7, 2014, last review on Jun 19, 2016

  • Applies to:
  • Plesk Automation 11.5
  • Plesk 11.5 for Linux


Error message on login to Horde webmail:

    A fatal error has occurred
    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'


The issue is caused by the missing "auto_increment" value of "share_id" column in "mnemo_shares" or/and "turba_shares" tables of "horde" database.


  1. Enable MySQL logging:

    Add the following to your /etc/my.cnf in the [mysqld] section and restart the mysql server after making those changes:

  2. Find the SQL query that leads to error:

    66460 Query     SELECT 1
    66460 Query     INSERT INTO mnemo_shares (share_name, share_parents, share_owner, attribute_name, perm_creator, perm_default, perm_guest, share_flags) VALUES ('!#224334PTAMnmSarow1', NULL, 'test@domain.tld', 'Notepad of test@domain.tld', 0, 0, 0, 0)
  3. Check the mnemo_shares table. The share_id column should have "auto_increment" parameter:

        mysql> desc horde.mnemo_shares;
        | Field          | Type         | Null | Key | Default | Extra |
        | share_id       | int(11)      | NO   | PRI | NULL    |       |

    If there is no "auto_increment" parameter, it is necessary to modify "mnemo_shares" table as below.

  4. Create backup of horde database:

    ~# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin horde >horde.dump
  5. Login to Horde database and add "auto_increment" parameter for "share_id" column:

    ~# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin horde
    mysql> ALTER TABLE horde.mnemo_shares MODIFY share_id INT(11)AUTO_INCREMENT;
    Query OK, 1 row affected (0.11 sec)
    Records: 1  Duplicates: 0  Warnings: 0
    mysql> desc mnemo_shares;
    | Field          | Type         | Null | Key | Default | Extra          |
    | share_id       | int(11)      | NO   | PRI | NULL    | auto_increment |

    Please do not forget to delete MySQL logging in /etc/my.cnf and restart Mysql server.

  6. If the error still persists after that, please do the following:

    6.1. Backup data of horde database as below:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin horde --no-create-info > horde_data.txt

    6.2. In attachment you will find the Tables Structure of Horde database, restore this dump as below:

    MYSQL_PWD=cat /etc/psa/.psa.shadow mysql -u admin horde < horde_structure.txt

    6.3. Restore data of your horde database:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin horde < horde_data.txt


Search Words

1062 Duplicate Entry

webmail login mysql error



1062 Duplicate entry '0'

Integrity constraint violation

internal error

Horde webmail

a914db3fdc7a53ddcfd1b2db8f5a1b9c 56797cefb1efc9130f7c48a7d1db0f0c 01bc4c8cf5b7f01f815a7ada004154a2 29d1e90fd304f01e6420fbe60f66f838 0a53c5a9ca65a74d37ef5c5eaeb55d7f 33a70544d00d562bbc5b17762c4ed2b3 caea8340e2d186a540518d08602aa065 e0aff7830fa22f92062ee4db78133079

Email subscription for changes to this article
Save as PDF