Some of my servers can no longer authenticate to AdWords API

65 views
Skip to first unread message

bl...@tomis.tech

unread,
Mar 23, 2018, 5:19:10 AM3/23/18
to AdWords API Forum
First of all, I have done this process many times and it works perfectly on my local machine. 

I use OAuth to authenticate in for a new client we have been given Admin access for, like this:

def init(self):
oauth2_client = oauth2.GoogleRefreshTokenClient(
client_id=self._client_id,
client_secret=self._client_secret,
refresh_token=self._refresh_token
)

self._adwords = adwords.AdWordsClient(
developer_token=GOOGLE_ADWORDS_DEVELOPER_TOKEN,
oauth2_client=oauth2_client,
user_agent='tomis',
client_customer_id=self._client_customer_id
)



However, just today, I'm getting an error on several of my servers saying 'HTTPSConnectionWithTimeout' object has no attribute 'proxy_info'

and when I test locally with those same credentials, it works flawlessly. Is there a way to tell if somehow I got blocked or what the status of my developer token is?

Any help will be greatly appreciated, thanks!


Here is the full Traceback:

Traceback (most recent call last):
  File "google_adwords.py", line 765, in <module>
    customer_ids = api.service.get_customer_id_list()
  File "google_adwords.py", line 519, in get_customer_id_list
    results = self.client.GetService(self.service).getCustomers()
  File "/usr/local/lib/python3.6/dist-packages/googleads/common.py", line 786, in MakeSoapRequest
    self._header_handler.SetHeaders(self.suds_client)
  File "/usr/local/lib/python3.6/dist-packages/googleads/adwords.py", line 566, in SetHeaders
    http_headers = self._adwords_client.oauth2_client.CreateHttpHeader()
  File "/usr/local/lib/python3.6/dist-packages/googleads/oauth2.py", line 211, in CreateHttpHeader
    self.Refresh()
  File "/usr/local/lib/python3.6/dist-packages/googleads/oauth2.py", line 226, in Refresh
    self.proxy_config.disable_certificate_validation)))
  File "/usr/local/lib/python3.6/dist-packages/oauth2client/client.py", line 633, in refresh
    self._refresh(http.request)
  File "/usr/local/lib/python3.6/dist-packages/oauth2client/client.py", line 842, in _refresh
    self._do_refresh_request(http_request)
  File "/usr/local/lib/python3.6/dist-packages/oauth2client/client.py", line 874, in _do_refresh_request
    self.token_uri, method='POST', body=body, headers=headers)
  File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 1513, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 1263, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 1186, in _conn_request
    conn.connect()
  File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 982, in connect
    if self.proxy_info and self.proxy_info.isgood():
AttributeError: 'HTTPSConnectionWithTimeout' object has no attribute 'proxy_info'

Stefano Fontana

unread,
Mar 23, 2018, 10:24:52 AM3/23/18
to AdWords API Forum

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Mar 23, 2018, 1:11:32 PM3/23/18
to AdWords API Forum
Hi, 

As Stefano pointed out, could you try the suggestion on that thread? If that doesn't help, could you please post your issue there with the traceback? The library owner is better equipped to address this issue. 

From the traceback, it doesn't seem like an issue specific to the developer token status. To confirm that, you could log into your MCC account which owns the developer token and navigate to AdWords API Center (gear icon on the top right corner -> Account Settings -> AdWords API Center) from the old UI view and confirm that the status is either basic or standard. If you are having trouble finding this, you could share the MCC account id and I can verify that for you. 

Thanks,
Sreelakshmi, AdWords API Team

bl...@tomis.tech

unread,
Mar 23, 2018, 4:45:31 PM3/23/18
to AdWords API Forum
Thanks Stefano, that was totally the issue!

bl...@tomis.tech

unread,
Mar 23, 2018, 4:46:00 PM3/23/18
to AdWords API Forum
Thanks for the quick replies, totally fixed my issue! Thought I had been banned somehow!
Reply all
Reply to author
Forward
0 new messages