DeadlineExceededException

673 views
Skip to first unread message

Dihan Cheng

unread,
Jul 17, 2020, 7:41:27 AM7/17/20
to AdWords API and Google Ads API Forum
Hi, I get the following issue after about 1 hour when running a long request,
com.google.api.gax.rpc.DeadlineExceededException: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 3599968461524ns. [buffered_nanos=287954569, buffered_nanos=165571046, remote_addr=googleads.googleapis.com/216.58.193.74:443];

Following is the code where the exception throws out, just standard google ads api SearchStream call,

how to fix this issue? thanks!

try (GoogleAdsServiceClient googleAdsService = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {
ServerStream<SearchGoogleAdsStreamResponse> stream = googleAdsService
.searchStreamCallable().call(searchGoogleAdsStreamRequest)
;

int count = 0;
for (SearchGoogleAdsStreamResponse response : stream) { // where the exception throws out
for (GoogleAdsRow googleAdsRow : response.getResultsList()) {
JsonObject line =
new JsonObject();
AdGroupAd adGroupAd = googleAdsRow.getAdGroupAd();

Dihan Cheng

unread,
Jul 17, 2020, 11:05:28 AM7/17/20
to AdWords API and Google Ads API Forum

I tried to override the deadline by specifying a GrpcCallContext on the api call as following, but still doesn't work


ServerStream<SearchGoogleAdsStreamResponse> stream = googleAdsService
.searchStreamCallable()
    .call(searchGoogleAdsStreamRequest,
GrpcCallContext.createDefault()
.withCallOptions(
CallOptions.DEFAULT.withDeadline(Deadline.after(5, TimeUnit.HOURS))));

Google Ads API Forum Advisor Prod

unread,
Jul 17, 2020, 12:04:08 PM7/17/20
to dch...@newengen.com, adwor...@googlegroups.com
Hi Dihan,

Thank you for reaching out. This could be due to a temporary issue so I would recommend trying again in a little bit. Also, I would recommend using a shorter date range, adding more filters, or querying less attributes in order to help avoid this error as the result is probably very large which is why it is taking longer than the deadline.

Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5004Q21mofA:ref

Dihan Cheng

unread,
Jul 17, 2020, 12:23:09 PM7/17/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

  Thanks for the reply. Partial data is not meaningful for us. I'm wondering why "override the deadline by specifying a GrpcCallContext" does not work for me? I tried to override the deadline by 5 hours.

thanks,

Dihan

Google Ads API Forum Advisor Prod

unread,
Jul 20, 2020, 10:07:41 AM7/20/20
to dch...@newengen.com, adwor...@googlegroups.com
Hi Dihan,

Could you please share your client customer ID and complete detailed request and response logs of the call via Reply privately to author so I can further investigate the issue? You can find information on enabling logging here.
Reply all
Reply to author
Forward
0 new messages