Undefined method `>' for nil:NilClass when instaling opscode-manage

Hi all,

I’m getting erro bellow after installing Chef Server 12.3.1 on CentOS 6 and after the RPM is installed, I’ve run chef-server-ctl reconfigure and I run chef-server-ctl install opscode-manage I get the following error. Debugging into Chef ruby code seems that some yum commend does not return a status code, which is null but is compared to 0. This is on yum.rb but I don’t know how to fix it.

============================================================================

====
Error executing action install on resource ‘yum_package[opscode-manage]’
============================================================================

NoMethodError
-------------
undefined method `>' for nil:NilClass

Resource Declaration:
---------------------
# In /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/ad

d_ons_remote.rb

 16:   package pkg do
 17:     notifies :create, "ruby_block[addon_install_notification_#{pkg}]",

:immediate
18: case node[‘platform_family’]
19: when 'rhel’
20: options "–enablerepo=chef-stable"
21: end
22: end

Compiled Resource:
------------------
# Declared in /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/r

ecipes/add_ons_remote.rb:16:in `block in from_file’

yum_package("opscode-manage") do
  action [:install]
  retries 0
  retry_delay 2
  default_guard_interpreter :default
  options "--enablerepo=chef-stable"
  package_name "opscode-manage"
  flush_cache {:before=>false, :after=>false}
  declared_type :package
  cookbook_name "private-chef"
  recipe_name "add_ons_remote"
end

Running handlers:

  • #Class:0x00000002f1efa8::AddonInstallHandler
    Running handlers complete
    Chef Client failed. 4 resources updated in 07 minutes 37 seconds
    [2015-12-20T15:54:43+00:00] FATAL: Stacktrace dumped to /opt/opscode/embedded/co
    okbooks/cache/chef-stacktrace.out
    [2015-12-20T15:54:43+00:00] FATAL: NoMethodError: yum_package[opscode-manage] (p
    rivate-chef::add_ons_remote line 16) had an error: NoMethodError: undefined meth
    od `>’ for nil:NilClass

Hi, there,

On CentOS 6.7, we aren’t able to install ‘opscode-manage’ module. We get next error:

/opt/opscode/embedded/cookbooks/cahe/chef-stacktrace.out

NoMethodError: yum_package[opscode-manage] (private-chef::add_ons_remote line 16)

FATAL: NoMethodError: yum_package[opscode-manage]

Must we change the recipe ‘add_ons_remote.rb’ to install it?

Regards,
Lara Cancela Gª.

Same error for me. I was able to manually install the package but not able
to install it via chef-server-ctl.

The addon has been renamed to chef-manage, make sure you have the latest Chef Server installed too.

It seems I’ve repo’d this problem on CentOS 7.0 also. At this present time I haven’t gotten past it; if I do I’ll comment here.

    ================================================================================
    Error executing action `install` on resource 'yum_package[opscode-manage]'
    ================================================================================

    NoMethodError
    -------------
    undefined method `>' for nil:NilClass

    Resource Declaration:
    ---------------------
    # In /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/add_ons_remote.rb

     16:   package pkg do
     17:     notifies :create, "ruby_block[addon_install_notification_#{pkg}]", :immediate
     18:     case node['platform_family']
     19:     when 'rhel'
     20:       options "--enablerepo=chef-stable"
     21:     end
     22:   end

    Compiled Resource:
    ------------------
    # Declared in /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/add_ons_remote.rb:16:in `block in from_file'

    yum_package("opscode-manage") do
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      options "--enablerepo=chef-stable"
      package_name "opscode-manage"
      flush_cache {:before=>false, :after=>false}
      declared_type :package
      cookbook_name "private-chef"
      recipe_name "add_ons_remote"
    end


Running handlers:
  - #<Class:0x00000005c90c20>::AddonInstallHandler
Running handlers complete
Chef Client failed. 0 resources updated in 08 seconds
[2016-01-04T22:58:11+00:00] FATAL: Stacktrace dumped to /opt/opscode/embedded/cookbooks/cache/chef-stacktrace.out
[2016-01-04T22:58:13+00:00] FATAL: NoMethodError: yum_package[opscode-manage] (private-chef::add_ons_remote line 16) had an error: NoMethodError: undefined method `>' for nil:NilClass

I should say that attempting to do:

[root@localhost ~]# chef-server-ctl install chef-manage
chef-manage does not appear to be a valid addon name. Valid names include: chef-ha, chef-sync, opscode-manage, opscode-push-jobs-server, opscode-reporting.

Doesn’t fix this either.

I’ve confirmed that this works on Ubuntu 14.04. So it looks like it’s something in the logic for RHEL platform_family. I do want to say pulling down manage and the rpm -Uvh the pkg, and it works. More updates when I get them.

I’m getting this error as well. CentOS 7 server here running in a VM.

Recipe: private-chef::add_ons_remote

  • yum_package[opscode-manage] action install[1] 21650 killed sudo chef-server-ctl install opscode-manage

    ================================================================================
    Error executing action install on resource ‘yum_package[opscode-manage]’

    NoMethodError

    undefined method `>’ for nil:NilClass

    Resource Declaration:

    In /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/add_ons_remote.rb

    16: package pkg do
    17: notifies :create, “ruby_block[addon_install_notification_#{pkg}]”, :immediate
    18: case node[‘platform_family’]
    19: when 'rhel’
    20: options "–enablerepo=chef-stable"
    21: end
    22: end

    Compiled Resource:

    Declared in /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/add_ons_remote.rb:16:in `block in from_file’

    yum_package(“opscode-manage”) do
    action [:install]
    retries 0
    retry_delay 2
    default_guard_interpreter :default
    options "–enablerepo=chef-stable"
    package_name "opscode-manage"
    flush_cache {:before=>false, :after=>false}
    declared_type :package
    cookbook_name "private-chef"
    recipe_name "add_ons_remote"
    end

Running handlers:

  • #Class:0x00000005972250::AddonInstallHandler
    Running handlers complete
    Chef Client failed. 0 resources updated in 01 minutes 55 seconds
    [2016-01-13T10:49:32-06:00] FATAL: Stacktrace dumped to /opt/opscode/embedded/cookbooks/cache/chef-stacktrace.out
    [2016-01-13T10:49:32-06:00] FATAL: NoMethodError: yum_package[opscode-manage] (private-chef::add_ons_remote line 16) had an error: NoMethodError: undefined method `>’ for nil:NilClass

As workaround to install chef-manage using package from https://downloads.chef.io/chef-manage/redhat/, same way as chef-server

Then run chef-manage-ctl reconfigure to apply cookbook.

Hello jjasghar,

This seems like a similar error to the one I’ve just added a ticket for here

https://github.com/chef/chef/issues/4857

Think this is due to nothing meaningful being returned from running a shell_out command in the Chef::Provider::package::Yum class as we’ve seen this a few times now.