Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

chef - STDERR: The python_package resource requires pip >= 6.1.0, currently 10.0.0

I am trying to bootstrap an server. I used to use "recipe[poise-python]" to pip install packages. Now I get the below error. How do fix?

* 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
like image 783
Tampa Avatar asked Apr 17 '18 01:04

Tampa


2 Answers

This is a compatibility bug between the poise-python cookbook and pip 10. You can use either the pip_version property on the python_runtime resource or node attributes (override['poise-python']['options']['pip_version']) to set the version for managed runtime back to 9.0.3 which works. The error message is awkward because my regexp was poorly written, though it would have failed anyway due to pip's changes. An updated version of the cookbook will be available shortly.

like image 144
coderanger Avatar answered Sep 22 '22 23:09

coderanger


Had the same issue, installing the new version (1.7.0) of poise-python cookbook fixed it.

like image 20
surya Avatar answered Sep 23 '22 23:09

surya