我正在尝试引导服务器。我曾经使用"食谱[poise-python]" pip安装包。现在我得到以下错误。如何修复?
* python_package[setuptools] action upgrade
================================================================================
Error executing action `upgrade` on resource 'python_package[setuptools]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of ["/usr/bin/python", "-", "setuptools"] ----
STDOUT:
STDERR: The python_package resource requires pip >= 6.1.0, currently 10.0.0
---- End output of ["/usr/bin/python", "-", "setuptools"] ----
Ran ["/usr/bin/python", "-", "setuptools"] returned 1
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:207:in `tap'
/var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:207:in `language_command_shell_out!'
/var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:222:in `block in language_command_mixin'
/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_package.rb:317:in `pip_command'
/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_package.rb:341:in `pip_outdated'
/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_package.rb:209:in `check_package_versions'
/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_package.rb:189:in `load_current_resource'
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/supervisor/recipes/default.rb
32: python_package "setuptools" do
33: action :upgrade
34: end
35:
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/supervisor/recipes/default.rb:32:in `from_file'
python_package("setuptools") do
package_name "setuptools"
action [:upgrade]
default_guard_interpreter :default
declared_type :python_package
cookbook_name "supervisor"
recipe_name "default"
parent_python nil
timeout 900
end
System Info:
------------
chef_version=14.0.202
platform=ubuntu
platform_version=16.04
ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
program_name=/usr/bin/chef-solo
executable=/opt/chef/bin/chef-solo
Running handlers:
[2018-04-17T01:46:45+00:00] ERROR: Running exception handlers
Running handlers complete
[2018-04-17T01:46:45+00:00] ERROR: Exception handlers complete
Chef Client failed. 2 resources updated in 23 seconds
[2018-04-17T01:46:45+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2018-04-17T01:46:45+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-04-17T01:46:45+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: python_package[setuptools] (supervisor::default line 32) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of ["/usr/bin/python", "-", "setuptools"] ----
STDOUT:
STDERR: The python_package resource requires pip >= 6.1.0, currently 10.0.0
---- End output of ["/usr/bin/python", "-", "setuptools"] ----
Ran ["/usr/bin/python", "-", "setuptools"] returned 1
答案 0 :(得分:7)
这是poise-python cookbook和pip 10之间的兼容性错误。您可以使用pip_version
资源上的python_runtime
属性或节点属性(override['poise-python']['options']['pip_version']
)来设置托管运行时的版本返回到9.0.3,它可以工作。错误消息很尴尬,因为我的正则表达式编写得很糟糕,尽管由于pip的改变它仍会失败。不久将提供该烹饪书的更新版本。
答案 1 :(得分:6)
出现同样的问题,安装poise-python cookbook的新版本(1.7.0)修复了它。