Chef_nginx: Could not satisfy version constraints for: windows - on Ubuntu?!?

Hi

I’m trying to use chef_nginx cookbook from the Supermarket, but it fails with this error:

~/ sudo /usr/bin/chef-client -j /opt/nginx-rp-kitchen/nodes/vorlage.standard.json -c /opt/nginx-rp-kitchen/client.rb         
Starting Chef Client, version 12.19.36
resolving cookbooks for run list: ["ew-nginx-rp"]

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

Missing Cookbooks:
------------------
Could not satisfy version constraints for: windows

Expanded Run List:
------------------
* ew-nginx-rp

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


Running handlers:
Running handlers complete
Chef Client failed. 0 resources updated in 05 seconds

This is on a Ubuntu 16.04 system with Chef 12.19.36 from chef.io. We’re using Chef Zero (local mode) without Berks or such. So I copied all the cookbooks that are required (because of dependencies) to the system and ran /usr/bin/chef-client -j /opt/nginx-rp-kitchen/nodes/vorlage.standard.json -c /opt/nginx-rp-kitchen/client.rb. You can find these files at https://gist.github.com/alexs77/4eeba53c2340fba88e4b37c40c6aa1b1.

Why does it try to do something with “windows” (and also mingw) on a Ubuntu system?

Thanks,
Alexander

There’s a dependency on the windows cookbook in the chef-nginx cookbook, for when it’s used on windows nodes. All that means is about 60KB of cookbooks need to be present on your system.
I’d strongly recommend that you use berks or policies to do dependency management (use the export functionality to use them with chef-solo) and just stop worrying about it :slight_smile:
-Thom

Hi Thom

Hm. I do have the windows cookbook on my system, but it still fails with
this error. Before, when I didn’t have the cookbook present, I got a
different error.

Hmm. Is chef_nginx, or build-essentials, maybe not compatible with the
latest version which is on GitHub? Does it require an older version?

Thanks
Alexander

You’re likely running into a version mis-match. Either the version of the
Windows cookbook you have is too new, too old, or you have a version
conflict in your stack somewhere.

Easiest way to resolve is use berkshelf to map it out for you, then upload
those versions of the cookbooks to your nodes.