urllib2.URLError: <urlopen 错误 [Errno 32] Broken pipe - Google Leads

Posted

技术标签:

【中文标题】urllib2.URLError: <urlopen 错误 [Errno 32] Broken pipe - Google Leads【英文标题】:urllib2.URLError: <urlopen error [Errno 32] Broken pipe - Google Leads 【发布时间】:2015-11-16 19:18:50 【问题描述】:

我正在尝试通过 Adwords API 将文件上传到 Google,并且我在此处使用 Google 提供的脚本:https://github.com/googleads/googleads-python-lib

几分钟后我收到以下错误。我在一个较小的文件上试过这个,它可以工作。不知道为什么它在这里打破。有什么想法吗?

  File "./g_leads.sh", line 71, in <module>
    main(adwords_client, EMAILS)
  File "./g_leads.sh", line 43, in main
    response = user_list_service.mutateMembers([mutate_members_operation])
  File "/opt/stateadm/.local/lib/python2.7/site-packages/googleads/common.py", line 296, in MakeSoapRequest
    for arg in args])
  File "/opt/stateadm/.local/lib/python2.7/site-packages/suds/client.py", line 521, in __call__
    return client.invoke(args, kwargs)
  File "/opt/stateadm/.local/lib/python2.7/site-packages/suds/client.py", line 581, in invoke
    result = self.send(soapenv)
  File "/opt/stateadm/.local/lib/python2.7/site-packages/suds/client.py", line 613, in send
    reply = self.options.transport.send(request)
  File "/opt/stateadm/.local/lib/python2.7/site-packages/suds/transport/https.py", line 66, in send
    return HttpTransport.send(self, request)
  File "/opt/stateadm/.local/lib/python2.7/site-packages/suds/transport/http.py", line 82, in send
    fp = self.u2open(u2request)
  File "/opt/stateadm/.local/lib/python2.7/site-packages/suds/transport/http.py", line 132, in u2open
    return url.open(u2request, timeout=tm)
  File "/opt/python/lib/python2.7/urllib2.py", line 400, in open
    response = self._open(req, data)
  File "/opt/python/lib/python2.7/urllib2.py", line 418, in _open
    '_open', req)
  File "/opt/python/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/opt/python/lib/python2.7/urllib2.py", line 1215, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/opt/python/lib/python2.7/urllib2.py", line 1177, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 32] Broken pipe>

【问题讨论】:

【参考方案1】:

Errno 32 Broken Pipe 表示远程服务器关闭了套接字。我猜传输时间太长了,因为 API 文档显示如果文件本身太大,它们会返回错误。

相反,这可能是 Google 的间歇性问题,this old thread.

【讨论】:

以上是关于urllib2.URLError: <urlopen 错误 [Errno 32] Broken pipe - Google Leads的主要内容,如果未能解决你的问题,请参考以下文章

urllib2.URLError: <urlopen 错误 [Errno 32] Broken pipe - Google Leads

urllib2.URLError: <urlopen error [Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERV

python爬虫_urllib2:urlerror和httperror

python爬虫_urllib2:urlerror和httperror

python爬虫_urllib2:urlerror和httperror

执行buildman --fetch-arch arm提示"urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAIL