<soap:Body> <soap:Fault> <faultcode>soap:Client</faultcode> <faultstring>[DatabaseError.CONCURRENT_MODIFICATION @ com.google.ads.api.services.campaignmgmt.common.error.DatabaseError.<init>(Datab]</faultstring> <detail> <ns2:ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201809" xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201809"> <message>[DatabaseError.CONCURRENT_MODIFICATION @ com.google.ads.api.services.campaignmgmt.common.error.DatabaseError.<init>(Datab]</message> <ApplicationException.Type>ApiException</ApplicationException.Type> <fieldPath/> <trigger/> <errorString>DatabaseError.CONCURRENT_MODIFICATION</errorString> <ApiError.Type>DatabaseError</ApiError.Type> <reason>CONCURRENT_MODIFICATION</reason> </errors> </ns2:ApiExceptionFault> </detail> </soap:Fault> </soap:Body>... <operations> <operand> <userListId>0000000</userListId> <removeAll>false</removeAll> <membersList> <hashedEmail>123123123123123adfadfadfadfasdf0</hashedEmail> <hashedPhoneNumber>asdfasdfasdfasdfasdfasdfsdf</hashedPhoneNumber> <addressInfo> <hashedFirstName>asdfasdfasdfasdfasdfasdfadsf</hashedFirstName> <hashedLastName>asdfasfasdfdf12313434234</hashedLastName> <countryCode>ES</countryCode> <zipCode>123124</zipCode> </addressInfo> </membersList>
....Hello Qian,
Thank you for reaching out. The CONCURRENT_MODIFICATION error is observed when multiple processes are trying to make changes to a single entity at once. Could you please check the Change History in the Google Ads interface to verify if there were no other changes being made to the account or no scripts were running in the background at the time of the mutate member request? Also, you can implement the error handling model in their code to handle such scenarios where partial failure should be set up and the operations that failed should be retried. Please give this a try and let us know if the issue persists.
Regards,
Nikisha Patel, Google Ads API Team
Hello Qian,
The entity in this scenario will refer to the user list that you are trying to update via API for mutating members of the user list. The concurrent modification error indicates that two or more processes are trying to update the same user list at same instance of time. It might also occur when a user in the AdWords web interface is updating the user list while you are updating the same entity via the API as well. Could you please confirm that even after waiting for about 30 seconds before retrying the request again, the issue is still occurring? Please refer to this guide to avoid such error in future.
Regards,
Nikisha Patel, Google Ads API Team
Hello Qian,
As a suggestion to avoid such errors in a multi threaded environment, I would like to share some best practices from this handy guide. One recommendation in that guide includes : "When you retry requests, use an exponential backoff policy. For example, if you first pause 5 seconds before the first retry, you could pause 10 seconds after the second and 20 seconds after the third retry. Exponential back off helps ensure you are not calling the API too aggressively." As a workaround you could 1) space the requests against the same ID so that any given one finishes before the next one is sent, or 2) consolidate repeated mutates against the same entity into a single request to avoid this issue altogether. Please give this a try and let me know if you have any additional concerns.
Regards,
Nikisha Patel, Google Ads API Team