Closed nev7n closed 2 years ago
@nev7n - this is likely due to a timeout on the server side. Do you know about how long the stream stays open before this error is encountered? I believe there is a 60 minute timeout on our end that may cause this. In general the only way to fix this is to retry the request, but if it's happening consistently at around the 60 minute mark I would try splitting your request into smaller ones and aggregating the results on the client side if necessary.
@BenRKarl - yes the stream was being closed after 60 minutes so sounds like it was hitting the 60 minute server side timeout, the stream of data seems to have hung sending data a while before that so I think it's possibly hit some either server side size/timeout limit before that.
In any case we worked around the issue by downloading the RSA ads one campaign at a time, and given it seems to be caused by server side limits I think this is unlikely to be an issue with the google ads python library.
Describe the bug: Initially reported via the Google Ads Support forum, who asked that we raise the issue here:
Getting an exception trying to download around 422,000 RSA ads, this was working until recently when we consistently started seeing "Stream removed" errors. We've worked around the issue by splitting the download into multiple downloads one Campaign at a time, but still posting here in case it can be fixed or recommendations for maximum download sizes added to documentation.
Steps to Reproduce: Use query similar to:
to download Responsive Search Ads from an account with 422k ads.
Code snippet:
The ads start streaming but after a while an exception is thrown while reading the results.
Expected behavior: Ads are downloaded.
Client library version and API version: Client library version: google-ads==17.0.0 Google Ads API version: v10
Request/Response Logs:
Anything else we should know about your project / environment: Python version 3.8.13