0
Answered

The new ECMA 2.0 IdB MA export run profile returns "cd-error" after the IdB/CRM Connector upgrade (from v4.x to v5.1.x)

Aneesh Varghese 7 years ago in UNIFYBroker/Microsoft Dynamics CRM updated by anonymous 7 years ago 11

The new ECMA 2.0 IdB Mangement Agent Export Run Profile Returns "cd-error" after the IdB/CRM Connector Upgrade (from v4.x to v5.1.x)

Previous Version: Microsoft Dynamics CRM Connector 4.1.1.1

Upgraded Version: Microsoft Dynamics CRM Connector 5.1.0.0


IdB error logs

.Net SqlClient Data Provider:

System.Data.SqlClient.SqlException (0x80131904): Transaction (Process ID 56) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

       .....

Error Number:1205,State:48,Class:13

Image 4161

Answer

Answer
Answered

Summary from Aneesh (private comment):

To recap, this issue is caused by imports and exports to CRM (though via different connectors) running at the same time and timing out. Curtis, you suggested running two operations in isolation. I reviewed the CRM Management Agents (MA) and I can see that this MA (Dynamics CRM – Export) is only used for exporting change back to the CRM and there is a separate MA called “Dynamics CRM – Users” is created to import changes from CRM. I am not sure why two separate management agents created instead of just one for both import and export operations. I will check with the client. If no real reason, I will recommend merging both MA’s into just one MA to avoid any concurrency issues.
GOOD, I'M SATISFIED
Satisfaction mark by Aneesh Varghese 7 years ago
Under review

Moved to forum, there's nothing private in this ticket.

Please add back in the full stack trace.

Thanks.

Change detection engine import changes failed.

Change detection engine import changes for connector Dynamics CRM - Contact Allocation Connector failed with reason Metadata contains a reference that cannot be resolved: 'http://xxxxx/xxxxxx/XRMServices/2011/Organization.svc?wsdl'.. Duration: 00:01:02.3298912

Error details:

System.InvalidOperationException: Metadata contains a reference that cannot be resolved: 'http://xxxxx/xxxxxx/XRMServices/2011/Organization.svc?wsdl'. ---> System.Net.WebException: The operation has timed out

   at System.Net.HttpWebRequest.GetResponse()

   at System.ServiceModel.Description.MetadataExchangeClient.MetadataLocationRetriever.DownloadMetadata(TimeoutHelper timeoutHelper)

   at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)

   --- End of inner exception stack trace ---

   at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)

   at System.ServiceModel.Description.MetadataExchangeClient.ResolveNext(ResolveCallState resolveCallState)

   at System.ServiceModel.Description.MetadataExchangeClient.GetMetadata(MetadataRetriever retriever)

   at Microsoft.Xrm.Sdk.Client.ServiceMetadataUtility.RetrieveServiceEndpointMetadata(Type contractType, Uri serviceUri, Boolean checkForSecondary)

   at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1..ctor(Uri serviceUri, Boolean checkForSecondary)

   at Microsoft.Xrm.Sdk.Client.OrganizationServiceConfiguration..ctor(Uri serviceUri)

   at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateConfiguration[TService](Uri serviceUri)

   at Unify.Product.IdentityBroker.OrganizationServiceCommunicator.GetOrganizationService(IAddressCommunicatorInformation communicatorInformation)

   at Unify.Product.IdentityBroker.AddressCommunicatorBase`2.get_Service()

   at Unify.Product.IdentityBroker.DynamicsCrmAgent.<ExecuteRead>d__41.MoveNext()

   at Unify.Product.IdentityBroker.DynamicsCrmObjectChangeProcessor.<Transform>d__6.MoveNext()

   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)

   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)

   at Unify.Product.IdentityBroker.AuditEntityPollingConnectorDecorator.PollEntityChanges(IStoredValueCollection changeState, CancellationToken cancellationToken)

   at Unify.Product.IdentityBroker.EventNotifierEntityPollingConnectorDecorator.PollEntityChanges(IStoredValueCollection changeState, CancellationToken cancellationToken)

   at Unify.Product.IdentityBroker.ChangeDetectionEntityPollJob.RunBase()

   at Unify.Framework.DefinedScopeJobAuditTrailJobDecorator.Run()

   at Unify.Product.IdentityBroker.ConnectorJobExecutor.<>c__DisplayClass30_0.<Run>b__0()

   at Unify.Framework.AsynchronousJobExecutor.PerformJobCallback(Object state)

Please create a new issue for this - as it's an issue that occurs at connector import.

Sorry Adam, I do not understand. What about this ticket then?

This ticket is about export errors. The stack trace that I replied to is unrelated.

I thought both stack traces are related hence I post it there. Ok, let's address this export issue first then I will review the logs again.

An error occurred on client from 127.0.0.1:63996. More details:

Internal Server Error #11: System.InvalidCastException: Unable to cast object of type 'Unify.Product.IdentityBroker.RfcBulkUpdateResponse' to type 'Unify.Product.IdentityBroker.Rfc2251.IRfcRequest'.

   at Unify.Framework.Auditing.AuditingExtensions.<>c__DisplayClass4_0.<TaskContinueWithExceptionPassthough>b__0(Task t)

   at System.Threading.Tasks.Task.Execute()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Unify.Product.IdentityBroker.LDAPConnection.<RespondToMessageAsync>d__33.MoveNext()
.Net SqlClient Data Provider:

System.Data.SqlClient.SqlException (0x80131904): Transaction (Process ID 56) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlBulkCopy.RunParser(BulkCopySimpleResultSet bulkCopyHandler)

   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinuedOnSuccess(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)

   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)

   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsync(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)

   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestContinuedAsync(BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionSource`1 source)

   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource`1 source)

   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalAsync(CancellationToken ctoken)

   at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServerAsync(Int32 columnCount, CancellationToken ctoken)

   at System.Data.SqlClient.SqlBulkCopy.WriteToServer(DataTable table, DataRowState rowState)

   at Unify.Product.IdentityBroker.EntityValueOriginContext.InsertItems(ISet`1 addedItems, EntityValueOriginDataContext sourceContext, SqlConnection connection)

   at Unify.Framework.Data.LinqContextConversionBase`4.SubmitChanges()

   at Unify.Product.IdentityBroker.OriginInformationProcessor.RunBase()

   at Unify.Framework.AsynchronousJobExecutor.PerformJobCallback(Object state)

ClientConnectionId:3b28e70d-ead8-4815-9f6d-d92e29c5eb37

Error Number:1205,State:48,Class:13

Hi Aneesh,

It looks like you have imports and exports to the same external system (though via different connectors) running at the same time and timing out. Could you try running the two operations in isolation to see if this is affecting the operations?

Hi Curtis,

I am not sure how I can achieve that as the imports are happening in Identity Broker (scheduler based) and exports are coming from FIM (whenever the change detects).

However, the fact to note is that this concurrent operation was working fine for the past four years (or with the older versions of IdB) why it suddenly stopped working for IdB 5? Because of the design change?

Answer
Answered

Summary from Aneesh (private comment):

To recap, this issue is caused by imports and exports to CRM (though via different connectors) running at the same time and timing out. Curtis, you suggested running two operations in isolation. I reviewed the CRM Management Agents (MA) and I can see that this MA (Dynamics CRM – Export) is only used for exporting change back to the CRM and there is a separate MA called “Dynamics CRM – Users” is created to import changes from CRM. I am not sure why two separate management agents created instead of just one for both import and export operations. I will check with the client. If no real reason, I will recommend merging both MA’s into just one MA to avoid any concurrency issues.