连接到pypi.python.org超时了。

3

我正在管理一个安装了Python-2.7.8的RHEL服务器6.x,用于运行一个应用程序。当下面的Chef资源被Chef客户端执行时。

execute "/usr/local/bin/python2.7 #{node[:base_dir]}/get-pip.py"

我在chef-client日志中看到了以下错误。
[2015-02-24T17:42:27+00:00] ERROR: execute[/usr/local/bin/python2.7 /opt/mount/get-pip.py] (python_app::default line 105) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/local/bin/python2.7 /opt/mount1/get-pip.py ----
STDOUT: Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152ee268d0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152ee269d0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152ee26ad0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152ee26bd0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152ee26cd0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152ee26f50>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152efc4150>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152efc4250>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152efc4350>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f152efc4450>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/
Could not find any downloads that satisfy the requirement pip in /usr/local/lib/python2.7/site-packages
Collecting pip
  No distributions at all found for pip in /usr/local/lib/python2.7/site-packages
STDERR: 
---- End output of /usr/local/bin/python2.7 /opt/mount1/get-pip.py ----

我在查找有关此问题的Python信息。我注意到还有另一个版本的Python,我认为这是随RHEL安装的。

Python 2.6.6

以下是使用Chef安装Python 2.7.8的步骤:

ark 'python' do
  url 'https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz'
  path "/opt/mount/"
  owner 'python'
  action :put
end

execute "cd #{node[:base_dir]}/python && ./configure && make && make altinstall" do
  not_if { File.exists?('/usr/local/bin/python2.7') }
end

我观察到的一件事是'/opt/mount/python'的所有者是'root'而不是'python'用户。有任何想法为什么会出现这个错误信息?

2
我并不会因为我的问题被标记而感到冒犯,但我想知道在一个问题中需要记录哪些研究工作。Python并不是我处理过的东西。我已经尽力使问题详细和清晰。标记一个问题并给出提示是展示我们知道为什么要标记的更好的方式。 - OK999
您的节点显然似乎没有使用代理。但我没有看到执行 get-pip 的代码行… 它是 make altinstall 的一部分吗? - Tensibai
@Tensibai:在Chef中执行只是执行资源。执行“/usr/local/bin/python2.7 #{node[:basedir]}/get-pip.py” 你建议在这个命令中添加代理信息吗?像这样:"/usr/local/bin/python2.7 #{node[:basedir]}/get-pip.py --proxy="[user:passwd@]proxy.server:port"" - OK999
我会在execute资源的环境属性中添加代理信息。如果您可以编辑以显示完整的配方,明天我可能会给出更好的答案(很抱歉现在无法从手机回答)。 - Tensibai
@Tensibai:在“execute”chef资源中添加代理已经解决了问题。现在通过守护程序启动的chef-client运行成功了。非常感谢。 - OK999
1个回答

6

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接