Re: SFDC "Failed to acquire lock on SFDC Campaign"

Rachel_Hale2
Level 1

SFDC "Failed to acquire lock on SFDC Campaign"

We are recently seeing records getting a "Failed to acquire lock on SFDC Campaign" during their "Add to SFDC Campaign" flow step.

  • It's only happening to some records however all records have the same data fields populated
  • They sync to SFDC and are assigned as expected, it's only the adding to campaign that is failing
  • If we manually re-batch them to the campaign it adds to the SFDC Campaign with no issue
5 REPLIES 5
Salytics
Level 3

Re: SFDC "Failed to acquire lock on SFDC Campaign"

Hi Rachel,

When Salesforce goes to update a record, it first "locks" that record (row in the database) to prevent other processes from modifying it before it's finished writing the update. You're getting this error when you attempt to update a record that Salesforce has already locked for another update.

Based on the scenario you laid out, it seems very likely that your org has automation (declarative or programmatic) that updates the Salesforce campaign record when child campaign member records are added to it. Something along the lines of this:

  1. Campaign member record A is added
  2. Campaign record X is updated as a result
  3. Campaign member record B is added
  4. Campaign record X update is attempted, but failed due to record still being locked from #2's attempt

Possible solutions:

  • Look into making the campaign record update logic asynchronous.

This is a best guess and we'd need some more information to figure out exactly what's happening.

Hope that helps!
Dan

Malik_Zafar2
Level 4

Re: SFDC "Failed to acquire lock on SFDC Campaign"

Is there any way to trigger a notification in Marketo when this happens? Or perhaps a report that could catch this?

 

I agree that creating a more synchronous system is the way to go, but in the meantime I want to make sure I have visibility into records.

D_Nemec
Level 1

Re: SFDC "Failed to acquire lock on SFDC Campaign"

This is an issue that we are having as well.  We have not found a way to trigger an alert in Marketo, and we have not been able to see an error logged on the SFDC side. We can only see if a campaign member record fails if we compare a controlled list of batch campaign members.  If it happens more organically through lead scoring or contact forms, the only way we can see the fail is if we spot check the person's activity logs in Marketo. 

 

We have been trying to troubleshoot this issue for several months now. We are testing in our sandbox/dev SFDC environment and have deactivated custom SFDC scripts that were running to eliminate variables. We are still see this error. 

 

Has anybody been able to solve this issue with SFDC or have any add'l "clues"? 

 

Thanks!

 

 

 

Tags (1)
D_Nemec
Level 1

Re: SFDC "Failed to acquire lock on SFDC Campaign"

We did more testing with this and we found that if you are calling the "add to SFDC Campaign" as a trigger from Marketo.. there is a possibility of a timing issue with SFDC.  Marketo will treat each person that qualifies for the flow steps individually. The SFDC campaign will "lock", the member will be added, and then the campaign will be "unlocked".  If a lot of people are going through the trigger campaign at the same time, there will be some records that will have timing issues with the campaign unlocking from the previous records. 

 

Vs, if you use a batch/predefined list.. Marketo will "tell" SFDC how long to "lock" the campaign for.. it will add all of the records, and then unlock the campaign. No errors because the campaign is locked until all records that qualified for the batch are added. 

 

I may not have that 100% technically right.. but it made sense after we did a lot of testing and understood more how the trigger campaigns, vs. batch campaigns worked between Mkto and SFDC. 

 

In our case, we had to re-write our triggers to be batch when we were doing a larger list of people at one time. 

Hope that helps!  That was a hard mystery to solve on our side! 

 

 

 

Malik_Zafar2
Level 4

Re: SFDC "Failed to acquire lock on SFDC Campaign"

Thanks for looking into it - I'm glad you were able to find some sort of solution, even though it may not be ideal.

 

We ended up going back to direct MKTO program to SFDC campaign syncs. It seems to have basically eliminated the issue for us, but I understand other organizations may need to use the "add to SFDC campaign" flow step instead.