Results 1 to 7 of 7

Thread: Account Ghosts

  1. #1
    Join Date
    Feb 2007
    Location
    Austin, TX
    Posts
    110
    Rep Power
    8

    Default Account Ghosts

    I have run into a problem and I don't know how to fix it. I recently activated HSM on my 4.5.6 NE box and the process is crashing shortly after:

    2008-02-22 22:06:22,607 WARN [Thread-617] [mid=74;] hsm - Skipping mailbox 74: com.zimbra.cs.account.AccountServiceException: no such account: e50ca357-cb30-4340-957d-678b7c215816

    The problem is that box #74 was created a LONG time ago for a user. It was deleted or modified in some way and I think restored back from a backup to a different name which was renamed back to his old account name. I cannot recall the details, but here is the symptom:

    [zimbra@SERVER libexec]$ zmprov -l ga e50ca357-cb30-4340-957d-678b7c215816
    ERROR: account.NO_SUCH_ACCOUNT (no such account: e50ca357-cb30-4340-957d-678b7c215816)

    Basically, some piece of the system has a record for good old box #74 and the messages are still there, but the LDAP has no record of him. How do I get this user dead dead dead?
    Peter LeBlond
    Product Development Engineer
    http://www.mxtoolbox.com


  2. #2
    Join Date
    Apr 2006
    Location
    Illinois
    Posts
    194
    Rep Power
    9

    Default

    What happens when you do the following as zimbra user:
    mysql
    connect zimbra
    select * from mailbox where account_id="e50ca357-cb30-4340-957d-678b7c215816";

    My guess is you will get a line with the comment as the users email address and an id of 74. You will probably need to manually clean up the account info out of the databases, store, and indexing.

  3. #3
    Join Date
    Feb 2007
    Location
    Austin, TX
    Posts
    110
    Rep Power
    8

    Default

    Is there any documentation on the mysql schema. I believe that I do need to delete this stale user from the DB, but I want to make sure I get all the references to it.

    Also, as far as Zimbra is concerned, is there any other record of the user in the system outside of mysql and ldap? Is there any other place I might need to go to erase this user?
    Peter LeBlond
    Product Development Engineer
    http://www.mxtoolbox.com


  4. #4
    Join Date
    Feb 2007
    Location
    Austin, TX
    Posts
    110
    Rep Power
    8

    Default

    Okay, so now I've decided to try to clean this up. However I can't figure out the correct SQL. I've tried this:

    DELETE from mailbox WHERE id = 74;
    ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`mboxgroup74/mail_item`, CONSTRAINT `fk_mail_item_mailbox_id` FOREIGN KEY (`mailbox_id`) REFERENCES `zimbra`.`mailbox` (`id`))

    frustration

    AND

    DELETE FROM mail_item WHERE mailbox_id = 74;
    ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`mboxgroup74/mail_item`, CONSTRAINT `fk_mail_item_folder_id` FOREIGN KEY (`mailbox_id`, `folder_id`) REFERENCES `mail_item` (`mailbox_id`, `id`))
    mysql> desc mail_item;
    Peter LeBlond
    Product Development Engineer
    http://www.mxtoolbox.com


  5. #5
    Join Date
    Mar 2006
    Location
    Greenwood, IN
    Posts
    90
    Rep Power
    9

    Default Disable foreign key checks

    As the error indicates, your command is failing to delete records based on foreign key constraints, so you'll need to disable foreign key checks.

    Code:
    mysql> SET FOREIGN_KEY_CHECKS=0

  6. #6
    Join Date
    Feb 2007
    Location
    Austin, TX
    Posts
    110
    Rep Power
    8

    Default

    I guess I just thought that perhaps I needed a more complex SQL query to catch the FKs as well. I thought the constraints might have been put on there for a reason besides just stopping users from running queries on the table.
    Peter LeBlond
    Product Development Engineer
    http://www.mxtoolbox.com


  7. #7
    Join Date
    Feb 2007
    Location
    Austin, TX
    Posts
    110
    Rep Power
    8

    Default

    Okay, I removed refereneces to this box in mysql in zimbra.mailbox, zimbra.mailbox_metadata, and all tables in mboxgroup74. I then went and deleted all the messages in the ~/store/74 directory. I still hit box 74 when I run HSM.

    Do I need to remove the index files, and if so how do I do that? How does Zimbra generate the list of mailboxes to process for HSM?
    Peter LeBlond
    Product Development Engineer
    http://www.mxtoolbox.com


Similar Threads

  1. Replies: 43
    Last Post: 09-18-2013, 06:13 AM
  2. One account not receving email
    By EnglishDude in forum Administrators
    Replies: 12
    Last Post: 04-30-2010, 07:19 AM
  3. Replies: 4
    Last Post: 12-21-2007, 06:43 AM
  4. Replies: 3
    Last Post: 09-18-2007, 07:55 AM
  5. Zimbra account x AD account
    By emersonlb in forum Administrators
    Replies: 2
    Last Post: 09-05-2007, 11:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •