RE: GoogleAds V5 - PHP - AddBatchJobOperations socket closed

214 views
Skip to first unread message
Message has been deleted

Google Ads API Forum Advisor Prod

unread,
Oct 14, 2020, 11:43:30 PM10/14/20
to goo...@spammerz.de, adwor...@googlegroups.com
Hi,

Thank you for reaching out. However, I had to delete your initial post and re-post it below, as it contains logs and account information. For security, you may avoid posting such information and only send to our team when requested and in private only, via the Reply privately to author option.

"Hey there,

we are currently facing several issue when using the new GoogleAds V5 API. After solving some issues and updating to the latest version of the libraries some of the issues were already resolved.

Currently we are stuck with an error while trying to add adGroupAdOperations via AddBatchJobOperations. The problem seems to happen rather randomly, since sometimes we are able to add 20 operations, sometimes 80 operations and sometimes even less, before the error appears. The ads are always exactly the same ones and in the same order every try. So it does not seem to be related to a specific ad itself.

In addition to this we already experimented with different retrySettings / timeouts increasing them to higher values to ensure it does not hit them. Average runtime seems to be between 20 and 60 seconds regardless.


$optionalArgs['timeoutMillis']
$optionalArgs['retrySettings']['initialRetryDelayMillis']
$optionalArgs['retrySettings']['retryDelayMultiplier']
$optionalArgs['retrySettings']['maxRetryDelayMillis']
$optionalArgs['retrySettings']['initialRpcTimeoutMillis']
$optionalArgs['retrySettings']['rpcTimeoutMultiplier']
$optionalArgs['retrySettings']['maxRpcTimeoutMillis']
$optionalArgs['retrySettings']['totalTimeoutMillis']

See the following logging output from the logs for request and response.

--
[2020-10-14T06:23:12.139997+00:00] google-ads.NOTICE: Request

Method Name: /google.ads.googleads.v5.services.BatchJobService/AddBatchJobOperations
Host: googleads.googleapis.com
Headers: {
    "x-goog-api-client": "gl-php\/7.4.6 gapic\/ gax\/1.5.0 grpc\/1.32.0",
    "x-goog-request-params": "resource_name=customers\/XXXXXXXX\/batchJobs\/XXXXXXXX",
    "developer-token": "REDACTED",
    "login-customer-id": "XXXXXXXX"
}
Request: {"resourceName":"customers\/XXXXXXXX\/batchJobs\/XXXXXXXX","sequenceToken":"XXXXXXXX","mutateOperations":[{"adGroupAdOperation":{"create":{"status":"ENABLED","adGroup":"customers\/XXXXXXXX\/adGroups\/XXXXXXXX","ad":{"id":"-13", CONTENT REMOVED}

Response
-------
Headers: []

Fault
-------
Status code: 14
Details: Socket closed
Failure: {}

--
This error message is currently always followed by another error stating "invalid sequence token". Allthough this is most likely just a followup error based on the previous error.

--
[2020-10-14T06:27:26.163674+00:00] google-ads.WARNING: Request made: Host: "googleads.googleapis.com", Method: "/google.ads.googleads.v5.services.BatchJobService/AddBatchJobOperations", CustomerId: XXXXXXXX, RequestId: "XXXXXXXX", IsFault: 1, FaultMessage: "["The sequence token was invalid."]"
[2020-10-14T06:27:26.187647+00:00] google-ads.NOTICE: Request
-------
Method Name: /google.ads.googleads.v5.services.BatchJobService/AddBatchJobOperations
Host: googleads.googleapis.com
Headers: {
    "x-goog-api-client": "gl-php\/7.4.6 gapic\/ gax\/1.5.0 grpc\/1.32.0",
    "x-goog-request-params": "resource_name=customers\/XXXXXXXX\/batchJobs\/XXXXXXXX",
    "developer-token": "REDACTED",
    "login-customer-id": "XXXXXXXX"
}
Request: {"resourceName":"customers\/XXXXXXXX\/batchJobs\/XXXXXXXX","sequenceToken":"XXXXXXXX","mutateOperations":[{"adGroupAdOperation":{"create":{"status":"ENABLED","adGroup":"customers\/XXXXXXXX\/adGroups\/XXXXXXXX","ad":{"id":"-13", CONTENT REMOVED}

Response
-------
Headers: {
    "request-id": "XXXXXXXX",
    "date": "Wed, 14 Oct 2020 06:27:26 GMT",
    "alt-svc": "h3-Q050=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
}

Fault
-------
Status code: 3
Details: Request contains an invalid argument.
Failure: {"errors":[{"errorCode":{"batchJobError":"INVALID_SEQUENCE_TOKEN"},"message":"The sequence token was invalid."}]}"


Moving forward, allow me to reach out to the rest of our team so we can investigate the INVALID_SEQUENCE_TOKEN you have been encountering randomly after migrating.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q26979I:ref

Methorz

unread,
Oct 15, 2020, 12:46:27 AM10/15/20
to AdWords API and Google Ads API Forum
Hey Peter,

thanks for the update. Tried to provide as much information as possible :)

After digging deeper into the issue I found this https://github.com/googleapis/google-cloud-php/issues/2427

From my current point of view this sounds very similar to the issue I am currently having. All tough I am not 100% certain, I currently assume it that the problem is due to grpc.

Regards

Thorsten 

Methorz

unread,
Oct 15, 2020, 1:04:06 AM10/15/20
to AdWords API and Google Ads API Forum

Just a small addition: I have been able to execute everything without problems when switching the transport on the google ads client from the default (grpc) to 'rest'.
Using the rest transport seems to solve the problem for me and at the same time confirms my suspicion that the problem is with the grpc library or somewhere along that.

Methorz

unread,
Oct 19, 2020, 12:56:37 AM10/19/20
to AdWords API and Google Ads API Forum
Hey there,

I would like to know if there are some news regarding this issue, since currently we are not really able to consistently use this API.

Regards,

Thorsten

Google Ads API Forum Advisor Prod

unread,
Nov 11, 2020, 2:20:06 PM11/11/20
to goo...@spammerz.de, adwor...@googlegroups.com
Hi Thorsten,

Apologies for the delayed response - I've looped in the engineering team that focuses on batch jobs to see if they can help investigate. I'll be working with them and will follow up here as soon as I have more information.

Best,
Ben Karl, Google Ads API Team

ref:_00D1U1174p._5004Q26979I:ref

Google Ads API Forum Advisor Prod

unread,
Jan 5, 2021, 1:29:30 PM1/5/21
to goo...@spammerz.de, adwor...@googlegroups.com
Hi Thorsten,

I've been corresponding with the engineering team about your issue and wanted to confirm something before pressing forward. Specifically, regarding your implementation when submitting batch job requests, are you using the sequence token from the previously submitted request, as described here?

Just wanted to confirm that before we move forward investigating.

Thanks,
Ben, Google Ads API Team

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