cmlicata / cloudcli-cookbook

Cookbook which installs and configures cloud cli tools
Apache License 2.0
19 stars 14 forks source link

cloudcli cookbook does not work with Chef-Client 12.19.36 #10

Open isuftin opened 7 years ago

isuftin commented 7 years ago

Ran into an interesting issue today.

cloudcli cookbook 1.0.0 chef-client 12.19.36

All cloudcli cookbook default settings on a CentOS 6.8 AWS VM:

Recipe: cloudcli::_aws_linux
  * yum_package[groff] action install (up to date)
  * python_runtime[2] action install
    * poise_languages_system[python] action install

      ================================================================================
      Error executing action `install` on resource 'poise_languages_system[python]'
      ================================================================================

      NoMethodError
      -------------
      undefined method `arch' for Chef::Resource::Package

      Cookbook Trace:
      ---------------
      /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/system/resource.rb:173:in `block in run_package_action'
      /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/system/resource.rb:162:in `each'
      /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/system/resource.rb:162:in `run_package_action'
      /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/system/resource.rb:100:in `action_install'
      /var/chef/cache/cookbooks/poise/files/halite_gem/poise/helpers/notifying_block.rb:69:in `notifying_block'
      /var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/python_providers/base.rb:44:in `action_install'

      Resource Declaration:
      ---------------------
      # In /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/system/mixin.rb

       32:         poise_languages_system system_package_name do
       33:           # Otherwise use the default install action.
       34:           action(:upgrade) if options['package_upgrade']
       35:           parent new_resource
       36:           # Don't pass true because we want the default computed behavior for that.
       37:           dev_package options['dev_package'] unless options['dev_package'] == true
       38:           dev_package_overrides dev_package_overrides
       39:           package_version options['package_version'] if options['package_version']
       40:           version options['version']
       41:         end
       42:       end

      Compiled Resource:
      ------------------
      # Declared in /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/system/mixin.rb:32:in `install_system_packages'

      poise_languages_system("python") do
        action [:install]
        retries 0
        retry_delay 2
        default_guard_interpreter :default
        declared_type :poise_languages_system
        cookbook_name "cloudcli"
        parent # Declared in /var/chef/cache/cookbooks/cloudcli/recipes/_aws_linux.rb:21:in `from_file'

      python_runtime("2") do
        provider PoisePython::PythonProviders::System
        action [:install]
        retries 0
        retry_delay 2
        default_guard_interpreter :default
        declared_type :poise_languages_system
        cookbook_name "cloudcli"
        parent # Declared in /var/chef/cache/cookbooks/cloudcli/recipes/_aws_linux.rb:21:in `from_file'

      python_runtime("2") do
        provider PoisePython::PythonProviders::System
        action [:install]
        retries 0
        retry_delay 2
        default_guard_interpreter :default
        subresources [python_package[awscli]]
        declared_type :python_runtime
        cookbook_name "cloudcli"
        recipe_name "_aws_linux"
        pip_version true
        setuptools_version true
        version "2"
        virtualenv_version true
        wheel_version true
      end

        version "2"
        package_name "python"
        dev_package "python-devel"
      end

      Platform:
      ---------
      x86_64-linux

    ================================================================================
    Error executing action `install` on resource 'python_runtime[2]'
    ================================================================================

    NoMethodError
    -------------
    poise_languages_system[python] (/var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/system/mixin.rb line 32) had an error: NoMethodError: undefined method `arch' for Chef::Resource::Package

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/system/resource.rb:173:in `block in run_package_action'
    /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/system/resource.rb:162:in `each'
    /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/system/resource.rb:162:in `run_package_action'
    /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/system/resource.rb:100:in `action_install'
    /var/chef/cache/cookbooks/poise/files/halite_gem/poise/helpers/notifying_block.rb:69:in `notifying_block'
    /var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/python_providers/base.rb:44:in `action_install'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/cloudcli/recipes/_aws_linux.rb

     21: python_runtime node['cloudcli']['aws']['python']['version'] do
     22:   provider node['cloudcli']['aws']['python']['provider']
     23: end
     24:

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/cloudcli/recipes/_aws_linux.rb:21:in `from_file'

    python_runtime("2") do
      provider PoisePython::PythonProviders::System
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      subresources [python_package[awscli]]
      declared_type :python_runtime
      cookbook_name "cloudcli"
      recipe_name "_aws_linux"
      pip_version true
      setuptools_version true
      version "2"
      virtualenv_version true
      wheel_version true
    end

    Platform:
    ---------
    x86_64-linux

Not sure whether this should be an issue for this cookbook or the dependency poise_languages

isuftin commented 7 years ago

FYI this does work fine with chef-client 12.18.31

cmlicata commented 7 years ago

Seems reasonable. @isuftin, feel free to put in a PR with the fix and added tests.

isuftin commented 7 years ago

@cmlicata I'll see what I can do here as time allows. I'm hoping it can be fixed at this end and not have to be passed off to the poise_languages cookbook. Thanks, @cmlicata

naveenkumar1012 commented 7 years ago

This is still appearing in chef-client 12.21.3 Any idea how to fix this?

cmlicata commented 7 years ago

@naveenkumarjtg, I haven't worked on this in a bit, but could you please provide a stacktrace?

cmlicata commented 7 years ago

Is this a critical issue for you?

isuftin commented 7 years ago

This cookbook is part of our base role for our nodes. Due to this issue, we are unable to move towards a newer version of the Chef client.

isuftin commented 7 years ago

Update, this may be due to us using an older version of the cloucli-cookbook. Further testing will be done on our end.