sous-chefs / sc-mongodb

Development repository for the sc-mongodb cookbook
https://supermarket.chef.io/cookbooks/sc-mongodb
Apache License 2.0
75 stars 91 forks source link

No resource or method named 'build_essential' #176

Open rponcetn opened 7 years ago

rponcetn commented 7 years ago

Hi guys, I have a problem trying to use the recipe. My chef version is: 12.11.18 From what I read in the issues closed, they speak of problems in the version of chef 11, but in version 12? or why do I see this error?

Error:

No resource or method named 'build_essential' for 'Chef::Recipe install

Cookbook Trace:

▽
---------------

▽
source 'https://supermarket.chef.io'
  /var/chef/cache/cookbooks/sc-mongodb/recipes/install.rb:4:in 'from_file'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:347:in 'load_recipe'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:303:in 'block in include_recipe'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:302:in 'each'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:302:in 'include_recipe'
  /var/chef/cache/cookbooks/sc-mongodb/recipes/default.rb:22:in `from_file'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:347:in 'load_recipe'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:303:in 'block in include_recipe'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:302:in 'each'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:302:in 'include_recipe'

Relevant File Content:
----------------------
/var/chef/cache/cookbooks/sc-mongodb/recipes/install.rb:

  1:  # install the mongodb_org_repo if necessary
  2:  include_recipe 'sc-mongodb::mongodb_org_repo' if %w(10gen mongodb-org).include?(node['mongodb']['install_method'])
  3:
  4>> build_essential 'build-tools'
  5:
  6:  # prevent-install defaults, but don't overwrite
  7:  file node['mongodb']['sysconfig_file'] do
  8:    content 'ENABLE_MONGODB=no'
  9:    group node['mongodb']['root_group']
 10:    owner 'root'
 11:    mode 0644
 12:    action :create_if_missing
 13:  end

Platform:
---------
x86_64-linux

My recipe test:

node.default['mongodb']['config']['mongod']['replication']['replSetName'] = 'test'

include_recipe 'sc-mongodb::default'
devsibwarra commented 7 years ago

It's not listed in the README file, but sc-mongodb does depend on the build-essential cookbook. Toss that into your Chef environment and your run should look better

rponcetn commented 7 years ago

Hi @devsibwarra, thanks for your answer. Yes, I saw that link, but I can't run recipe. This are my test:

depends 'build-essential', '>= 5.0.0' depends 'sc-mongodb'

supports 'ubuntu'

ERROR

I have this error:

Failed to complete #converge action: [There is a dependency conflict, but the solver could not determine the precise cause in the time allotted.

Unable to find a solution for demands: 7-zip (1.0.2), apt (2.9.2), ark (3.1.0), aws (7.2.1), bluepill (2.4.3), build-essential (2.4.0)....


Error:
NoMethodError
-------------
No resource or method named `build_essential' for `Chef::Recipe "install"'

Cookbook Trace:
---------------
 /tmp/kitchen/cache/cookbooks/sc-mongodb/recipes/install.rb:4:in 'from_file'
 /tmp/kitchen/cache/cookbooks/sc-mongodb/recipes/default.rb:22:in 'from_file'
devsibwarra commented 7 years ago

@rponcetn The dependency conflict error is giving pretty good details on what Chef requires to run.

Some cookbook is requiring those listed cookbooks (7-zip, apt, ark, aws, etc) be installed with at least those versions.

The build-essential (2.4.0) part of the error message indicates one of your other cookbooks is requiring that specific version, or major/minor version, and it may need updated before Chef will run. I'd try searching for depends lines across all your cookbooks to locate conflicting dependencies or older lines that need updated.

github-actions[bot] commented 4 years ago

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.