Re: Google Ads API: How to catch the 504 Deadline Exceeded error (Python)

2019-04-24 Thread Mat
Apparently we should never have to bother with this bug, because it should 
already be caught in the Python library. But there seems to be an issue:

https://github.com/googleads/google-ads-python/issues/87
 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/bbfa1aea-e1f2-4909-8b47-ac078e08fe0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Google Ads API: How to catch the 504 Deadline Exceeded error (Python)

2019-04-23 Thread googleadsapi-forumadvisor via AdWords API and Google Ads API Forum


Hi Mat,

Could you please send over through *reply privately to author *some of the
API calls you are making that are resulting in this error?

Thanks,
Anthony
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
https://ads-developers.googleblog.com/search/label/google_ads_api
https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 04/23/19 09:18:18 m...@keyword-experte.de wrote:

Hi,

I keep getting the occational 504 Deadline Exceeded error while using the
Google Ads API, where I never got this error before while using the AdWords
API (for the same tasks).
There seems to be no pattern and usually I can't reproduce the error. It
occures randomly in about one of several hundred queries, but some of them
are crucial. So I want to catch this error, wait a minute and send the
request again. But I'm struggling with how to catch this error.

I've tried somthing like this, but it won't catch this type of error but
raises the error immediately without retry:

  for i in range(4):
try:
  results = ga_service.search(customer_id, query=query,
page_size=PAGE_SIZE)
  break
except Exception as error:
  print("Error on try %s: %s" % (i,  error))
  if i == 3:
raise
  else:
time.sleep(60)
continue
except:
  print("Error on try %s" % (i))
  if i == 3:
raise
  else:
time.sleep(60)
continue

What's wrong?

Regards
Mat

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/5d2e6fdd-22a5-48cc-a4f2-a07b362db101%40googlegroups.com

.
For more options, visit https://groups.google.com/d/optout.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/1a0j32008jp3d2000e710ow6smj8c1n6oo30c1g68r32dpk%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Google Ads API: How to catch the 504 Deadline Exceeded error (Python)

2019-04-23 Thread Mat
Hi,

I keep getting the occational 504 Deadline Exceeded error while using the 
Google Ads API, where I never got this error before while using the AdWords 
API (for the same tasks).
There seems to be no pattern and usually I can't reproduce the error. It 
occures randomly in about one of several hundred queries, but some of them 
are crucial. So I want to catch this error, wait a minute and send the 
request again. But I'm struggling with how to catch this error.

I've tried somthing like this, but it won't catch this type of error but 
raises the error immediately without retry:

  for i in range(4):
try:
  results = ga_service.search(customer_id, query=query, 
page_size=PAGE_SIZE)
  break
except Exception as error:
  print("Error on try %s: %s" % (i,  error))
  if i == 3:
raise
  else:
time.sleep(60)
continue  
except:
  print("Error on try %s" % (i))
  if i == 3:
raise
  else:
time.sleep(60)
continue  

What's wrong?

Regards
Mat

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/5d2e6fdd-22a5-48cc-a4f2-a07b362db101%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.