Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeouts in getReportDownloadUrlWithOptions #200

Closed
kerkela opened this issue Apr 10, 2017 · 7 comments
Closed

Timeouts in getReportDownloadUrlWithOptions #200

kerkela opened this issue Apr 10, 2017 · 7 comments
Assignees

Comments

@kerkela
Copy link

kerkela commented Apr 10, 2017

This looks a lot like #20 which @nicholaschen indicated should have been fixed by the Suds client having a 1 hour timeout,
but I'm seeing this timeout after about 90 seconds. It's happening consistently for certain (larger) accounts with certain (larger) sets of dimensions.
Meanwhile it succeeds for smaller accounts and/or fewer dimensions.
FWIW I'm using googleads 5.3.0 & DFP version v201702, though it failed identically for slightly older versions of each on testing.
I've doublechecked that socket.setdefaulttimeout has no impact as well.

Stack trace:
sb1.tests.e2e: ERROR: Problem downloading 20170410x225736xC4C907A4 filename=download_util.py, lineno=75
Traceback (most recent call last):
...
File "/Users/stacy/distillerizer/sb1/sources/dfp_util.py", line 506, in get_report_url
return service.getReportDownloadUrlWithOptions(job_id, options)
File "/Users/stacy/distillerizer/venv/lib/python2.7/site-packages/googleads/common.py", line 643, in MakeSoapRequest
for arg in args])
File "/Users/stacy/distillerizer/venv/lib/python2.7/site-packages/suds/client.py", line 521, in call
return client.invoke(args, kwargs)
File "/Users/stacy/distillerizer/venv/lib/python2.7/site-packages/suds/client.py", line 581, in invoke
result = self.send(soapenv)
File "/Users/stacy/distillerizer/venv/lib/python2.7/site-packages/suds/client.py", line 613, in send
reply = self.options.transport.send(request)
File "/Users/stacy/distillerizer/venv/lib/python2.7/site-packages/suds/transport/http.py", line 82, in send
fp = self.u2open(u2request)
File "/Users/stacy/distillerizer/venv/lib/python2.7/site-packages/suds/transport/http.py", line 132, in u2open
return url.open(u2request, timeout=tm)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1200, in do_open
r = h.getresponse(buffering=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1132, in getresponse
response.begin()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 453, in begin
version, status, reason = self._read_status()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 409, in _read_status
line = self.fp.readline(_MAXLINE + 1)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 480, in readline
data = self._sock.recv(self._rbufsize)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 734, in recv
return self.read(buflen)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 621, in read
v = self._sslobj.read(len or 1024)
SSLError: ('The read operation timed out',)

My code:
downloader = self._dfp_client.GetDataDownloader(version=VERSION)
job_id = downloader.WaitForReport(report_job)
service = self._dfp_client.GetService('ReportService', version=VERSION)
report_url = get_report_url(job_id, service)
response = urllib2.urlopen(report_url)
while True:
chunk = response.read(_CHUNK_SIZE)
if not chunk:
break
file_handle.write(chunk)

report job:
{
reportQuery =
(ReportQuery){
dimensions[] =
"DATE",
"LINE_ITEM_ID",
"LINE_ITEM_NAME",
"LINE_ITEM_TYPE",
"ORDER_ID",
"ORDER_NAME",
"AD_UNIT_ID",
"AD_UNIT_NAME",
"CREATIVE_SIZE",
"DEVICE_CATEGORY_ID",
"DEVICE_CATEGORY_NAME",
"COUNTRY_NAME",
"COUNTRY_CRITERIA_ID",
"ADVERTISER_ID",
"ADVERTISER_NAME",
"CREATIVE_NAME",
"CREATIVE_ID",
"CREATIVE_TYPE",
"CREATIVE_BILLING_TYPE",
"PLACEMENT_NAME",
"PLACEMENT_ID",
adUnitView = "FLAT"
columns[] =
"AD_SERVER_IMPRESSIONS",
"AD_SERVER_CLICKS",
"AD_EXCHANGE_LINE_ITEM_LEVEL_IMPRESSIONS",
"AD_EXCHANGE_LINE_ITEM_LEVEL_CLICKS",
"AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM",
dimensionAttributes[] =
"AD_UNIT_CODE",
"LINE_ITEM_COST_PER_UNIT",
startDate =
(Date){
year = 2017
month = 4
day = 9
}
endDate =
(Date){
year = 2017
month = 4
day = 9
}
dateRangeType = "CUSTOM_DATE"
useSalesLocalTimeZone = False
}
}

with the following options
{'exportFormat': 'CSV_DUMP', 'useGzipCompression': True}
or
{'exportFormat': 'CSV_DUMP', 'useGzipCompression': False}

@kerkela kerkela changed the title Timeouts in getReportDownloadUrl Timeouts in getReportDownloadUrlWithOptions Apr 10, 2017
@msaniscalchi
Copy link
Contributor

Thanks for the report, we'll look into it.

@grivescorbett grivescorbett self-assigned this Apr 11, 2017
@manoochehri
Copy link

Hi @grivescorbett - any updates on this bug? This is causing a blocking issue for several large DFP customers.

@grivescorbett
Copy link
Contributor

grivescorbett commented Apr 21, 2017 via email

@manoochehri
Copy link

Thanks @grivescorbett - I appreciate it, looking forward to the fix.

@manoochehri
Copy link

@grivescorbett - any update on your fix? Even a patch would be helpful for us.

@grivescorbett
Copy link
Contributor

Hi Michael,

Sorry for the delay. I'm targeting a new release of the python client lib by EOD Eastern today.

Best,
Gabe

@grivescorbett
Copy link
Contributor

Resolved in 5.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants