MapiExceptionUnexpectedMailboxState: Unable to delete mailbox

When moving mailboxes from Exchange 2003 or Exchange 2007 to Exchange 2010 the move request finishes, but with a status of CompletedWithWarning:

image

The mailbox is moved to Exchange 2010, but the time to finish the actual migration takes a long time. The first reports of this issue I’ve seen came with Exchange 2010 SP2 RU3.

When you check the move request you’ll see the following message:

Warning: Failed to clean up the source mailbox after the move.
Error details: MapiExceptionUnexpectedMailboxState: Unable to delete mailbox. (hr=0x80004005, ec=2634)

When requesting the log of the move request you’ll get even more information and at the end of the log file you’ll see something like:

5/8/2013 2:08:48 PM [server] Post-move cleanup failed. The operation will try again in 30 seconds (5/6). 
5/8/2013 2:06:41 PM [server] Move has completed and final clean up has started. 
5/8/2013 2:06:41 PM [server] Source mailbox 'Primary (0e09f09f-1e1f-41d0-982a-d8c8e34ef804)' was successfully cleaned up after the move. 
5/8/2013 2:06:41 PM [server] Relinquishing job. 
5/8/2013 2:06:46 PM [server] The Microsoft Exchange Mailbox Replication service server.contoso.com' (14.2.297.0 caps:07) is examining the request. 
5/8/2013 2:06:46 PM [server] Connected to target mailbox 'Primary (0e09f09f-1e1f-41d0-982a-d8c8e34ef804)', database 'DB01', Mailbox server server.contoso.com' Version 14.2 (Build 309.0). 
5/8/2013 2:06:46 PM [server] Mailbox move is already finished. 
5/8/2013 2:06:46 PM [server] Move has completed and final clean up has started. 
5/8/2013 2:06:46 PM [server] Failed to clean up the source mailbox 'Primary (0e09f09f-1e1f-41d0-982a-d8c8e34ef804)' after the move. Attempt 1/6. 
Error details: MapiExceptionUnexpectedMailboxState MapiExceptionUnexpectedMailboxState: Unable to delete mailbox. (hr=0x80004005, ec=2634

Further down the log file you’ll find the 6th attempt:

5/8/2013 2:09:19 PM [server] Failed to clean up the source mailbox 'Primary (0e09f09f-1e1f-41d0-982a-d8c8e34ef804)' after the move. Attempt 6/6.
 Error details: MapiExceptionUnexpectedMailboxState MapiExceptionUnexpectedMailboxState: Unable to delete mailbox. (hr=0x80004005, ec=2634)
 5/8/2013 2:09:19 PM [server] Request is complete.

Obviously it takes a long time because the Mailbox Replication Service is retrying the clean-up of the source mailbox six time (the first normal clean-up plus five additional retries). To change this behavior it is possible to edit the MSExchangeMailboxReplication.exe.config file which can be found in the directory C:\Program Files\Microsoft\Exchange Server\V14\Bin.

At the end of this config file, under MRSConfiguration you can decrease the MaxCleanupRetries to “0” or “1”.

<MRSConfiguration
MaxRetries = "60"
MaxCleanupRetries = "5" <-- change this value to "1" or "0"
MaxStallRetryPeriod = "00:15:00"
RetryDelay = "00:00:30"
MaxMoveHistoryLength = "2"
MaxActiveMovesPerSourceMDB = "5"

I haven’t got any formal confirmation yet from Microsoft, but it looks like this issue is solved in Exchange 2010 SP3 (although I heard rumors it should be fixed in Exchange 2010 SP3 RU1). In our own environment (approx. 6000 mailboxes) I’m currently moving mailboxes to Exchange 2010 SP3 and I haven’t seen one mailbox failing at this point. Once confirmed I’ll update my blog.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s