Chef depsolver defaults to old version in _default environment?

nathanclemons@hawke chef-devops (master)$ knife cookbook show moxie-base
moxie-base   0.1.48  0.1.47  0.1.46  0.1.45  0.1.44  0.1.43  0.1.42  0.1.41  0.1.40  0.1.39  0.1.38  0.1.36  0.1.35  0.1.34  0.1.33  0.1.32  0.1.31  0.1.30  0.1.29  0.1.28  0.1.27  0.1.22  0.1.21  0.1.20  0.1.19  0.1.18  0.1.17  0.1.16  0.1.15  0.1.14  0.1.13  0.1.12  0.1.11  0.1.10  0.1.9  0.1.8  0.1.7  0.1.6  0.1.5  0.1.4  0.1.3  0.1.2  0.1.0
nathanclemons@hawke chef-devops (master)$ knife solve moxie-autonomy    
Solving [moxie-autonomy] in _default environment
apt 3.0.0
ark 1.0.1
build-essential 3.2.0
chef-client 4.5.0
chef-sugar 3.3.0
chef_handler 1.3.0
cron 1.7.6
dmg 2.4.0
firewall 2.5.0
git 4.5.0
homebrew 2.1.0
hostsfile 2.4.5
iis 4.1.7
logrotate 1.9.2
moxie 0.1.11
moxie-autonomy 0.0.11
moxie-base 0.1.35
moxie-inventory 0.1.5
moxie-nrpe 0.1.23
nodejs 2.4.4
nrpe 1.5.2
ohai 3.0.1
omnibus_updater 1.1.0
partial_search 1.0.9
seven_zip 2.0.0
ssh_authorized_keys 0.3.0
ssh_known_hosts 2.0.0
webpi 2.0.0
windows 1.40.0
yum 3.10.0
yum-epel 0.7.0
nathanclemons@hawke chef-devops (master)$ knife environment show bkbautovd-default -Fj
{
  "name": "bkbautovd-default",
  "description": "KB10 Autonomy environment for bellevue",
  "cookbook_versions": {
    "moxie-base": "~> 0.1.47",
    "moxie": "~> 0.1.10",
    "moxie-inventory": "~> 0.1.5",
    "moxie-nrpe": "~> 0.1.23"
  },
  "json_class": "Chef::Environment",
  "chef_type": "environment",
  "default_attributes": {

  },
  "override_attributes": {
    "autonomy": {
      "idol": {
        "servers": [
          "192.168.175.100",
          "192.168.175.101"
        ]
      },
      "dah": {
        "servers": [
          "192.168.175.162"
        ]
      },
      "dih": {
        "servers": [
          "192.168.175.41"
        ]
      },
      "share_data_path": "\\\\bel-engfile01.eng.corp.moxiesoft.com\\kb_deployment",
      "source_files_dir": "C:\\Windows\\Temp"
    }
  }
}
nathanclemons@hawke chef-devops (master)$ knife solve moxie-autonomy -E bkbautovd-default
Solving [moxie-autonomy] in bkbautovd-default environment
apt 2.9.2
ark 1.0.1
build-essential 3.2.0
chef-client 4.5.0
chef-sugar 3.3.0
chef_handler 1.3.0
cron 1.7.6
dmg 2.4.0
firewall 2.5.0
git 4.5.0
homebrew 2.1.0
hostsfile 2.4.5
iis 4.1.7
logrotate 1.9.2
moxie 0.1.11
moxie-autonomy 0.0.11
moxie-base 0.1.48
moxie-inventory 0.1.5
moxie-nrpe 0.1.23
nodejs 2.4.4
nrpe 1.5.2
ohai 3.0.1
omnibus_updater 1.1.0
partial_search 1.0.9
seven_zip 2.0.0
ssh_authorized_keys 0.3.0
ssh_known_hosts 2.0.0
webpi 2.0.0
windows 1.40.0
yum 3.10.0
yum-epel 0.7.0
nathanclemons@hawke chef-devops (master)$

So the _default environment resolves to moxie-base 0.1.35, but setting pessimistic cookbook pins inside an environment, it’s able to resolve and use the latest version (0.1.48). Is there any way to tell why _default is using an older version of the cookbook instead of the latest?

From the output it looks like the newer moxie-base depends on version 2.x of the apt cookbook so without any other constraints, the solver decides apt being the latest (3.x) is more important than moxie-base.

Wow, that was exactly right. I forgot I’d even set that, when I was running into odd behavior with apt_repository… which I eventually moved away from (it was intermittently switching between whether or not it would configure the repo as ‘trusty main’ or just ‘main’, and causing a lot of errors, so I just switched to dropping in a cookbook_file instead).

How did you catch that it was moxie-base depending on apt that was the issue, outside of being intimately familiar with knife-solve having written it? :slight_smile:

Nathan Clemons
DevOps Engineer
Moxie Cloud Services (MCS)

O +1.425.467.5075
M +1.360.861.6291
E nclemons@gomoxie.com
W www.gomoxie.comhttp://www.gomoxie.com/