get_userprofiles.py - Crashes with ResponseNotReady()
beninst opened this issue · 1 comments
Hello,
I am trying to get a list of users from the API. I´m using the "googleads-dfa-reporting-samples/python/v3_0/get_userprofiles.py" example. Unfortunately the script crashes with an ResponseNotReady() exception.
Here is the full error:
Traceback (most recent call last):
File "auth_test.py", line 50, in <module>
main(sys.argv)
File "auth_test.py", line 30, in main
service = dfareporting_utils.setup(flags)
File "[DELETED]/DataAcquisitionAndProcessing/xDCM/dfareporting_utils.py", line 109, in setup
credentials = load_application_default_credentials()
File "[DELETED]/DataAcquisitionAndProcessing/xDCM/dfareporting_utils.py", line 68, in load_application_default_credentials
credentials = client.GoogleCredentials.get_application_default()
File "/home/LinuxUser/.local/lib/python2.7/site-packages/oauth2client/client.py", line 1271, in get_application_default
return GoogleCredentials._get_implicit_credentials()
File "/home/LinuxUser/.local/lib/python2.7/site-packages/oauth2client/client.py", line 1256, in _get_implicit_credentials
credentials = checker()
File "/home/LinuxUser/.local/lib/python2.7/site-packages/oauth2client/client.py", line 1187, in _implicit_credentials_from_gce
if not _in_gce_environment():
File "/home/LinuxUser/.local/lib/python2.7/site-packages/oauth2client/client.py", line 1042, in _in_gce_environment
if NO_GCE_CHECK != 'True' and _detect_gce_environment():
File "/home/LinuxUser/.local/lib/python2.7/site-packages/oauth2client/client.py", line 999, in _detect_gce_environment
http, _GCE_METADATA_URI, headers=_GCE_HEADERS)
File "/home/LinuxUser/.local/lib/python2.7/site-packages/oauth2client/transport.py", line 282, in request
connection_type=connection_type)
File "/home/LinuxUser/.local/lib/python2.7/site-packages/httplib2/__init__.py", line 1659, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/home/LinuxUser/.local/lib/python2.7/site-packages/httplib2/__init__.py", line 1399, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/home/LinuxUser/.local/lib/python2.7/site-packages/httplib2/__init__.py", line 1355, in _conn_request
response = conn.getresponse()
File "/usr/lib/python2.7/httplib.py", line 1123, in getresponse
raise ResponseNotReady()
httplib.ResponseNotReady
I am using:
- Python 2.7
- Ubuntu (Windows 10 Subsystem) - On my local machine
- No command line arguments
- I have the "client_secret.json" in the same directory as the python script
Any help would be greatly appreciated.
Greetings,
beninst
Hey beninst,
I'm not able to reproduce this, but from the stacktrace it looks like an issue with the client library (or one of it's dependencies) rather than the sample itself. Could you try pulling in the latest versions of the oauth2client and httplib2 deps and see if that helps any?
pip install --upgrade oauth2client
pip install --upgrade httplib2
If not, you can comment out the call to load application default credentials in dfareporting_utils.py to unblock your testing: https://github.com/googleads/googleads-dfa-reporting-samples/blob/master/python/v3_0/dfareporting_utils.py#L116
Regards,
-- Jonathon Imperiosi, DCM API Team