Re: Salesforce Sync Error: UNABLE_TO_LOCK_ROW

Valerie_Armstro
Level 10 - Champion Alumni
This morning, I had a Marketo notifcation that Marketo was unable to update Lead in Salesforce.  The error details were: UNABLE_TO_LOCK_ROW: unable to obtain exclusive access to this record.  Any ideas on what may have thrown this error?

Thanks, Community!
Tags (1)
18 REPLIES 18
Malik_Zafar2
Level 4

What's the best way to create a list or report of records that are being affected by this?

Ken_Ozawa3
Level 1

I don't know if this is the "best" but you can do a "is a memer of X" and "is not a member of SFDC campaign (target)

so for example, I have a static list, which should have been the total list, and there were those who did successfully go into SFDC campaign through the flow and a few who failed. - so I created a smart list - Is a member of the static list, but not in the SFDC campaign, and you will know who failed the sync. 

Anonymous
Not applicable

We are also having this problem with more and more frequency. I have submitted a case, but want to know if there is a way to have Marketo send you an alert when this happens. I only notice because leads that I upload aren't showing up in our SFDC campaigns.  Any ideas on how to get alerted on this error?

Valerie_Armstro
Level 10 - Champion Alumni

Hi Tracie Liao​,

If you go to Notifications, there is a Subscribe button where you can select which type of notifications you would like to receive an email alert about. You'll want to subscribe to the CRM Sync notification type.

More info here: Understanding Notifications - Marketo Docs - Product Docs

Anonymous
Not applicable

Thanks Valerie. I am subscribed to those and have received them for other

Sync Errors, but never for this particular error about locked rows. I just

imported a list that had ~30 of these errors and didn't receive a

notification.

Tracie Liao

Sr. Demand Generation Manager | CloudPassage

tliao@cloudpassage.com

Follow us on Twitter <http://twitter.com/cloudpassage> and LinkedIn

<https://www.linkedin.com/company/cloudpassage>

On Tue, Jun 30, 2015 at 11:09 AM, Valerie Armstrong <

Valerie_Armstro
Level 10 - Champion Alumni

I encountered the same error again early last week, only this time there were more records affected. I reached out to SFDC Support myself and received a lengthy reply (if you'd like to read through it yourself, let me know and I'll pass it along) about what could cause this error, but no specifics about what is causing the lock row error.

The good news is that if you sync the records again, you shouldn't see the error again from SFDC. As Kenny said, this is usually caused when the Data Loader/API are trying to do some operation on a record while another user in the UI/tool/integration are also attempting to do work on the same record at the same time. However, if you continue to get this error, you'll need to reach out to SFDC to have them monitor it and provide them with the following information:

  • ​The user being used to make the API (Insert/Update/Upsert/etc. call)
  • What is this call trying to accomplish?
  • What triggers this call?
  • How many times did this happen? When did you first see it?
  • Is this happening consistently/sporadically?
Anonymous
Not applicable
I just received this error this morning.  I'm wondering if it may have to do with the recent Salesforce Winter '15 release.
Valerie_Armstro
Level 10 - Champion Alumni
Hi Keith,

The best I have found is these explanations in the SFDC community (here and here).  I think the second one gives a good example of what can cause this error to occur.  However, our mostly affected net new leads so I'm still not 100% certain what caused it, but I'm thinking it may have been due to a miscellaneous trigger or Apex job running because our error happened around 1AM. 

As Kenny suggested, you may want to ask your SFDC Admin if any new API integrations or AppExchange apps were added to your instance recently. 
Anonymous
Not applicable
Anybody get any farther with this?   We currently have about a 100 lead records that are totally locked up.   SFDC support is looking into it.
Anonymous
Not applicable
Weird...  I just got this same error this morning.   Subscribing to see if you find a fix.
Valerie_Armstro
Level 10 - Champion Alumni
Be sure to post back if you and your SFDC dev find anything, Dory! I'm still searching for an answer to this.  🙂 
Dory_Viscoglio
Level 10
Thanks Kenny. I'm sending this over to our SFDC developer to see if there's anything going on on that end.
Kenny_Elkington
Marketo Employee

Hi Dory,

It's extremely rare that Marketo would make concurrent attempts to access the same record or a record and its parent at the same time, so I don't belive that this could be a result of something changing on the Marketo side.  If you have seen performance degaradations in SFDC it's possible that slower database transactions would make this exception more common, but it's really a question that I would take to Salesforce, as we don't really have the level of visibility from the Marketo side to make conclusive judgments regarding the cause.

Valerie_Armstro
Level 10 - Champion Alumni
I'm starting to wonder if this may have something to do with the recent Salesforce performance issues.  Our instance has had performance degradations yesterday and Monday.
Dory_Viscoglio
Level 10
Weird, we just got this error (for the first time) today as well! Kenny, is it possible that something has recently changed in Marketo or SFDC which would cause this error? Just seems a little too convenient that it's happened to several people just recently. 
Valerie_Armstro
Level 10 - Champion Alumni
Hi Kenny,

Thank you for your reply. This is the first time we received an error like this.  I checked in with our SFDC Admin and no new AppExchange apps or API integrations have been deployed in the last two weeks. Reading through the articles you sent, it seems like this can happen due to updates with custom objects and lookup fields, could you expand on this?  Also, are there any other examples of when Salesforce would throw this error? 

Thanks again!
-Val
Kenny_Elkington
Marketo Employee
Hey Val and Elena,

This indicates that when attempting to write to a record it is already being written or locked by another record.  You can find more extensive explanations here: http://salesforce.stackexchange.com/questions/27093/salesforce-parent-locking-unable-to-lock-row https://developer.salesforce.com/blogs/engineering/2013/04/managing-lookup-skew-to-avoid-record-lock-exceptions.html

Marketo will retry an operation a few times if this keeps being received, but will fail and move on if it happens too many times.  If these have recently become common, you might want to look into any new API integrations to SFDC which you've deployed or any new AppExchange packages with your SFDC Admin, tosee if you might be able to tune it o avoid these collisions.
Anonymous
Not applicable
Ohh, same stuff going on for the last week or so. Just subscribing to hear if there's an answer.