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

Current version of nexus-cli gem breaks 'group' resource (and potentially others) on Chef 12 #144

Open
GolubevV opened this issue Apr 12, 2017 · 0 comments

Comments

@GolubevV
Copy link

The original defect for nexus-cli gem is submitted in corresponding github project here.

To make a long story short, the current implementation of nexus-cli gem, which is using extlib gem, breaks further usage of group Chef resource and potentially any other resources, which invoke methods with keyword arguments and splat operations.

So for correct usage of nexus cookbook LWRPs on Chef12, new version of nexus-cli gem is required, where the 'extlib' gem will not be used.

Current work-around is to use the Nexus-related recipes at the end of the run list for the nodes.

Here is an example via chef-shell:
chef-shell -z -o "recipe[nexus::cli]"

resolving cookbooks for run list: ["nexus::cli"]
..Synchronizing Cookbooks:
  - nexus (3.3.1)
.  - java (1.47.0)
  - apt (2.9.2)
  - windows (2.0.2)
  - homebrew (1.10.0)
  - bluepill (2.4.0)
  - nginx (2.7.6)
  - rsyslog (2.1.0)
  - 7-zip (1.0.2)
  - build-essential (2.4.0)
  - ohai (2.1.0)
  - runit (1.7.6)
  - packagecloud (0.2.5)
.  - yum-epel (0.7.1)
  - yum (4.1.0)
  - artifact (1.12.2)
.....
chef (12.19.36)>
chef (12.19.36)> recipe_mode
chef:recipe (12.19.36)> nexus_proxy_repository 'rubygems-org' do
chef:recipe >   url 'https://rubygems.org'
chef:recipe ?>   repo_provider 'rubygems-proxy'
chef:recipe ?> end
 => <nexus_proxy_repository[rubygems-org] @name: "rubygems-org" @noop: nil @before: nil @params: {} @provider: nil @allowed_actions: [:nothing, :create, :delete, :update] @action: [:create] @updated: false @updated_by_last_action: false @supports: {} @ignore_failure: false @retries: 0 @retry_delay: 2 @source_line: "(irb#1):1:in `irb_binding'" @guard_interpreter: nil @default_guard_interpreter: :default @elapsed_time: 0 @sensitive: false @declared_type: :nexus_proxy_repository @cookbook_name: nil @recipe_name: nil @url: "https://rubygems.org" @repo_provider: "rubygems-proxy">
chef:recipe (12.19.36)> group 'test' do
chef:recipe > action :manage
chef:recipe ?> members ['nginx']
chef:recipe ?> end
 => <group[test] @name: "test" @noop: nil @before: nil @params: {} @provider: nil @allowed_actions: [:nothing, :create, :remove, :modify, :manage] @action: [:manage] @updated: false @updated_by_last_action: false @supports: {} @ignore_failure: false @retries: 0 @retry_delay: 2 @source_line: "(irb#1):5:in `irb_binding'" @guard_interpreter: nil @default_guard_interpreter: :default @elapsed_time: 0 @sensitive: false @group_name: "test" @gid: nil @members: ["nginx"] @excluded_members: [] @append: false @non_unique: false @declared_type: :group @cookbook_name: nil @recipe_name: nil>
chef:recipe (12.19.36)> run_chef
[2017-04-12T11:05:06+02:00] INFO: Processing chef_gem[nexus_cli] action install (nexus::cli line 20)
[2017-04-12T11:05:06+02:00] DEBUG: Providers for generic chef_gem resource enabled on node include: [Chef::Provider::Package::Rubygems]
[2017-04-12T11:05:06+02:00] DEBUG: Provider for action install on resource chef_gem[nexus_cli] is Chef::Provider::Package::Rubygems
[2017-04-12T11:05:06+02:00] DEBUG: chef_gem[nexus_cli] using gem '/opt/chef/embedded/bin/gem'
....
[2017-04-12T11:05:13+02:00] INFO: Processing group[test] action manage ((irb#1) line 5)
[2017-04-12T11:05:13+02:00] DEBUG: Providers for generic group resource enabled on node include: [Chef::Provider::Group::Gpasswd]
[2017-04-12T11:05:13+02:00] DEBUG: Provider for action manage on resource group[test] is Chef::Provider::Group::Gpasswd
...
groupmod: group '{"test"=>nil}' does not exist

================================================================================
Error executing action `manage` on resource 'group[test]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '6'
---- Begin output of ["groupmod", "{\"test\"=>nil}"] ----
STDOUT:
STDERR: groupmod: group '{"test"=>nil}' does not exist
---- End output of ["groupmod", "{\"test\"=>nil}"] ----
Ran ["groupmod", "{\"test\"=>nil}"] returned 6
....
Compiled Resource:
------------------
# Declared in (irb#1):5:in `irb_binding'
group("test") do
  action [:manage]
  retries 0
  retry_delay 2
  default_guard_interpreter :default
  group_name "test"
  gid 3000
  members ["nginx"]
  declared_type :group
end
...
Mixlib::ShellOut::ShellCommandFailed: group[test] ((irb#1) line 5) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '6'
---- Begin output of ["groupmod", "{\"test\"=>nil}"] ----
STDOUT:
STDERR: groupmod: group '{"test"=>nil}' does not exist
---- End output of ["groupmod", "{\"test\"=>nil}"] ----
Ran ["groupmod", "{\"test\"=>nil}"] returned 6
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7/lib/mixlib/shellout.rb:289:in `invalid!'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7/lib/mixlib/shellout.rb:276:in `error!'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/mixin/shell_out.rb:118:in `shell_out!'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/mixin/shell_out.rb:73:in `shell_out_compact!'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/group/groupadd.rb:53:in `manage_group'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/group.rb:158:in `block in action_manage'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/mixin/why_run.rb:52:in `add_action'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider.rb:176:in `converge_by'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider/group.rb:157:in `action_manage'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/provider.rb:145:in `run_action'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource.rb:622:in `run_action'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:69:in `run_action'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `block (2 levels) in converge'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `each'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:97:in `block in converge'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/runner.rb:96:in `converge'
        from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/shell/ext.rb:236:in `run_chef'
        from (irb#1):9
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

1 participant