2014年11月26日水曜日

【Vagrant、Chef-Solo】The cookbook path 'hogehoge/.cookbooks' doesn't exist. Ignoring...


この本の通り書いててvagrantからchef-soloを呼び出したんだけどエラーした。
CakePHPで学ぶ継続的インテグレーションCakePHPで学ぶ継続的インテグレーション
渡辺 一宏,吉羽 龍太郎,岸田 健一郎,穴澤 康裕,丸山 弘詩

エラー

naichimba:vagrant_book hu$ vagrant provision develop
==> develop: The cookbook path '/Users/hu/Documents/vagrant_book/.cookbooks' doesn't exist. Ignoring...

エラー全文

naichimba:vagrant_book hu$ vagrant provision develop
==> develop: The cookbook path '/Users/hu/Documents/vagrant_book/.cookbooks' doesn't exist. Ignoring...
==> develop: Chef 11.16.4 Omnibus package is already installed.
==> develop: Configuring cache buckets...
==> develop: Running provisioner: chef_solo...
Generating chef JSON and uploading...
==> develop: Running chef-solo...
==> develop: stdin: is not a tty
==> develop: [2014-11-25T16:30:57+00:00] INFO: Forking chef instance to converge...
==> develop: [2014-11-25T16:30:57+00:00] DEBUG: Fork successful. Waiting for new chef pid: 2306
==> develop: [2014-11-25T16:30:57+00:00] DEBUG: Forked instance now converging
==> develop: [2014-11-25T16:30:57+00:00] WARN: 
==> develop: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
==> develop: SSL validation of HTTPS requests is disabled. HTTPS connections are still
==> develop: encrypted, but chef is not able to detect forged replies or man in the middle
==> develop: attacks.
==> develop: 
==> develop: To fix this issue add an entry like this to your configuration file:
==> develop: 
==> develop: ```
==> develop:   # Verify all HTTPS connections (recommended)
==> develop:   ssl_verify_mode :verify_peer
==> develop: 
==> develop:   # OR, Verify only connections to chef-server
==> develop:   verify_api_cert true
==> develop: ```
==> develop: 
==> develop: To check your SSL configuration, or troubleshoot errors, you can use the
==> develop: `knife ssl check` command like so:
==> develop: 
==> develop: ```
==> develop:   knife ssl check -c /tmp/vagrant-chef-2/solo.rb
==> develop: ```
==> develop: 
==> develop: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
==> develop: [2014-11-25T16:30:57+00:00] INFO: *** Chef 11.16.4 ***
==> develop: [2014-11-25T16:30:57+00:00] INFO: Chef-client pid: 2306
==> develop: [2014-11-25T16:30:57+00:00] DEBUG: Chef-client request_id: 45494694-3ef0-4c40-abfc-faa48c83b4b8
==> develop: [2014-11-25T16:31:03+00:00] DEBUG: Building node object for develop
==> develop: [2014-11-25T16:31:03+00:00] DEBUG: Extracting run list from JSON attributes provided on command line
==> develop: [2014-11-25T16:31:03+00:00] INFO: Setting the run_list to ["recipe[apt]", "recipe[phpenv::default]"] from CLI options
==> develop: [2014-11-25T16:31:03+00:00] DEBUG: Applying attributes from json file
==> develop: [2014-11-25T16:31:03+00:00] DEBUG: Platform is ubuntu version 14.04
==> develop: [2014-11-25T16:31:03+00:00] INFO: Run List is [recipe[apt], recipe[phpenv::default]]
==> develop: [2014-11-25T16:31:03+00:00] INFO: Run List expands to [apt, phpenv::default]
==> develop: [2014-11-25T16:31:03+00:00] INFO: Starting Chef Run for develop
==> develop: [2014-11-25T16:31:03+00:00] INFO: Running start handlers
==> develop: [2014-11-25T16:31:03+00:00] INFO: Start handlers complete.
==> develop: [2014-11-25T16:31:03+00:00] DEBUG: Re-raising exception: ArgumentError - You must specify at least one cookbook repo path
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/cookbook_loader.rb:43:in `initialize'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/policy_builder/expand_node_object.rb:60:in `new'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/policy_builder/expand_node_object.rb:60:in `setup_run_context'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:265:in `setup_run_context'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:429:in `do_run'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:213:in `block in run'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:207:in `fork'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:207:in `run'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application.rb:236:in `run_chef_client'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application/solo.rb:226:in `block in run_application'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application/solo.rb:218:in `loop'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application/solo.rb:218:in `run_application'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application.rb:55:in `run'
==> develop:   /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/bin/chef-solo:25:in `<top (required)>'
==> develop:   /usr/bin/chef-solo:23:in `load'
==> develop:   /usr/bin/chef-solo:23:in `<main>'
==> develop: [2014-11-25T16:31:03+00:00] ERROR: Running exception handlers
==> develop: [2014-11-25T16:31:03+00:00] ERROR: Exception handlers complete
==> develop: [2014-11-25T16:31:03+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> develop: [2014-11-25T16:31:03+00:00] DEBUG: ArgumentError: You must specify at least one cookbook repo path
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/cookbook_loader.rb:43:in `initialize'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/policy_builder/expand_node_object.rb:60:in `new'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/policy_builder/expand_node_object.rb:60:in `setup_run_context'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:265:in `setup_run_context'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:429:in `do_run'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:213:in `block in run'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:207:in `fork'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:207:in `run'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application.rb:236:in `run_chef_client'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application/solo.rb:226:in `block in run_application'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application/solo.rb:218:in `loop'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application/solo.rb:218:in `run_application'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application.rb:55:in `run'
==> develop: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/bin/chef-solo:25:in `<top (required)>'
==> develop: /usr/bin/chef-solo:23:in `load'
==> develop: /usr/bin/chef-solo:23:in `<main>'
==> develop: [2014-11-25T16:31:04+00:00] ERROR: You must specify at least one cookbook repo path
==> develop: [2014-11-25T16:31:04+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.

対応

なんのこっちゃない、自分の書いたVagrantfileにミスがありました。
  config.vm.define :develop do |develop|
    develop.omnibus.chef_version = :latest
    develop.vm.hostname = "develop"
    develop.vm.box = "opscode-ubuntu-14.04"
    develop.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
    develop.vm.network :private_network, ip: "192.168.33.10"

    develop.vm.synced_folder "application", "/var/www/application/current",
      id: "vagrant-root", :nfs => false,
      :owner => "vagrant",
      :group => "www-data",
      :mount_options => ["dmode=775,fmode=775"]

    develop.vm.provision :chef_solo do |chef|
      chef.log_level = "debug"
#      chef.cookbooks_path = ".cookbooks"
      chef.cookbooks_path = "./cookbooks"
      chef.json = {
        nginx: {
          docroot: {
            owner: "vagrant",
            group: "vagrant",
            path: "/var/www/application/current/app/webroot",
            force_create: true
          },
          default: {
            fastcgi_params: { CAKE_ENV: "development" }
          },
          test: {
            available: true,
            fastcgi_params: { CAKE_ENV: "test" }
          }
        }
      }
      chef.run_list = %w[
        recipe[apt]
        recipe[phpenv::default]
      ]
    end
  end
16行目のスラッシュが抜けてただけっていうね。凡ミスでした。

スポンサーリンク

Related Posts Plugin for WordPress, Blogger...