Connection reset by peer in search_stream

285 views
Skip to first unread message

Nikoloz Chkheidze

unread,
Jun 14, 2023, 8:49:17 AM6/14/23
to Google Ads API and AdWords API Forum
Hello,

When I make a request to search_stream with the following query, after some time this error is being thrown:

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/google/api_core/grpc_helpers.py", line 112, in __next__ return next(self._wrapped) File "/usr/local/lib/python3.10/site-packages/google/ads/googleads/interceptors/response_wrappers.py", line 108, in __next__ raise e File "/usr/local/lib/python3.10/site-packages/google/ads/googleads/interceptors/response_wrappers.py", line 105, in __next__ self._failure_handler(self._underlay_call) File "/usr/local/lib/python3.10/site-packages/google/ads/googleads/interceptors/exception_interceptor.py", line 71, in _handle_grpc_failure raise self._get_error_from_response(response) File "/usr/local/lib/python3.10/site-packages/google/ads/googleads/interceptors/response_wrappers.py", line 88, in __next__ message = next(self._underlay_call) File "/usr/local/lib/python3.10/site-packages/grpc/_channel.py", line 475, in __next__ return self._next() File "/usr/local/lib/python3.10/site-packages/grpc/_channel.py", line 694, in _next return self._next_response() File "/usr/local/lib/python3.10/site-packages/grpc/_channel.py", line 669, in _next_response raise self grpc._channel._SingleThreadedRendezvous: <_SingleThreadedRendezvous of RPC that terminated with: status = StatusCode.UNAVAILABLE details = "recvmsg:Connection reset by peer" debug_error_string = "UNKNOWN:Error received from peer ipv4:64.233.166.95:443 {created_time:"2023-06-14T11:16:20.202841323+00:00", grpc_status:14, grpc_message:"recvmsg:Connection reset by peer"}"

Here is the query being used:

SELECT
segments.date,
customer.descriptive_name,
customer.id,
detail_placement_view.group_placement_target_url,
detail_placement_view.target_url,
customer.currency_code,
metrics.impressions,
metrics.clicks,
metrics.cost_micros
FROM
detail_placement_view
WHERE
segments.date>='2022-01-01' AND segments.date<='2023-05-31' AND metrics.cost_micros > 0

The error happens after around 20 minutes of downloading the report. Changing the date range to be smaller works fine, the downloading takes around 3 hours but it works without an issue, but with the provided query, it fails with the error given above in around 20 minutes.

Google Ads API and AdWords API Forum

unread,
Jun 14, 2023, 3:41:02 PM6/14/23
to Google Ads API and AdWords API Forum
Re-posting the last inquiry (https://groups.google.com/g/adwords-api/c/NWvlesi2Of8) from the forum as it wasn't routed to our support queue.

Regards,
Google Ads API Team

Google Ads API Forum Advisor

unread,
Jun 19, 2023, 4:02:57 PM6/19/23
to adwor...@googlegroups.com

Hi,

I'm from the Google Ads API team. I hope you're doing great today.

I suggest that you check this documentation (https://developers.google.com/google-ads/api/docs/client-libs/python/timeouts#streaming_call_timeouts) for more information on how to override the default timeout for GoogleAdsService.SearchStream API calls in the Google Ads API Python client library. The example also shows how to include a retry parameter in your request.

If you're still encountering issues after configuring the client library, I suggest you reach out to the Python client library authors in this link (https://github.com/googleads/google-ads-python/issues) as they are better equipped to assist you on why you are getting the error.

This message is in relation to case "ref:_00D1U1174p._5004Q2mD5mp:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages