SumoLogic/sumologic-collector-chef-cookbook

Convergence Error when installing chef-vault Gem

Closed this issue · 4 comments

I am hitting a convergence error when installing chef-vault gem early on the running of the sumologic cookbook. It appears to be a HTTP 404 error, but I don't understand what is attempting to be installed. Any hints?

The cookbook code in question appears to be this:

chef_gem 'chef-vault' do
  compile_time true if respond_to?(:compile_time)
end

Environment

Platform: Windows 2012 Server
Chef Version: 12.6.0 & 12.16.42

Convergence Error

Synchronizing Cookbooks:
  - build-essential (6.0.5)
  - chef-client (7.0.0)
  - cron (1.7.6)
  - dmg (2.4.0)
  - git (4.5.0)
  - logrotate (1.9.2)
  - windows (2.0.2)
  - yum (4.0.0)
  - yum-epel (1.0.1)
  - compat_resource (12.14.3)
  - seven_zip (2.0.2)
  - mingw (1.2.4)
  - sumologic-collector (1.2.17)
Compiling Cookbooks...
[2016-11-22T06:32:45-08:00] INFO: Installing Sumo Logic Collector...
Recipe: sumologic-collector::sumoconf
  * chef_gem[chef-vault] action install[2016-11-22T06:32:45-08:00] INFO: Process
ing chef_gem[chef-vault] action install (sumologic-collector::sumoconf line 32)
 (up to date)
[2016-11-22T06:32:49-08:00] INFO: HTTP Request Returned 404 Object Not Found: er
ror

  ==============================================================================
==
  Recipe Compile Error in C:/chef/cache/cookbooks/sumologic-collector/recipes/de
fault.rb
  ==============================================================================
==

  Net::HTTPServerException
  ------------------------
  404 "Object Not Found"


  Running handlers:
[2016-11-22T06:32:49-08:00] ERROR: Running exception handlers
  Running handlers complete
[2016-11-22T06:32:49-08:00] ERROR: Exception handlers complete
  Chef Client failed. 0 resources updated in 31 seconds
[2016-11-22T06:32:49-08:00] INFO: Sending resource update report (run-id: 0d80c7
15-59db-4115-a082-071074e0df6a)
[2016-11-22T06:32:49-08:00] FATAL: Stacktrace dumped to C:/chef/cache/chef-stack
trace.out
[2016-11-22T06:32:49-08:00] FATAL: Please provide the contents of the stacktrace
.out file if you file a bug report
[2016-11-22T06:32:49-08:00] FATAL: Net::HTTPServerException: 404 "Object Not Fou
nd"

Hi Brian, did you locate anything relevant in: C:/chef/cache/chef-stack
trace.out?

@keithcodes, there is an exception in C:/chef/cache/chef-stacktrace.out, but it doesn't tell me too much more:

Generated at 2016-12-07 12:42:17 -0800
Net::HTTPServerException: 404 "Object Not Found"
C:/opscode/chef/embedded/lib/ruby/2.0.0/net/http/response.rb:119:in `error!'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/http.rb:146:in `request'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/rest.rb:120:in `get'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/data_bag_item.rb:152:in `load'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-vault-2.9.0/lib/chef-vault/item.rb:315:in `data_bag_item_type'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-vault-2.9.0/lib/chef-vault/item.rb:293:in `vault?'
C:/chef/cache/cookbooks/sumologic-collector/recipes/sumoconf.rb:45:in `from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/cookbook_version.rb:228:in `load_recipe'
C:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:336:in `load_recipe'
C:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:292:in `block in include_recipe'
C:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:291:in `each'
C:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:291:in `include_recipe'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/dsl/include_recipe.rb:26:in `include_recipe'
C:/chef/cache/cookbooks/sumologic-collector/recipes/default.rb:54:in `from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/cookbook_version.rb:228:in `load_recipe'
C:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:336:in `load_recipe'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/run_context/cookbook_compiler.rb:140:in `block in compile_recipes'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/run_context/cookbook_compiler.rb:138:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/run_context/cookbook_compiler.rb:138:in `compile_recipes'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/run_context/cookbook_compiler.rb:75:in `compile'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/run_context.rb:167:in `load'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/policy_builder/expand_node_object.rb:93:in `setup_run_context'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/client.rb:490:in `setup_run_context'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/client.rb:268:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/application.rb:243:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/application.rb:220:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/application.rb:203:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/application/client.rb:413:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/application/client.rb:403:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/application/client.rb:403:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/application/client.rb:393:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/lib/chef/application.rb:58:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.6.0-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:64:in `load'
C:/opscode/chef/bin/chef-client:64:in `<main>'

This may sound silly, but which recipe should be applied to windows hosts? Is the default recipe (sumologic-collector::default) OK? Or we we need to use sumologic-collector::windows?

I am almost embarrassed to say that the issue was that I forgot to upload the encrypted databag with the sumologic api credentials to our Chef server. This was causing chef vault to fail (unexpectedly and without much debug info, unfortunately).

Ultimately, it was the following chef-vault GH issue that made me realize my mistake and pointed me in the right direction:

chef-boneyard/chef-vault#51