CONCURRENT_MODIFICATION in Bulk Mutate method

138 views
Skip to first unread message

Michał Podniesiński

unread,
Mar 7, 2023, 7:52:28 AM3/7/23
to Google Ads API and AdWords API Forum
I'm trying to create huge group of Ads. I have configured campaigns and AdGroups already.
I use bulk mutate method: https://developers.google.com/google-ads/api/reference/rpc/v13/GoogleAdsService#mutate and V13 version in dotnet client.
A single MutateGoogleAdsRequest contains 1000 AdGroupAdOperations like this:
`{
    "customerId": "12345",
    "mutateOperations": [
        {
            "adGroupAdOperation": {
                "create": {
                    "status": "ENABLED",
                    "ad": {
                        "responsiveSearchAd": {
                            "headlines": [
                                {
                                    "text": "XXXXXX"
                                },
                                .
                                .
                                .
                                {
                                    "text": "YYYYYY"
                                }
                            ],
                            "descriptions": [
                                {
                                    "text": "XXXXXX"
                                },
                                .
                                .
                                .
                                {
                                    "text": "ZZZZZZZ"
                                }
                            ],
                            "path1": "P1",
                            "path2": "P2"
                        },
                        "finalUrls": [
                            "https://samplewebsite.com/xyz"
                        ],
                        "name": "1923792"
                    },
                    "adGroup": "customers/12345/adGroups/CCCCCCCC"
                }
            }
        },
        .
        .
        .
        {
            "adGroupAdOperation": {
                "create": {
                    "status": "ENABLED",
                    "ad": {
                        "responsiveSearchAd": {
                            "headlines": [
                                {
                                    "text": "XXXXXX"
                                },
                                .
                                .
                                .
                                {
                                    "text": "YYYYYY"
                                }
                            ],
                            "descriptions": [
                                {
                                    "text": "XXXXXX"
                                },
                                .
                                .
                                .
                                {
                                    "text": "ZZZZZZZ"
                                }
                            ],
                            "path1": "P1",
                            "path2": "P2"
                        },
                        "finalUrls": [
                            "https://samplewebsite.com/xyz"
                        ],
                        "name": "1923786"
                    },
                    "adGroup": "customers/12345/adGroups/DDDDDD"
                }
            }
        }
    ],
    "partialFailure": true,
    "responseContentType": "MUTABLE_RESOURCE"
}`

Every AdGroupAdOperation is related to unique AdGroup. So I have guarantee AdGroup is not shared across multiple MutateGoogleAdsRequests.
AdGroups from AdGroupAdOperations can belong to the same Campaign.
I process multiple MutateGoogleAdsRequests in 2 threads when every thread process one MutateGoogleAdsRequest at time.
After few requests I get errors like this
`{
    "errorCode": {
        "databaseError": "CONCURRENT_MODIFICATION"
    },
    "message": "Multiple requests were attempting to modify the same resource at once. Retry the request.",
    "location": {
        "fieldPathElements": [
            {
                "fieldName": "mutate_operations",
                "index": 0
            },
            {
                "fieldName": "ad_group_ad_operation"
            }
        ]
    }
}`

When I process MutateGoogleAdsRequests in 1 thread, a problem dosen't seem to exist.
It seems strange because, as I wrote above, every AdGroupAdOperation is related to unique AdGroup.

What is the cause of error CONCURRENT_MODIFICATION?

Google Ads API Forum Advisor

unread,
Mar 7, 2023, 10:24:33 AM3/7/23
to mic...@autofixer.com, adwor...@googlegroups.com

Hi Michal,

Thanks for reaching out to the Google Ads API Forum.

I can see that you have opened an issue with us via email support thread. For better tracking of issues and avoiding confusion, you may continue our discussion on email thread with the subject “CONCURRENT_MODIFICATION in Bulk Mutate method”. Thank you!!

Regards,

Google Logo Google Ads API Team

 



ref:_00D1U1174p._5004Q2jWqUM:ref
Reply all
Reply to author
Forward
0 new messages