Object with that ID already exists

Object with that id already exists

   KB 24461        Last updated on 2022-08-6  

(0 votes)


LMTP rejecting messages with the exception "object with that id already exists".

Description This issue rarely occurs when checkpoint (MySQL DB) value not updating. When this issue occurred, /opt/zimbra/log/mailbox.log will be logged with similar lines.

[LmtpServer-xxx] [name=affected.user@example.com;mid=xxx;ip=xxx.xxx.xxx.xxx;] lmtp - rejecting message from=sender@example.com,to=affected.user@example.com
com.zimbra.cs.mailbox.MailServiceException: object with that id already exists: 159560
Code:mail.ALREADY_EXISTS Arg:(itemId, IID, "159560")
Caused by: java.sql.SQLIntegrityConstraintViolationException: (conn=20) Duplicate entry '2447-159560' for key 'PRIMARY'

Whenever a message sent/received, item_id_checkpoint will be increased to +1 and this will be the message id of that newly created message.

Example: Current item_id_checkpoint is 368, and if a user receives a new message then item_id_checkpoint will increase to +1 (369) and message id for the new message also will be 369.


Step 1:

  • Get the group id and item_id_checkpoint for the affected mailbox. Mailbox id =zmprov gmi affected.user@example.com
mysql -e "select item_id_checkpoint,group_id from zimbra.mailbox where id=<mailbox id>"

Step 2:

  • Check the highest item id in mail_item and mail_item_dumpster tables.
mysql -e "select max(id) from <mboxgroup id>.mail_item where mailbox_id=<mailbox id>"
mysql -e "select max(id) from <mboxgroup id>.mail_item_dumpster where mailbox_id=<mailbox id>"

Step 3:

  • The highest id from either one of the mail_item tables should less than/equal to mailbox.item_id_checkpoint. If it doesn't, move the affected account into maintenance state
zmprov ma <affected.user@example.com> zimbraAccountStatus maintenance

Step 4: To avoid conflict, updating check point value manually

mysql -e "update zimbra.mailbox set item_id_checkpoint=item_id_checkpoint+1000 where id=<mailbox id>"

Step 5:

  • Clear cache of the affected account.
zmsoap -A -z UnloadMailboxRequest/account @name="affected.user@example.com"

Step 6:

  • Moving affected account into active state
zmprov ma affected.user@example.com zimbraAccountStatus active

Step 7:

  • Test by sending email to the affected account.
Submitted by: Raghu Noti
Verified Against: ZCS 8.8.15, ZCS 9.0 Date Created: 2022-06-08
Article ID: https://wiki.zimbra.com/index.php?title=Object_with_that_ID_already_exists Date Modified: 2022-08-06

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search