chef-infra - Chef -STDERR : The python_package resource requires pip >= 6. 1.0,目前为10.0.0

标签 chef-infra chef-recipe chef-solo

我正在尝试引导服务器。我曾经使用“recipe [poise-python]”来安装软件包。现在我得到以下错误。怎么解决?

* 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

最佳答案

这是poise-python Cookbook和pip 10之间的兼容性错误。您可以使用pip_version资源上的python_runtime属性或节点属性(override['poise-python']['options']['pip_version'])将托管运行时的版本设置为9.0.3起作用。该错误消息很尴尬,因为我的regexp编写得很差,尽管由于pip的更改无论如何它都会失败。菜谱的更新版本将很快面市。

关于chef-infra - Chef -STDERR : The python_package resource requires pip >= 6. 1.0,目前为10.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49868680/

相关文章:

php - 更新 chef php cookbook 的 php 版本

chef-infra - 菜谱中的cookbook_name - TypeError : no implicit conversion of Symbol into String

ruby - 如何在 Chef 中使用特殊字符?

Chef 的 Ruby 版本

chef-infra - Chef 节点属性。哪些可用?

chef-infra - Chef : is it possible to define a Chef resource which uses a template, 并从另一本 Recipe 中调用它?

chef-infra - 玩 Vagrant 和 python Recipe ,我不知道如何使用 python_virtualenv

ruby - 如果 Windows 服务正在运行,我可以使用守卫来 Chef 吗?

linux - 在 Chef 中运行 docker run

ruby - 强制 Chef 使用不同的属性多次运行菜谱