Search code examples
mysqlvagrantberkshelf

berkshelf + chef: could not find recipe server for cookbook mysql


I'm using vagrant (1.8.4) with Bookshelf.

Also I've installed plugins:

vagrant plugin install vagrant-omnibus
vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-cachier

Once running vagrant up I get:

==> default: ================================================================================
==> default: Recipe Compile Error
==> default: ================================================================================
==> default: 
==> default: Chef::Exceptions::RecipeNotFound
==> default: --------------------------------
==> default: could not find recipe server for cookbook mysql

Vagrantfile chunk:

  config.vm.provision "chef_solo" do |chef|
      chef.add_recipe "java"
      chef.add_recipe "maven"
      chef.add_recipe "postgresql::server"
      chef.add_recipe "mysql::server"
      chef.add_recipe "sqlite"
      chef.add_recipe "groovy"

Berksfile contents:

source "https://supermarket.getchef.com"

cookbook "java"
cookbook "postgresql"
cookbook "mysql"
cookbook "sqlite"
cookbook "maven"
cookbook "groovy"

I've seen this one: Chef mysql opscode-cookbooks desn't work: "could not find recipe ruby for cookbook mysql" but still it's unclear to me how to fix it in my use-case.

For full Vagrantfile contents, see: https://github.com/p6spy/p6spy/blob/master/Vagrantfile

How should I fix it?


Solution

  • I cloned a copy of your repo and made the following changes:

    Berksfile:

    source 'https://supermarket.getchef.com'
    
    cookbook 'java',       '= 1.29.0'
    cookbook 'postgresql', '= 3.4.12'
    cookbook 'mysql',      '= 5.6.3'
    cookbook 'sqlite',     '= 1.1.0'
    cookbook 'maven',      '= 1.2.0'
    cookbook 'groovy',     '= 0.0.1'
    

    I pinned the version of the chef cookbooks to the versions around the time of November 2014. This was based on the commit of your Vagrantfile.

    As you were not specifying a version you would always be getting the latest versions of each cookbook. If you want to use later versions then this would require your recipe declarations to change in your Vagrantfile to match the current recipes provided by each cookbook. As noted already, mysql has been updated since then and also the maven cookbook too. In fact most of them apart from groovy and sqlite is now deprecated.

    Vagrantfile snippet:

    "groovy" => {
      "version"  => "2.1.9",
      "url"      => "https://dl.bintray.com/groovy/maven/groovy-binary-2.1.9.zip",
      "checksum" => "d9cb8d54680d508ac1eb928f8d0cfb1fb1bec7843bb405ea9a7d18f512b10ba6"
    }
    

    The URL to obtain groovy has changed since 2014 so I added the new location and checksum to match.