Open GoogleCodeExporter opened 9 years ago
I will also get this error periodically with the Drive API. It will
sporadically happen, but otherwise not happen most of the time. It's as if
there's a malformed response. I'll either do the same operation again, or
remount, and it'll be fine.
ERROR Could not send delete for entry with ID
[0B2iR2qHm9cDTdWstXzczV2NNdGs].#012
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gdrivefs-0.13.4-py2.7.egg/gdrivefs/gdtool/drive.py", line 685, in remove_entry
result = client.files().delete(args).execute()
File "/usr/local/lib/python2.7/dist-packages/google_api_python_client-1.2-py2.7.egg/oauth2client/util.py", line 132, in positional_wrapper
return wrapped(args, *kwargs)
File "/usr/l ocal/lib/python2.7/dist-packages/google_api_python_client-1.2-py2.7.egg/apiclient/http.py", line 716, in execute
body=self.body, headers=self.headers)
File "/usr/local/lib/python2.7/dist-packages/google_api_python_client-1.2-py2.7.egg/oauth2client/util.py", line 132, in positional_wrapper
return wrapped(args, *kwargs)
File "/usr/local/lib/python2.7/dist-packages/google_api_python_client-1.2-py2.7.egg/oauth2client/client.py", line 490, in new_request
redirections, connection_type)
File "/usr/local/lib/pytho n2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/init.py", line 1570, in request
(response, content) = self.request(conn, authority, uri, requesturi, method, body, headers, redirections, cachekey)
File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/init.py", line 1317, in request
(response, content) = self.conn_request(conn, request_uri, method, body, headers)
File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/init.py", line 1286, in connrequest
response = conn.getresponse()
File "/usr/lib/python2.7/httplib.py", line 1034, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 407, in begin
version, status, reason = self.readstatus()
File "/usr/lib/python2.7/httplib.py", line 371, in readstatus
raise BadStatusLine(line)
BadStatusLine: ''
Very annoying.
Original comment by myselfasunder@gmail.com
on 14 Nov 2013 at 2:09
Also, after reading this SO post, there's a chance that the token expires
mid-operation:
http://stackoverflow.com/questions/17180433/google-mirror-api-throwing-badstatus
line-exception-python . In their case, it's a very-long upload. Theoretically,
though, it could occur during a short operation.
Original comment by myselfasunder@gmail.com
on 14 Nov 2013 at 2:12
Eventually I switched to only using the google-api lib to process the refresh
token (before each request, I only make 3 a day), and make the http requests
myself with python-request
(https://github.com/datagovuk/ckanext-ga-report/blob/master/ckanext/ga_report/do
wnload_analytics.py#L251-L280) , and I've not had a problem since. No idea if
it is related or not.
BadStatusLine gets thrown when the server returns nothing, not even an error
response code, and so I imagine that somewhere on the analytics back-end it is
failing to provide any response at all. Whatever the reason, I'm not sure this
is a 'working as intended' ;) A 502, or 504 would be nicer.
Original comment by rossdjo...@gmail.com
on 14 Nov 2013 at 2:26
Yeah I have the same problem. I have had some success by just trying twice,
but even them it doesn't really work:
try:
return request.execute()
except httplib.BadStatusLine as e:
print e.line, e.message
print '[GOOGLE_CALENDAR]: Got BadStatusLine. Retrying...'
try:
return request.execute()
except httplib.BadStatusLine as e:
print '[GOOGLE_CALENDAR]: Got BadStatusLine again! Raising.'
raise
Original comment by Dan.r.sc...@gmail.com
on 13 Oct 2014 at 12:37
Original issue reported on code.google.com by
rossdjo...@gmail.com
on 3 Oct 2013 at 2:40