sous-chefs / firewall

Development repository for the firewall cookbook
https://supermarket.chef.io/cookbooks/firewall
Apache License 2.0
99 stars 150 forks source link

chef-sugar dependency removal #216

Closed igolman closed 5 years ago

igolman commented 5 years ago

Cookbook version

2.7.0

Chef-client version

13.12.3

Platform Details

Ubuntu 18.04

Scenario:

run recipe.

Steps to Reproduce:

just add this cookbook to the run_list...

Expected Result:

chef-client runs

Actual Result:

X.X.X.X Recipe: chef-sugar::default
X.X.X.X   * chef_gem[chef-sugar] action install[2019-09-19T19:09:05+02:00] WARN: failed to find gem chef-sugar (= 3.3.0) from [https://www.rubygems.org]
X.X.X.X
X.X.X.X
X.X.X.X     ================================================================================
X.X.X.X     Error executing action `install` on resource 'chef_gem[chef-sugar]'
X.X.X.X     ================================================================================
X.X.X.X
X.X.X.X     Mixlib::ShellOut::ShellCommandFailed
X.X.X.X     ------------------------------------
X.X.X.X     Expected process to exit with [0], but received '2'
X.X.X.X     ---- Begin output of /opt/chef/embedded/bin/gem install chef-sugar -q --no-rdoc --no-ri -v "3.3.0" --source=https://www.rubygems.org ----
X.X.X.X     STDOUT:
X.X.X.X     STDERR: ERROR:  Could not find a valid gem 'chef-sugar' (= 3.3.0) in any repository
X.X.X.X     ERROR:  Possible alternatives: chef-solr, chef-sudo, chef-sugar-dip, cuba-sugar, hasugar
X.X.X.X     ---- End output of /opt/chef/embedded/bin/gem install chef-sugar -q --no-rdoc --no-ri -v "3.3.0" --source=https://www.rubygems.org ----
X.X.X.X     Ran /opt/chef/embedded/bin/gem install chef-sugar -q --no-rdoc --no-ri -v "3.3.0" --source=https://www.rubygems.org returned 2
X.X.X.X
X.X.X.X     Cookbook Trace:
X.X.X.X     ---------------
X.X.X.X     /var/chef/cache/cookbooks/chef-sugar/recipes/default.rb:23:in `from_file'
X.X.X.X     /var/chef/cache/cookbooks/firewall/recipes/default.rb:22:in `from_file'
X.X.X.X
X.X.X.X     Resource Declaration:
X.X.X.X     ---------------------
X.X.X.X     # In /var/chef/cache/cookbooks/chef-sugar/recipes/default.rb
X.X.X.X
X.X.X.X      23:   chef_gem 'chef-sugar' do
X.X.X.X      24:     version gem_version
X.X.X.X      25:     compile_time true
X.X.X.X      26:   end
X.X.X.X      27: else
X.X.X.X
X.X.X.X     Compiled Resource:
X.X.X.X     ------------------
X.X.X.X     # Declared in /var/chef/cache/cookbooks/chef-sugar/recipes/default.rb:23:in `from_file'
X.X.X.X
X.X.X.X     chef_gem("chef-sugar") do
X.X.X.X       package_name "chef-sugar"
X.X.X.X       action [:install]
X.X.X.X       default_guard_interpreter :default
X.X.X.X       declared_type :chef_gem
X.X.X.X       cookbook_name "chef-sugar"
X.X.X.X       recipe_name "default"
X.X.X.X       version "3.3.0"
X.X.X.X       compile_time true
X.X.X.X     end
X.X.X.X
X.X.X.X     System Info:
X.X.X.X     ------------
X.X.X.X     chef_version=13.12.3
X.X.X.X     platform=ubuntu
X.X.X.X     platform_version=18.04
X.X.X.X     ruby=ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]
X.X.X.X     program_name=chef-client worker: ppid=1419;start=19:08:50;
X.X.X.X     executable=/opt/chef/bin/chef-client
X.X.X.X
X.X.X.X
X.X.X.X   ================================================================================
X.X.X.X   Recipe Compile Error in /var/chef/cache/cookbooks/firewall/recipes/default.rb
X.X.X.X   ================================================================================
X.X.X.X
X.X.X.X   Mixlib::ShellOut::ShellCommandFailed
X.X.X.X   ------------------------------------
X.X.X.X   chef_gem[chef-sugar] (chef-sugar::default line 23) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
X.X.X.X   ---- Begin output of /opt/chef/embedded/bin/gem install chef-sugar -q --no-rdoc --no-ri -v "3.3.0" --source=https://www.rubygems.org ----
X.X.X.X   STDOUT:
X.X.X.X   STDERR: ERROR:  Could not find a valid gem 'chef-sugar' (= 3.3.0) in any repository
X.X.X.X   ERROR:  Possible alternatives: chef-solr, chef-sudo, chef-sugar-dip, cuba-sugar, hasugar
X.X.X.X   ---- End output of /opt/chef/embedded/bin/gem install chef-sugar -q --no-rdoc --no-ri -v "3.3.0" --source=https://www.rubygems.org ----
X.X.X.X   Ran /opt/chef/embedded/bin/gem install chef-sugar -q --no-rdoc --no-ri -v "3.3.0" --source=https://www.rubygems.org returned 2
X.X.X.X
X.X.X.X   Cookbook Trace:
X.X.X.X   ---------------
X.X.X.X     /var/chef/cache/cookbooks/chef-sugar/recipes/default.rb:23:in `from_file'
X.X.X.X     /var/chef/cache/cookbooks/firewall/recipes/default.rb:22:in `from_file'
X.X.X.X
X.X.X.X   Relevant File Content:
X.X.X.X   ----------------------
X.X.X.X   /var/chef/cache/cookbooks/chef-sugar/recipes/default.rb:
X.X.X.X
X.X.X.X    16:  # See the License for the specific language governing permissions and
X.X.X.X    17:  # limitations under the License.
X.X.X.X    18:  #
X.X.X.X    19:
X.X.X.X    20:  gem_version = run_context.cookbook_collection[cookbook_name].metadata.version
X.X.X.X    21:
X.X.X.X    22:  if Chef::Resource::ChefGem.instance_methods(false).include?(:compile_time)
X.X.X.X    23>>   chef_gem 'chef-sugar' do
X.X.X.X    24:      version gem_version
X.X.X.X    25:      compile_time true
X.X.X.X    26:    end
X.X.X.X    27:  else
X.X.X.X    28:    chef_gem 'chef-sugar' do
X.X.X.X    29:      version gem_version
X.X.X.X    30:      action :nothing
X.X.X.X    31:    end.run_action(:install)
X.X.X.X    32:  end
X.X.X.X
X.X.X.X   System Info:
X.X.X.X   ------------
X.X.X.X   chef_version=13.12.3
X.X.X.X   platform=ubuntu
X.X.X.X   platform_version=18.04
X.X.X.X   ruby=ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]
X.X.X.X   program_name=chef-client worker: ppid=1419;start=19:08:50;
X.X.X.X   executable=/opt/chef/bin/chef-client
X.X.X.X
X.X.X.X
X.X.X.X   Running handlers:
X.X.X.X [2019-09-19T19:09:19+02:00] ERROR: Running exception handlers
X.X.X.X   Running handlers complete
X.X.X.X [2019-09-19T19:09:19+02:00] ERROR: Exception handlers complete
X.X.X.X   Chef Client failed. 0 resources updated in 28 seconds
X.X.X.X [2019-09-19T19:09:19+02:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
X.X.X.X [2019-09-19T19:09:19+02:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
X.X.X.X [2019-09-19T19:09:19+02:00] ERROR: chef_gem[chef-sugar] (chef-sugar::default line 23) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
X.X.X.X ---- Begin output of /opt/chef/embedded/bin/gem install chef-sugar -q --no-rdoc --no-ri -v "3.3.0" --source=https://www.rubygems.org ----
X.X.X.X STDOUT:
X.X.X.X STDERR: ERROR:  Could not find a valid gem 'chef-sugar' (= 3.3.0) in any repository
X.X.X.X ERROR:  Possible alternatives: chef-solr, chef-sudo, chef-sugar-dip, cuba-sugar, hasugar
X.X.X.X ---- End output of /opt/chef/embedded/bin/gem install chef-sugar -q --no-rdoc --no-ri -v "3.3.0" --source=https://www.rubygems.org ----
X.X.X.X Ran /opt/chef/embedded/bin/gem install chef-sugar -q --no-rdoc --no-ri -v "3.3.0" --source=https://www.rubygems.org returned 2
X.X.X.X [2019-09-19T19:09:19+02:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
connorwstein commented 5 years ago

I have the same issue

sean-nixon commented 5 years ago

Same. If at all possible it would be wonderful if this could be expedited. The link above doesn't work but you can view the source of the issue at https://github.com/sethvargo/chef-sugar. The chef-sugar gem was taken down by its maintainer.

JanStevens commented 5 years ago

Probably the solution is to point to the new repo forked by chef: https://github.com/chef/chef-sugar

But the package name then becomes chef-sugar-ng

k-brooks commented 5 years ago

I think they (chef-sugar cookbook) just need to release a new version, which, based on recent changes, already points to the new gem...soon please?

JanStevens commented 5 years ago

Workaround if you have a Berksfile is

# Hack around chef sugar removal
cookbook 'chef-sugar', github: 'chef/chef-sugar'
k-brooks commented 5 years ago

looks like they just released!

martinb3 commented 5 years ago

Yep, looks like Chef Inc. decided to fix this one. Closing for now.