Hello.
Your request was stopped while using the Google Search API.
No error occurred and logging was stopped.
If you try again, it's requested normally, but we need Batch every day.
I also used the timeout function, but it's not working properly. Was there anything I misused?
Code
==================================================================== client = GoogleAdsClient.load_from_dict(GOOGLE_CONFIG)
client.login_customer_id = config.GOOGLE_LOGIN_CUSTOMER_ID
ga_service = client.get_service("GoogleAdsService")
query = f"""
SELECT ad_group.resource_name,
ad_group.id,
ad_group.name , ad_group.status, ad_group.campaign
,
campaign.id,
campaign.name, campaign.start_date, campaign.end_date
, ad_group.type, ad_group.ad_rotation_mode, ad_group.display_custom_bid_dimension
FROM ad_group
WHERE campaign.start_date >= {LAST_WEEK}
"""
for ad_account in ad_accounts:
request = client.get_type("SearchGoogleAdsRequest")
request.customer_id = ad_account.CUSTOMER_CLIENT_ID
request.query = query
# Call Google API after request setting
response = ga_service.search(request=request, retry=Retry(timeout=60))
====================================================================
Logging
====================================================================
Request
-------
Method: /google.ads.googleads.v15.services.GoogleAdsService/Search
Host:
googleads.googleapis.comHeaders: {
"developer-token": "REDACTED",
"login-customer-id": "3988518378",
"x-goog-api-client": "gl-python/3.9.18 grpc/1.60.0 gax/2.15.0 gccl/22.1.0 pb/4.23.4",
"x-goog-request-params": "customer_id=
2089577697"
}
Request: customer_id: "
2089577697"
query: "\n SELECT ad_group.resource_name,
ad_group.id,
ad_group.name\n , ad_group.status, ad_group.campaign \n ,
campaign.id,
campaign.name, campaign.start_date, campaign.end_date\n , ad_group.type, ad_group.ad_rotation_mode, ad_group.display_custom_bid_dimension\n FROM ad_group\n WHERE campaign.start_date >= 20240415\n "
Response
-------
Headers: {
"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
"content-disposition": "attachment",
"date": "Mon, 22 Apr 2024 00:43:18 GMT",
"request-id": "7hAv080ovk4kQ2m2iKGqNQ"
}
Response: field_mask {
paths: "ad_group.resource_name"
paths: "
ad_group.id"
paths: "
ad_group.name"
paths: "ad_group.status"
paths: "ad_group.campaign"
paths: "
campaign.id"
paths: "
campaign.name"
paths: "campaign.start_date"
paths: "campaign.end_date"
paths: "ad_group.type"
paths: "ad_group.ad_rotation_mode"
paths: "ad_group.display_custom_bid_dimension"
}
Request made: ClientCustomerId:
2089577697, Host:
googleads.googleapis.com, Method: /google.ads.googleads.v15.services.GoogleAdsService/Search, RequestId: 7hAv080ovk4kQ2m2iKGqNQ, IsFault: False, FaultMessage: None
<-- This is where logging stops, the process stops without ending.
=======================================================================
Thanks.