web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Operation Sets Failing

(0) ShareShare
ReportReport
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)

I have the same question (0)
  • Jacklin Profile Picture
    13 on at

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

  • rjboefl Profile Picture
    5 on at

    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.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 586 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 551

#3
CP04-islander Profile Picture

CP04-islander 408

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans