Re: Salesforce Sync Error: Apex CPU time limit exceeded

Cameron_Zellner
Level 1

Salesforce Sync Error: Apex CPU time limit exceeded

Salesforce Sync Error.PNG

Hello - 

I am trying to make a Salesforce campaign sync using the native sync between Marketo program and SFDC campaign but after it syncs 50K records out of 140K records this error message is returned in Marketo.  What does Apex CPU time limit exceeded refer to and how would I go about fixing this?

Thanks.

6 REPLIES 6
Ankit_Dua
Level 6

Re: Salesforce Sync Error: Apex CPU time limit exceeded

Hi @Cameron Zellner :

You can refer to this post for details: https://nation.marketo.com/docs/DOC-6251-sfdc-sync-error-limitexception-apex-cpu-time-limit-exceeded

Issue Resolution
The error means that you have one or more triggers running when the leads are inserted that consume too much CPU time. You are hitting what are called SFDC Governor limits. This is really something you need to review with your SFDC admins and developers. Consider moving some workflows from Triggers (synchronous) to batches (asynchronous).

Thanks

Daniel_Ducharme
Level 1

Re: Salesforce Sync Error: Apex CPU time limit exceeded

Hey Ankit Dua,

Thanks for the information! I'm the SF Dev on this project. What's confusing about this situation is that our understanding of the MKTO SFDC sync is that it is backlogged when it's too large for the SF API limits and we were seeing roughly 2k records go in per sync which is in line with what we expect.

We tested with 2 campaigns and they both threw this error when the sync reached 50k, even though every time the sync happened for those campaign records were written to SFDC in previous 2 days, we didn't run into the SFDC Governor limits.

Is there any reason you know of in SFDC or MKTO that would limit a given campaign membership to <50k Contacts/Leads? We looked into the limits for importing and know there is a 50k record limit for the Import Wizard. But the SF API and third party tool limits are way higher that what we're trying to do.


Thanks for your response! Any insight is helpful!

SanfordWhiteman
Level 10 - Community Moderator

Re: Salesforce Sync Error: Apex CPU time limit exceeded

Tell us more about what's happening in that After Update trigger.

Daniel_Ducharme
Level 1

Re: Salesforce Sync Error: Apex CPU time limit exceeded

Hello Sanford Whiteman‌, we had a few triggers applied to the Marketo Sync User that didn't need to be there. So now there should be no triggers applying to those record updates. We are currently trying another sync. Will update when it works or not.

When it comes to the two syncs that aborted at 49.7K what can I do to restart those? I've looked for posts to refresh those or restart those but I guess people haven't run into this issue?

Additionally, have you had personal experience syncing 100K plus members over to SFDC? How was that process handled? Did you batch it over, or just use the SFDC Functionality?

Thanks for your help!

Ankit_Dua
Level 6

Re: Salesforce Sync Error: Apex CPU time limit exceeded

I feel problem is somewhere else, even if API's are running all day long that wouldn't cause this error as CPU limits are per-transaction. There might be some functions that might be eating up enormous amounts of CPU time. 

Sanford Whiteman‌ could you please suggest here?

Thanks

Jep_Castelein2
Level 10

Re: Salesforce Sync Error: Apex CPU time limit exceeded

This appears to be related to a managed package from roundCause Giving: http://roundcorner.screenstepslive.com/s/roundCause_Documentation/m/8404/c/52649.

Based on the error message, it appears to be related to a Contact update, not to an "Add to Campaign" event.