Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError: undefined method `action' for Chef::Provider::LvmLogicalVolume:Class #194

Open
anupamkakade opened this issue Aug 26, 2020 · 4 comments

Comments

@anupamkakade
Copy link

Seeing this issue today

NoMethodError: undefined method `action' for Chef::Provider::LvmLogicalVolume:Class
/var/chef/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:45:in `<class:LvmLogicalVolume>'
/var/chef/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:29:in `<class:Provider>'
/var/chef/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:26:in `<class:Chef>'
/var/chef/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:25:in `<top (required)>'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/run_context/cookbook_compiler.rb:191:in `load'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/run_context/cookbook_compiler.rb:191:in `block in load_libraries_from_cookbook'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/run_context/cookbook_compiler.rb:188:in `each'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/run_context/cookbook_compiler.rb:188:in `load_libraries_from_cookbook'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/run_context/cookbook_compiler.rb:99:in `block in compile_libraries'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/run_context/cookbook_compiler.rb:98:in `each'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/run_context/cookbook_compiler.rb:98:in `compile_libraries'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/run_context/cookbook_compiler.rb:71:in `compile'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/run_context.rb:158:in `load'

Chef -client version is Chef: 12.5.1

@bxm
Copy link

bxm commented Aug 26, 2020

We are getting past this by either pinning lvm to 5.0.2, or using Chef 14+ where we can.

@craigjamesstewart
Copy link

================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb
================================================================================

NoMethodError
-------------
undefined method `action' for Chef::Provider::LvmLogicalVolume:Class

Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:45:in `<class:LvmLogicalVolume>'
  /var/chef/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:29:in `<class:Provider>'
  /var/chef/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:26:in `<class:Chef>'
  /var/chef/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:25:in `<top (required)>'

Relevant File Content:
----------------------
/var/chef/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:

 38:        def load_current_resource
 39:          @current_resource ||= Chef::Resource::LvmLogicalVolume.new(@new_resource.name)
 40:          @current_resource
 41:        end
 42:
 43:        # The create action
 44:        #
 45>>       action :create do
 46:          require_lvm_gems
 47:          install_filesystem_deps
 48:
 49:          lvm = LVM::LVM.new(lvm_options)
 50:          name = new_resource.name
 51:          group = new_resource.group
 52:          fs_type = new_resource.filesystem
 53:          fs_params = new_resource.filesystem_params
 54:          device_name = "/dev/mapper/#{to_dm_name(group)}-#{to_dm_name(name)}"

System Info:
------------
chef_version=12.21.14
platform=redhat
platform_version=6.10
ruby=ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux]
program_name=chef-client worker: ppid=7318;start=09:22:06;
executable=/opt/chef/bin/chef-client

This also effects Chef-client 12.21.14 on Redhat 6

@cattywampus
Copy link

I'm seeing a similar issue introduced in 5.0.3

NoMethodError: undefined method `physical_volumes' for Chef::Resource::BaseLogicalVolume
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.12.14/lib/chef/resource.rb:1298:in `method_missing'
/tmp/kitchen/cache/cookbooks/my_cookbook/recipes/filesystems.rb:12:in `block in from_file'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.12.14/lib/chef/resource_builder.rb:66:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.12.14/lib/chef/resource_builder.rb:66:in `build'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.12.14/lib/chef/dsl/declare_resource.rb:293:in `build_resource'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.12.14/lib/chef/dsl/declare_resource.rb:250:in `declare_resource'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.12.14/lib/chef/dsl/resources.rb:38:in `lvm_volume_group'

This message is different from the OP but given the circumstances and similarities between the messages I'm suspicious they are related. Pinning this to 5.0.2 fixes the issue.

System Info:
------------
chef_version=13.12.14
platform=redhat
platform_version=7.8
ruby=ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]
program_name=chef-client worker: ppid=11474;start=03:15:15;
executable=/opt/chef/bin/chef-client

I understand that my version of Chef (13.12.14) is definitely past end of life. I haven't tried using Chef v14+ yet.

@rayaputhomas
Copy link

For lvm2-2.02.187 or greater ,requires 5.0.4 and Chef-client v14+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants