hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.27k stars 4.43k forks source link

vagrant provision not found chef cookbooks #4150

Closed aboltart closed 10 years ago

aboltart commented 10 years ago

Vagrant file configuration

  config.vm.provision :chef_solo do |chef|
    chef.log_level = :debug

    chef.cookbooks_path = "cookbooks"

    chef.add_recipe 'vim'
  end

cookbooks directory is on the same level as Vagrantfile

content of cookbooks directory:

tree -f cookbooks
cookbooks
└── cookbooks/vim
    ├── cookbooks/vim/Berksfile
    ├── cookbooks/vim/CHANGELOG.md
    ├── cookbooks/vim/CONTRIBUTING
    ├── cookbooks/vim/Gemfile
    ├── cookbooks/vim/LICENSE
    ├── cookbooks/vim/README.md
    ├── cookbooks/vim/Rakefile
    ├── cookbooks/vim/attributes
    │   ├── cookbooks/vim/attributes/default.rb
    │   └── cookbooks/vim/attributes/source.rb
    ├── cookbooks/vim/metadata.rb
    ├── cookbooks/vim/recipes
    │   ├── cookbooks/vim/recipes/default.rb
    │   ├── cookbooks/vim/recipes/package.rb
    │   └── cookbooks/vim/recipes/source.rb
    └── cookbooks/vim/spec
        ├── cookbooks/vim/spec/default_spec.rb
        ├── cookbooks/vim/spec/package_spec.rb
        └── cookbooks/vim/spec/spec_helper.rb

Vim cokbook was cloned from https://github.com/opscode-cookbooks/vim

I have latest Vagrant

vagrant version
Installed Version: 1.6.3
Latest Version: 1.6.3

You're running an up-to-date version of Vagrant!

Full stack trace of vagrant provision

vagrant provision
==> default: Running provisioner: chef_solo...
Generating chef JSON and uploading...
==> default: Running chef-solo...
==> default: [2014-07-07T09:05:45+00:00] INFO: Forking chef instance to converge...
==> default: [2014-07-07T09:05:45+00:00] DEBUG: Fork successful. Waiting for new chef pid: 17708
==> default: [2014-07-07T09:05:45+00:00] DEBUG: Forked instance now converging
==> default: [2014-07-07T09:05:45+00:00] WARN:
==> default: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
==> default: SSL validation of HTTPS requests is disabled. HTTPS connections are still
==> default: encrypted, but chef is not able to detect forged replies or man in the middle
==> default: attacks.
==> default:
==> default: To fix this issue add an entry like this to your configuration file:
==> default:
==> default: ```
==> default:   # Verify all HTTPS connections (recommended)
==> default:   ssl_verify_mode :verify_peer
==> default:
==> default:   # OR, Verify only connections to chef-server
==> default:   verify_api_cert true
==> default: ```
==> default:
==> default: To check your SSL configuration, or troubleshoot errors, you can use the
==> default: `knife ssl check` command like so:
==> default:
==> default: ```
==> default:   knife ssl check -c /tmp/vagrant-chef-3/solo.rb
==> default: ```
==> default:
==> default: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
==> default: [2014-07-07T09:05:45+00:00] INFO: *** Chef 11.12.8 ***
==> default: [2014-07-07T09:05:45+00:00] INFO: Chef-client pid: 17708
==> default: [2014-07-07T09:05:45+00:00] DEBUG: Chef-client request_id: 4ef6e8f8-6415-4390-b78b-474003188577
==> default: [2014-07-07T09:05:52+00:00] DEBUG: Building node object for vagrant-centos65.vagrantup.com
==> default: [2014-07-07T09:05:52+00:00] DEBUG: Extracting run list from JSON attributes provided on command line
==> default: [2014-07-07T09:05:52+00:00] INFO: Setting the run_list to ["recipe[vim]"] from CLI options
==> default: [2014-07-07T09:05:52+00:00] DEBUG: Applying attributes from json file
==> default: [2014-07-07T09:05:52+00:00] DEBUG: Platform is centos version 6.5
==> default: [2014-07-07T09:05:52+00:00] INFO: Run List is [recipe[vim]]
==> default: [2014-07-07T09:05:52+00:00] INFO: Run List expands to [vim]
==> default: [2014-07-07T09:05:52+00:00] INFO: Starting Chef Run for vagrant-centos65.vagrantup.com
==> default: [2014-07-07T09:05:52+00:00] INFO: Running start handlers
==> default: [2014-07-07T09:05:52+00:00] INFO: Start handlers complete.
==> default: [2014-07-07T09:05:52+00:00] DEBUG: Re-raising exception: Chef::Exceptions::CookbookNotFound - Cookbook vim not found. If you're loading vim from another cookbook, make sure you configure the dependency in your metadata
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/cookbook/cookbook_collection.rb:38:in `block in initialize'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.0.4/lib/ohai/mash.rb:77:in `yield'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.0.4/lib/ohai/mash.rb:77:in `default'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.0.4/lib/ohai/mash.rb:77:in `default'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:277:in `[]'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:277:in `each_cookbook_dep'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:255:in `add_cookbook_with_deps'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:88:in `block in cookbook_order'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:86:in `each'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:86:in `cookbook_order'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:98:in `compile_libraries'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:71:in `compile'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context.rb:88:in `load'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/policy_builder/expand_node_object.rb:73:in `setup_run_context'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:265:in `setup_run_context'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:429:in `do_run'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:213:in `block in run'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in `fork'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in `run'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:217:in `run_chef_client'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:221:in `block in run_application'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in `loop'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in `run_application'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:67:in `run'
==> default:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/bin/chef-solo:25:in `<top (required)>'
==> default:   /usr/bin/chef-solo:23:in `load'
==> default:   /usr/bin/chef-solo:23:in `<main>'
==> default: [2014-07-07T09:05:52+00:00] ERROR: Running exception handlers
==> default: [2014-07-07T09:05:52+00:00] ERROR: Exception handlers complete
==> default: [2014-07-07T09:05:52+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2014-07-07T09:05:52+00:00] DEBUG: Chef::Exceptions::CookbookNotFound: Cookbook vim not found. If you're loading vim from another cookbook, make sure you configure the dependency in your metadata
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/cookbook/cookbook_collection.rb:38:in `block in initialize'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.0.4/lib/ohai/mash.rb:77:in `yield'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.0.4/lib/ohai/mash.rb:77:in `default'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.0.4/lib/ohai/mash.rb:77:in `default'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:277:in `[]'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:277:in `each_cookbook_dep'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:255:in `add_cookbook_with_deps'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:88:in `block in cookbook_order'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:86:in `each'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:86:in `cookbook_order'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:98:in `compile_libraries'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:71:in `compile'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context.rb:88:in `load'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/policy_builder/expand_node_object.rb:73:in `setup_run_context'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:265:in `setup_run_context'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:429:in `do_run'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:213:in `block in run'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in `fork'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:217:in `run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:221:in `block in run_application'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in `loop'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in `run_application'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:67:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/bin/chef-solo:25:in `<top (required)>'
==> default: /usr/bin/chef-solo:23:in `load'
==> default: /usr/bin/chef-solo:23:in `<main>'
==> default: [2014-07-07T09:05:52+00:00] ERROR: Cookbook vim not found. If you're loading vim from another cookbook, make sure you configure the dependency in your metadata
==> default: [2014-07-07T09:05:52+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
aboltart commented 10 years ago

When I made vagrant reload then cookbooks directory was mounted and provisioning executed as expected

Output:

vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/foo/work/bar
    default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks => /Users/foo/work/bar/cookbooks
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.
sneal commented 10 years ago

Yeah, reloading is the right course of action here. I've seen this a couple of times but I've never seen a reliable repro. If you can reliably reproduce this please send a gist of a vagrant up --debug.

blagoygenadiev-taulia commented 9 years ago

:+1: for reloading vagrant - it helped me