New Chef server not able to fetch upstream supermarket cookbooks

Hello, I have setup a new chef server & workstation client env to try and start getting our code base up to at least chef16 1st but at current the chef server does not appear to be able to pull in the default supermarket i.e. supermarket.chef.io I can query it no problem but if I try and assign a cookbook to a node in the chef server UI it complains of constrains and says it cannot find upstream cookbooks like resolver.

Packages on the chef server are

chef-manage-3.3.96-1.el7.x86_64
chef-15.10.12-1.el7.x86_64
chef-server-core-12.19.31-1.el7.x86_64

Any help would be appreciated I had thought supermarket was a built in and I cannot seem to find anything stating how to setup the config for upstream as a result of this.

Chef server by design doesn't pull dependencies. You have to do that by running chef install if using policy files or berks install if using roles/environments. That will download and cache a copy of all the dependencies for a cookbook locally and then chef push or berks upload to push your cookbook and all dependencies to chef-server. This ensures only code you've tested should be getting pushed and not a community update randomly gets pulled down and breaks things. If you already have a policy lock file or a berks lock file then run chef udpate or berks update to update it with the latest versions of the dependencies allowed by your cookbook.

The Chef Server doesn't automatically connect to Supermarket by default. You need to enable it explicitly. Here's how:

  1. Enable Supermarket in Chef Server
    • Edit the Chef Server config:

      sudo vi /etc/opscode/chef-server.rb

    • Add this line:

      opscode['default_supermarket_source'] = true

    • Reconfigure the server:

      sudo chef-server-ctl reconfigure

  • sudo chef-manage-ctl restart*
  1. Verify Connectivity
    Test if the Chef Server can reach Supermarket:
    curl https://supermarket.chef.io

  2. Update Chef Server and Components
    Your Chef Server version is outdated (12.19.31). Upgrade to the latest version for better Supermarket support:

    • Backup:

      chef-server-ctl backup

    • Download & install the latest packages from Chef Downloads.

  3. Use Berkshelf on Workstation
    As a workaround, use Berkshelf to fetch cookbooks from Supermarket and upload them manually:

    • Install Berkshelf:

      chef gem install berkshelf

    • Create a Berksfile and upload cookbooks:

      berks install
      berks upload

This should resolve your issue. Let me know if you need more help!