Error resolving cookbook

4.7k Views Asked by At

I went through many similar threads but none answers my problem. I have mysql 4.1.2 recipe. when i run it in opsworks i gives me this error. when i run the similar recipe in my local ubuntu it works fine. i have done some heavy tweaking with version number of dependencies, but still no solution. What can be the cause of this problem ?
My CookBook repo is at github

    ================================================================================
    Error Resolving Cookbooks for Run List:
    ================================================================================


    Missing Cookbooks:
    ------------------
    Could not satisfy version constraints for: mysql
3

There are 3 best solutions below

4
On BEST ANSWER

Your version of the database cookbook requires mysql >= 5.0.0 but you have 4.1.2.

5
On

Beside solution that @coderanger gave you, good practise to avoid issues like this and escape dependency hell this is to use some kind of cookbook manager (dependency manager for cookbooks).

There is a few options such Berkshelf or Librarian-chef, where Berkshelf is more popular, and it's even included in Chef Development Kit, so if you use it you do not need to install it separately.

So basically idea behind this is to have one place where you define your sorces of all of your cookbooks, default one is Chef Supermarket or if you you want you can use custom location or git repo as source.

After defining sources you just need to define which cookbooks you want (with or without) desired version or tag you want and cookbook manager will resolve dependencies for all defined cookbooks and it will install them for you, and if you want you can vendor them too.

For more info how to use those tools consult official websites:

2
On

Another place to look is your environments file cookbook_versions properties. If a cookbook version is specified there, it could be conflicting with other version specifications.

https://docs.chef.io/environments.html