Comments (8)
I'm on python 3.3.4 on a windows 7 x64 system.
from googleads-python-lib.
We're looking into this.
from googleads-python-lib.
Let me know if you need any additional information, I'd be happy to provide.
I did read that this might have something to do with urllib and that urllib2 may handle the proxy differently.
from googleads-python-lib.
Same problem here guys.. I'm trying to make this work for one month now. Before I was using the old python library.. but now I'm using this new one.
Here's my info so far:
Proxy: Squid 3.1.10
OS: CentOS 6.5
Python 2.7.6
I'm opening the client like this:
client = adwords.AdWordsClient(DEVELOPER_TOKEN, oauth2_client, USER_AGENT, CLIENT_CUSTOMER_ID,https_proxy='proxy.qa.vmcommerce.intra:3128')
But the code stuck on the point where suds try to make a request to get the WSDL info from url: https://adwords.google.com/api/adwords/cm/v201402/CampaignService?wsdl .
On adwords.py (method GetService) you have:
client = suds.client.Client(
self._SOAP_SERVICE_FORMAT %
(server, _SERVICE_MAP[version][service_name], version, service_name))
I think the problem here is that the https_proxy info is not being passed to suds Client constructor. The https_proxy config is being used a few lines after this:
if self.https_proxy: client.set_options(proxy={'https': self.https_proxy})
And then I got this exception:
Traceback (most recent call last):
File "get_campaigns.py", line 16, in
campaign_service = client.GetService('CampaignService', version='v201402')
File "/opt/python2.7/lib/python2.7/site-packages/googleads-1.0.3-py2.7.egg/googleads/adwords.py", line 193, in GetService
(server, _SERVICE_MAP[version][service_name], version, service_name))
File "/opt/python2.7/lib/python2.7/site-packages/suds_jurko-0.6-py2.7.egg/suds/client.py", line 115, in init
self.wsdl = reader.open(url)
File "/opt/python2.7/lib/python2.7/site-packages/suds_jurko-0.6-py2.7.egg/suds/reader.py", line 150, in open
d = self.fn(url, self.options)
File "/opt/python2.7/lib/python2.7/site-packages/suds_jurko-0.6-py2.7.egg/suds/wsdl.py", line 136, in init
d = reader.open(url)
File "/opt/python2.7/lib/python2.7/site-packages/suds_jurko-0.6-py2.7.egg/suds/reader.py", line 74, in open
d = self.download(url)
File "/opt/python2.7/lib/python2.7/site-packages/suds_jurko-0.6-py2.7.egg/suds/reader.py", line 92, in download
fp = self.options.transport.open(Request(url))
File "/opt/python2.7/lib/python2.7/site-packages/suds_jurko-0.6-py2.7.egg/suds/transport/https.py", line 62, in open
return HttpTransport.open(self, request)
File "/opt/python2.7/lib/python2.7/site-packages/suds_jurko-0.6-py2.7.egg/suds/transport/http.py", line 67, in open
return self.u2open(u2request)
File "/opt/python2.7/lib/python2.7/site-packages/suds_jurko-0.6-py2.7.egg/suds/transport/http.py", line 132, in u2open
return url.open(u2request, timeout=tm)
File "/opt/python2.7/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/opt/python2.7/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/opt/python2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/opt/python2.7/lib/python2.7/urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/opt/python2.7/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
urllib2.URLError: urlopen error [Errno 101] Network is unreachable
Please let me know if you need any tests from my end.
from googleads-python-lib.
New progress:
If you pass the parameter proxy= to suds Client it will work:
from suds.client import Client
import logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('suds.transport').setLevel(logging.DEBUG)
url = 'https://adwords.google.com/api/adwords/cm/v201402/CampaignService?wsdl'
client = Client(url, proxy={ 'http' : 'http://proxy.qa.vmcommerce.intra:3128', 'https' : 'http://proxy.qa.vmcommerce.intra:3128' })
print client
from googleads-python-lib.
Code forked and working fine now on https://github.com/rodrigoreis22/googleads-python-lib
from googleads-python-lib.
Alright, so it seems like there's 2 problems here. I'll work in the fix rodrigoreis22 mentioned: passing the proxy into the Client constructor instead, so the fetching of the WSDL uses the proxy too.
As for the original reported issue by dreyco676, I'm less certain. Was this the cause of your problem too? It seems that urllib2 isn't designed to use a proxy at an https:// URL, resulting in timeouts or connection reset by peer messages. Using a proxy with an http:// address resolves this, but I'm not certain of the security implications yet.
from googleads-python-lib.
The issues brought up earlier have been resolved, though feel free to comment if you have additional questions.
from googleads-python-lib.
Related Issues (20)
- Error: No module named 'google.api_core HOT 1
- How to properly use the API to generate a report? HOT 2
- Generating a report and getting different values HOT 2
- How to filter by Child Publisher Network Code?
- How to export the API generated report in the UI? HOT 9
- How to get all mobile applications using the api?
- Is there a way to get all apps that are on the report and not on the inventory? HOT 2
- How to filter a report using an app name with a backtick?
- Enable constructing GoogleServiceAccountClient with Credentials.from_service_account_info method HOT 1
- Google Group for the Ads API no longer available HOT 1
- Google Ad Manager API - googleads library compatibility HOT 1
- When is googleads 36.0.0 python package sunset date? HOT 4
- GoogleRefreshTokenClient could not authenticate to create AdManager Client - 401 Unauthorized HOT 1
- KeyError occured when trying to access the 'report_service.runReportJob()' function HOT 1
- Method to authenticate via environment variables HOT 1
- Google Ad Manager API Custom Dimensions Using saved_report_query HOT 1
- ProxyError: 407: Authentification required HOT 5
- How to check if the service account is connected/invited to the someone else Google Ads? HOT 1
- Help Needed: Error while Retrieving First Party Audience Segmentations in GoogleAds Python Library [ServerError.SERVER_ERROR @ ]' HOT 1
- urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]: unable to get local issuer certificate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googleads-python-lib.