Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

Operation Sets Failing

Posted on by 5

I initiated a support case with Microsoft yesterday but have not heard back yet.

Using Proforma Invoicing Lite Deployment.

After the most recent version update to 4.60.0.112 Operation Sets randomly, mostly, fail with the following error.

"Sql error: The operation attempted to insert a duplicate value for an attribute with a unique constraint. CRM ErrorCode: -2147012606 Sql ErrorCode: -2146232060 Sql Number: 2627"

Here is my code that creates the operation set in a plugin. The Catch is never fired as the Operation Set is not abandoned. So I do not think it is an issue with the operation set code. The operation set is executed but often eventually fails.

var operationSetId = PSSActions.CallCreateOperationSetAction(project.Id, $"{project.msdyn_subject} Update PM and Consulting Time", service);
try
{
    var callexecute = false;
    if (!manualPmTime)
    {
        Trace("Add PM time 1");
        PSSActions.CallPssUpdateAction(pmtask, operationSetId, service);
        callexecute = true;
    }
    if (!manualConsultingTime)
    {
        Trace("Add consulting time 1");
        PSSActions.CallPssUpdateAction(consultingTask, operationSetId, service);
        callexecute = true;
    }
    if (callexecute)
    {
        Trace("execute 1");
        PSSActions.CallExecuteOperationSetAction(operationSetId, service);
    }
}
catch (Exception)
{
    PSSActions.CallAbandonOperationSetAction(Guid.Parse(operationSetId), service);
    throw;
}

There is a backend system job called "Project Service Core - SaveProjectDataFromPCSAsynchronousV1" that fails at the same time so it is related with this error log message. I highlighted the duplicate error message in AsyncOperationBase. 

Plugin Trace:

[Microsoft.Dynamics.ProjectServiceCore.Plugins: Microsoft.Dynamics.ProjectServiceCore.Plugins.SaveProjectDataFromPCSAsynchronousV1
[4386b57c-6549-4fa6-b8f6-307e57a3cbba: Project Service Core - SaveProjectDataFromPCSAsynchronousV1

[Microsoft.Dynamics.ProjectServiceCore.Plugins: Microsoft.Dynamics.ProjectServiceCore.Plugins.SaveProjectDataFromPCSV2
[b4c5c007-a8b0-427f-afea-367ae6358b59: Project Service Core - SaveProjectDataFromPCSV2
Starting sync workflow 'Project Service Core - Save Project data from PCS V2', Id: 0a5a0ef7-02fa-ec11-82e5-00224825c3a3
Sync workflow 'Project Service Core - Save Project data from PCS V2' completed successfully


Error Message:

Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault
Message: Sql error: The operation attempted to insert a duplicate value for an attribute with a unique constraint. CRM ErrorCode: -2147012606 Sql ErrorCode: -2146232060 Sql Number: 2627Detail:
<OrganizationServiceFault xmlns:i="">www.w3.org/.../XMLSchema-instance" xmlns="">schemas.microsoft.com/.../Contracts">
<ActivityId>7053e9c4-74d0-40f5-b230-3e52f43071b3</ActivityId>
<ErrorCode>-2147012606</ErrorCode>
<ErrorDetails xmlns:d2p1="">schemas.datacontract.org/.../System.Collections.Generic" />
<HelpLink>go.microsoft.com/.../
<Message> Sql error: The operation attempted to insert a duplicate value for an attribute with a unique constraint. CRM ErrorCode: -2147012606 Sql ErrorCode: -2146232060 Sql Number: 2627</Message>
<Timestamp>2023-03-23T11:03:00.6565173Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>7053e9c4-74d0-40f5-b230-3e52f43071b3</ActivityId>
<ErrorCode>-2147012606</ErrorCode>
<ErrorDetails xmlns:d3p1="">schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<d3p1:key>ApiExceptionSourceKey</d3p1:key>
<d3p1:value xmlns:d5p1="">www.w3.org/.../XMLSchema" i:type="d5p1:string">Step/Microsoft.Xrm.EventExpander.SaveEventsStep</d3p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d3p1:key>ApiSourceActivityKey</d3p1:key>
<d3p1:value xmlns:d5p1="">www.w3.org/.../XMLSchema" i:type="d5p1:string"></d3p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d3p1:key>ApiExceptionOwnerKey</d3p1:key>
<d3p1:value xmlns:d5p1="">www.w3.org/.../XMLSchema" i:type="d5p1:string">OwnershipNotFoundInExceptionOwnerSettings</d3p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d3p1:key>ApiOriginalExceptionKey</d3p1:key>
<d3p1:value xmlns:d5p1="">www.w3.org/.../XMLSchema" i:type="d5p1:string">System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'cndx_PrimaryKey_AsyncOperation'. Cannot insert duplicate key in object 'dbo.AsyncOperationBase'. The duplicate key value is &lt;redacted&gt;.
at Microsoft.Crm.CrmDbConnection.HandleExecutionExceptionAbstract(Exception exception, String commandText, IDbConnection connection, IDbCommand command, IDbTransaction transaction, Boolean isOpen, Int32 commandTimeout, IConnectionRetryPolicy localRetryPolicy, Int32&amp; retryCount)

  • rjboefl Profile Picture
    rjboefl 5 on at
    RE: Operation Sets Failing

    Yes, we did get resolution. It was an issue that MS Support had to resolve. They apparently had a configuration issue between Project and Project Operations such that they had to deploy a change to the environment.

  • Jacklin Profile Picture
    Jacklin 13 on at
    RE: Operation Sets Failing

    Were you ever able to get a resolution to this? Getting the same error.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans