Constant CONCURRENT_MODIFICATION error when creating

45 views
Skip to first unread message

Luis C. Cruz

unread,
Mar 6, 2017, 1:26:02 PM3/6/17
to AdWords API Forum
I have a program written in C# that creates AdWords campaigns starting from the creation of an Account and then adding campaigns, adgroups, ads, keywords, configurations and more. It can be seen as a pipeline of processes, one after the other, and it stops if a previous process fails. 

At random points of the pipeline I'm constantly facing a CONCURRENT_MODIFICATION error, and the description doesn't help much. It not always fails but it occurs in more than 50% of the launches. This is the description of the exception:

AdWordsApiException: One or more AdWords API errors have occurred. A concurrency problem occurred as two threads were attempting to modify same object.. (Error: DatabaseError.CONCURRENT_MODIFICATION, FieldPath: , Trigger: )

I haven't been able to determine the cause of the problem because (1) It happens at different levels of the pipeline and (2) it is not a multithreaded system, so there aren't other threads modifying the same object.

How can I avoid this error? Thanks



Shwetha Vastrad (AdWords API Team)

unread,
Mar 6, 2017, 4:33:01 PM3/6/17
to AdWords API Forum
Hi Luis,

The CONCURRENT_MODIFICATION error usually appears for one of the following reasons:
  • More than one thread is operating on the entity in a multi-threaded environment
  • A user in the AdWords web interface is updating the entity at the same time.
  • An internal process on the AdWords API servers is updating an entity at the same time.
It is recommended that you try not to process operations against the same ad group or campaign in quick succession. Grouping operations that modify the same ad group or campaign in a single request decreases the chance of such a conflict. Could you provide the SOAP request and response logs where you encounter these errors? Please use Reply privately to author when responding.

Thanks,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages