rightscale-cookbooks / ephemeral_lvm

Configures available ephemeral devices on a cloud server

Home Page:http://community.opscode.com/cookbooks/ephemeral_lvm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

metadata lvm cookbook depends too restrictive

Stromweld opened this issue · comments

should loosen lvm cookbook dependency in the metadata to specify minimum version of lvm instead of approximate version. (>= 1.6.1 instead of ~> 1.6.1) LVM cookbook is up to 2.1.2 and has the latest version di-ruby-lvm-attrib specified in attributes but this cookbook is restricting to an older version that causes older di-ruby-lvm-attrib version to be specified. This is leading to errors during chef run like below:

<ArgumentError: lvm_volume_group[vg_data_ephem] (ephemeral_lvm::default line 60) had an error: ArgumentError: Unable to load lvm attributes [lvs.yaml] for version [2.02.143(2)]. The version/object may not be supported or you may need to upgrade the di-ruby-lvm-attrib gem. Error [No such file or directory @ rb_sysopen - /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/di-ruby-lvm-attrib-0.0.25/lib/lvm/attributes/2.02.143(2)/lvs.yaml]> had an error:

lvm_volume_group[vg_data_ephem](ephemeral_lvm::default line 60) had an error: ArgumentError: Unable to load lvm attributes [lvs.yaml] for version [2.02.143(2)]. The version/object may not be supported or you may need to upgrade the di-ruby-lvm-attrib gem. Error [No such file or directory @ rb_sysopen - /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/di-ruby-lvm-attrib-0.0.25/lib/lvm/attributes/2.02.143(2)/lvs.yaml]

Description: Error executing action create on resource 'lvm_volume_group[vg_data_ephem]'
ArgumentError
Unable to load lvm attributes [lvs.yaml] for version [2.02.143(2)]. The version/object may not be supported or you may need to upgrade the di-ruby-lvm-attrib gem. Error [No such file or directory @ rb_sysopen - /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/di-ruby-lvm-attrib-0.0.25/lib/lvm/attributes/2.02.143(2)/lvs.yaml]
Cookbook Trace:
/var/chef/cache/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:56:in new' /var/chef/cache/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:56:inaction_create'
Resource Declaration:

In /var/chef/cache/cookbooks/ephemeral_lvm/recipes/default.rb

60: lvm_volume_group node['ephemeral_lvm']['volume_group_name'] do
61: physical_volumes ephemeral_devices
62:
63: logical_volume node['ephemeral_lvm']['logical_volume_name'] do
64: size node['ephemeral_lvm']['logical_volume_size']
65: filesystem node['ephemeral_lvm']['filesystem']
66: mount_point node['ephemeral_lvm']['mount_point_properties'].merge(
67: location: node['ephemeral_lvm']['mount_point']
68: )
69: if ephemeral_devices.size > 1
70: stripes ephemeral_devices.size
71: stripe_size node['ephemeral_lvm']['stripe_size'].to_i
72: end
73: end
74: end
Compiled Resource:

Declared in /var/chef/cache/cookbooks/ephemeral_lvm/recipes/default.rb:60:in `from_file'

lvm_volume_group("vg_data_ephem") do
provider Chef::Provider::LvmVolumeGroup
action :create
retries 0
retry_delay 2
default_guard_interpreter :default
logical_volumes [<lvm_logical_volume[lv_cass_raid0] @name: "lv_cass_raid0" @noop: nil @before: nil @params: {} @Provider: Chef::Provider::LvmLogicalVolume @allowed_actions: [:nothing, :create, :resize] @action: [:nothing] @Updated: false @updated_by_last_action: false @supports: {} @ignore_failure: false @retries: 0 @retry_delay: 2 @source_line: "/var/chef/cache/cookbooks/lvm/libraries/resource_lvm_volume_group.rb:110:in `logical_volume'" @guard_interpreter: nil @default_guard_interpreter: :default @elapsed_time: 0.00049892 @sensitive: false @resource_name: :lvm_logical_volume @declared_type: :lvm_logical_volume @cookbook_name: "ephemeral_lvm" @recipe_name: "default" @SiZe: "100%VG" @filesystem: "xfs" @mount_point: {"options"=>["defaults", "noatime"], "pass"=>0, "location"=>"/var/lib/cassandra"} @stripes: 2 @stripe_size: 512>]
declared_type :lvm_volume_group
cookbook_name "ephemeral_lvm"
recipe_name "default"
physical_volumes ["/dev/xvdb", "/dev/xvdc"]
end

Stacktrace
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/di-ruby-lvm-attrib-0.0.25/lib/lvm/attributes.rb:23:in rescue in load' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/di-ruby-lvm-attrib-0.0.25/lib/lvm/attributes.rb:20:inload'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/di-ruby-lvm-0.2.1/lib/lvm/wrapper/lvs.rb:13:in initialize' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/di-ruby-lvm-0.2.1/lib/lvm/logical_volumes.rb:13:innew'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/di-ruby-lvm-0.2.1/lib/lvm/logical_volumes.rb:13:in initialize' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/di-ruby-lvm-0.2.1/lib/lvm.rb:36:innew'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/di-ruby-lvm-0.2.1/lib/lvm.rb:36:in initialize' /var/chef/cache/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:56:innew'
/var/chef/cache/cookbooks/lvm/libraries/provider_lvm_volume_group.rb:56:in action_create' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/provider.rb:145:inrun_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/resource.rb:603:in run_action' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/runner.rb:69:inrun_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/runner.rb:97:in block (2 levels) in converge' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/runner.rb:97:ineach'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/runner.rb:97:in block in converge' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/resource_collection/resource_list.rb:94:inblock in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/resource_collection/stepable_iterator.rb:114:in call_iterator_block' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/resource_collection/stepable_iterator.rb:85:instep'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/resource_collection/stepable_iterator.rb:103:in iterate' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/resource_collection/stepable_iterator.rb:55:ineach_with_index'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/resource_collection/resource_list.rb:92:in execute_each_resource' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/runner.rb:96:inconverge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/client.rb:669:in block in converge' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/client.rb:664:incatch'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/client.rb:664:in converge' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/client.rb:703:inconverge_and_save'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/client.rb:283:in run' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/application.rb:302:inblock in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/application.rb:290:in fork' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/application.rb:290:infork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/application.rb:255:in block in run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/local_mode.rb:44:inwith_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/application.rb:243:in run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/application/client.rb:464:insleep_then_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/application/client.rb:451:in block in interval_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/application/client.rb:450:inloop'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/application/client.rb:450:in interval_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/application/client.rb:434:inrun_application'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/lib/chef/application.rb:60:in run' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.60/bin/chef-client:26:in<top (required)>'
/usr/bin/chef-client:54:in load' /usr/bin/chef-client:54:in

'

just noticed this. I am going to cut you a new version with 2.1.2 specifically @Stromweld. It should not jump major versions. IMO

Normally I'd agree but with chef I've found that most of the time major version cookbook updates don't break other cookbooks. You have to look at how your using it. Most community cookbooks I've found specify only minimum version because generally cookbooks still do what they want them to do.

This cookbook in particular has been broken at least a handful of times in the past year that we started using mainly due to dependency version restriction. Each time update to latest fixes it and didn't break anything else in the cookbook. If it were to specify minimum lvm version I'm confident it'll be a long time before lvm is updated with breaking changes to this cookbook. At that point I think it makes more sense to restrict version till fix can be made.

I am cutting two versions today one with 2.1.2, and one with 1.6.1 with your changes. I am hoping it fixes it for you.

That worked great. Since I opened this issue they actually came out with 3.0.0 https://supermarket.chef.io/cookbooks/lvm. But with the minimum version berks was able to install 3.0.0 and my test clients that were failing are now fully converging again. Thanks.

I assume you guys are going to push it to supermarket soon then?

Yep, I will publish this version. I will also make a new one 3.0.0, specific since you said that works.

cool thanks for the help.

@rshade when are you going to publish the master branch to chef supermarket?

@cdwilhelm when are you guys going to publish the master branch to chef supermarket?

@Stromweld we updated the supermarket today.

thank you very much.

@cdwilhelm Seems like the issue still exists when running on RedHat AMIs, can someone confirm, Am getting the Unable to load lvm attributes [lvs.yaml] for version [2.02.166(2)]. The version/object may not be supported or you may need to upgrade the di-ruby-lvm-attrib gem. Error [No such file or directory @ rb_sysopen - /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/di-ruby-lvm-attrib-0.0.27/lib/lvm/attributes/2.02.166(2)/lvs.yaml] error.

Did you check the LVM cookbook? The underlying issue wasn't with this cookbook. The LVM cookbook determines the version of the ruby gem to install and this cookbook in the past only had the problem where it was limiting the LVM cookbooks max version so even though they released an update with updated gem version number berks wouldn't install it due this cookbooks restriction.

Now that should be alleviated and LVM cookbook may need an issue raised for them to update their version number or install latest(which I really wish they'd do).

I didn't check to see if they do have an update or not. I'm on my cell phone in the woods hunting.

ohh!!!. Sorry @Stromweld I did faced this issue in LVM cookbook, seems like I irrelevant comment here. thanks for the correction. I'll give a go on LVM cookbook repo issue tab.