Asked by:
An internal Microsoft Dynamics CRM error occurred while synchronizing appointments, contacts, and tasks for the mailbox UserA. The mailbox has been disabled for synchronizing appointments, contacts and tasks and the owner of the associated email se

Question
-
Hi All,
I am getting following error when using Server-Side Synchronization for synchronizing appointments, contacts for one specific user.
“An internal Microsoft Dynamics CRM error occurred while synchronizing appointments, contacts, and tasks for the mailbox UserA. The mailbox has been disabled for synchronizing appointments, contacts and tasks and the owner of the associated email server profile CompanyA has been notified”
It is occurring only for one specific user. When I enabled tracing I found below exception.
Exception:
select
"subscriptionclients0".SubscriptionClientId as "subscriptionclientid"
from
SubscriptionClients as "subscriptionclients0"
where
(((("subscriptionclients0".ClientId = 'cc2dabb6-525b6-e311-440a-02bfc0a877884')))).
[2015-09-18 15:50:41.109] Process:CrmAsyncService |Organization:78c9ssd34-dd1c-499b-a56f-7145860d3db10 |Thread: 153 |Category: Exception |User: 689385d8-de1c-5555-9f4c-205553031cef |Level: Error |ReqId: b1c409cd-8609-402d-b90a-28da4e9b82d9 | CrmException..ctor ilOffset = 0x7
at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException) ilOffset = 0x7
at CrmException..ctor(String message, Int32 errorCode) ilOffset = 0x5
at SubscriptionClientsService.GetClientSubscriptionPrimaryKey(Guid clientId, ExecutionContext context) ilOffset = 0x7B
at SubscriptionClientsService.GetClientSubscriptionId(Guid clientId, Boolean& isPrimaryClient, ExecutionContext context) ilOffset = 0xB
at SubscriptionClientsService.IsPrimaryClient(Guid clientId, ExecutionContext context) ilOffset = 0x4A
at RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) ilOffset = 0xFFFFFFFF
at RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) ilOffset = 0x25
at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ilOffset = 0xCF
at LogicalMethodInfo.Invoke(Object target, Object[] values) ilOffset = 0x4F
at InternalOperationPlugin.Execute(IServiceProvider serviceProvider) ilOffset = 0x57
at V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context) ilOffset = 0x50
at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context) ilOffset = 0x65
at Pipeline.Execute(PipelineExecutionContext context) ilOffset = 0x65
at MessageProcessor.Execute(PipelineExecutionContext context) ilOffset = 0x1C5
at InternalMessageDispatcher.Execute(PipelineExecutionContext context) ilOffset = 0xE4
at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion) ilOffset = 0x16E
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, Boolean traceRequest, OrganizationContext context, Boolean returnResponse) ilOffset = 0x16A
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) ilOffset = 0x3D
at OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) ilOffset = 0x24
at InprocessServiceProxy.ExecuteCore(OrganizationRequest request) ilOffset = 0x34
at CrmItemFinder.GetCrmSubscription(ExchangeSyncState lastSyncState) ilOffset = 0x1DB
at ExchangeSyncWorkerStepContext..ctor(ExchangeSyncWorker worker) ilOffset = 0x8F
at ExchangeSyncWorker.Initialize() ilOffset = 0x50
at ExchangeSyncWorker.SynchronizeACTs() ilOffset = 0x8
at ACTProviderBase.Run() ilOffset = 0x42
at ACTValidator.Check() ilOffset = 0x3B
at MailboxOperationBase`1.Execute() ilOffset = 0xAA
at MailboxOperationCommand.InternalExecute(MailboxAsyncEvent asyncEvent) ilOffset = 0x5E
at AsyncEventExecutionManager`2.ExecuteHandler(IAsyncEventHandlerFactory handlerFactory) ilOffset = 0x8A
at PoolHandler.ProcessAsyncEvent(IAsyncEventExecutionManager asyncEventExecutionManager) ilOffset = 0x144
at AsyncEventOperation.<.ctor>b__2(IServiceOperation operation) ilOffset = 0x0
at FaultToleranceBehavior.Execute(ServiceOperationAction operation, IServiceOperation operationParameter) ilOffset = 0x18
at MonitoredOperation.Execute() ilOffset = 0xD
at ThreadPoolQueueExecutionEngine.InvokeNextOperationInThreadPool(Object state) ilOffset = 0xC
at ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) ilOffset = 0x70
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) ilOffset = 0x4
at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() ilOffset = 0x0
at ThreadPoolWorkQueue.Dispatch() ilOffset = 0xA3
>Crm Exception: Message: subscriptionclients with clientid cc2dabb6-525b6-e311-440a-02bfc0a877884 doesn't exist, ErrorCode: -2147204845It is complaining about clientid. I have looked at following tables but I couldn't find any record for this user clientid.
SELECT
sub1.FirstName,
sub1.ActiveDirectoryGuid,
s.SubscriptionId,
sc.ClientId,
sc.SubscriptionClientId
FROM SubscriptionClients sc
INNER JOIN Subscription s
ON sc.SubscriptionId = s.SubscriptionId
INNER JOIN SystemUserBase sub1
ON s.SystemUserId = sub1.SystemUserId
Please can you help me resolve this issue.
Thanks
Tuesday, September 22, 2015 11:44 AM
All replies
-
Hi Zaheerahmed,
what is the result when you run this query on your organization DB? Change EMAIL..
declare @TableName char(256)
declare @ColumnName char(256)
declare @FindString char(256)
declare @sql char(8000)
/*Replace X with character(s) you which to find and Y with its replacement*/
set @FindString = 'EMAIL'
/*select o.name, c.name from syscolumns c inner join sysobjects o
on o.id = c.id
where o.xtype = 'U'*/
declare T_cursor cursor for
select o.name, c.name from sysobjects o inner join syscolumns c
on o.id = c.id
where o.xtype = 'U' and c.xtype in (175,239,99,231,35,167)
open T_cursor
fetch next from T_cursor into @TableName, @ColumnName
while (@@fetch_status <> -1)
begin
set @sql = 'if exists (select * from ' + rtrim(@TableName) + ' where ' + rtrim(@ColumnName) + ' like ''%' + rtrim(@FindString) + '%'')
begin
print ''Table = ' + rtrim(@TableName) + ' Column = ' + rtrim(@ColumnName) + '''
end'
exec(@sql)
fetch next from T_cursor into @TableName, @ColumnName
end
close T_cursor
deallocate T_cursorgruss Daniel Ovadia MBSS - Microsoft Dynamics CRM MCNPS
Tuesday, September 22, 2015 2:39 PM -
Hi Daniel,
I have following result set.
Table = ActivityPartyBase Column = AddressUsed
Table = AnnotationBase Column = NoteText
Table = ActivityPointerBase Column = Description
Table = ActivityPointerBase Column = Sender
Table = ActivityPointerBase Column = ToRecipients
Table = ActivityPointerBase Column = SubmittedBy
Table = ImportDataBase Column = Data
Table = cdi_emaileventBase Column = cdi_email
Table = cdi_emaileventBase Column = cdi_message
Table = EmailSearchBase Column = EmailAddress
Table = cdi_emailsendBase Column = cdi_fromemail
Table = ContactBase Column = EMailAddress1
Table = cdi_eventparticipationBase Column = cdi_emailaddress
Table = QueueBase Column = EMailAddress
Table = MailboxBase Column = EmailAddress
Table = SystemUserBase Column = InternalEMailAddress
Table = AuditBase Column = ChangeData
Table = cdi_sentemailBase Column = cdi_fromemail
Table = cdi_sentemailBase Column = cdi_toemail
Thanks
Tuesday, September 22, 2015 5:30 PM -
sorry, compare the output of user which works
gruss Daniel Ovadia MBSS - Microsoft Dynamics CRM MCNPS
Tuesday, September 22, 2015 5:44 PM -
Hi Daniel,
I got following result set for working user2.
Table = AuditBase Column = ChangeData
Table = MailboxBase Column = EmailAddress
Table = SystemUserBase Column = InternalEMailAddress
Table = ActivityPointerBase Column = Description
Table = ActivityPointerBase Column = ToRecipients
Table = ActivityPartyBase Column = AddressUsed
Table = EmailSearchBase Column = EmailAddressPlease can you explain how this comparison will help? I have compared two results set and found 12 different tables which are used by User1.
Table = AnnotationBase Column = NoteText
Table = ActivityPointerBase Column = Sender
Table = ActivityPointerBase Column = SubmittedBy
Table = ImportDataBase Column = Data
Table = ContactBase Column = EMailAddress1
Table = QueueBase Column = EMailAddressTable = cdi_emaileventBase Column = cdi_email
Table = cdi_emaileventBase Column = cdi_message
Table = cdi_emailsendBase Column = cdi_fromemail
Table = cdi_eventparticipationBase Column = cdi_emailaddress
Table = cdi_sentemailBase Column = cdi_fromemail
Table = cdi_sentemailBase Column = cdi_toemailMany Thanks
Wednesday, September 23, 2015 9:13 AM -
Hi Zaheerahmed,I think its imported organiaztion and you must chnage/delete them, but it is acutlaly not supported and could cause many things. I would try it anyway with a copy backup.
gruss Daniel Ovadia MBSS - Microsoft Dynamics CRM MCNPS
Wednesday, September 23, 2015 9:17 AM -
Hi Daniel,
It is not imported orgniazation. Please can you confirm what I need to change/delete?
Thanks
Wednesday, September 23, 2015 10:44 AM -
I would delte the cdi_x vlaues... but i thought its imported.. i don´t know if this helpds also
gruss Daniel Ovadia MBSS - Microsoft Dynamics CRM MCNPS
Wednesday, September 23, 2015 1:09 PM -
Hi Daniel,
We are using third party solution and all cdi_x tables belongs to that solution and deleting them will break that solution functionality.
Thanks
Wednesday, September 23, 2015 1:42 PM -
Hi Daniel,
I have resolved this issue after resetting ExchangeSyncStateXml column to NULL in MailboxBase table for corresponding user.
I have perform following steps:
1-Run Below update
SELECT ExchangeSyncStateXml,MailboxId,* FROM MailboxBase
WHERE
EmailAddress='yourmail@company.co.uk'
UPDATE MailboxBase
SET ExchangeSyncStateXml=NULL
WHERE MailboxId='YourMailboxId'2- Open specific user mailbox and run "Test and Enabled Mailbox" option which created new clientid and associated data
Thanks for your help.
- Proposed as answer by Daniel Ovadia Thursday, September 24, 2015 8:32 AM
Wednesday, September 23, 2015 2:30 PM