Vim problem with chef-zero and vagrant

Hi,

When I tried to install the vim recipe, I got this error message:

==> default: [2015-01-28T08:30:19+00:00] DEBUG: Found recipe package in
cookbook vim
==> default: [2015-01-28T08:30:19+00:00] DEBUG: Caught
InvalidVersionConstraint. This means that a key in value_for_platform
cannot be interpreted as a Chef::VersionConstraint.
==> default: [2015-01-28T08:30:19+00:00] DEBUG: ‘default’
(Chef::Exceptions::InvalidVersionConstraint)
==> default:
/opt/chef/embedded/apps/chef/lib/chef/version_constraint.rb:113:in parse' ==> default: /opt/chef/embedded/apps/chef/lib/chef/version_constraint.rb:36:ininitialize’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:79:in
new' ==> default: /opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:79:inblock in match_versions’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:77:in
each' ==> default: /opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:77:inmatch_versions’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:54:in
value_for_node' ==> default: /opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:149:invalue_for_platform’
==> default:
/tmp/vagrant-chef/fde7703d3d9a9afc6709c47aeb2e0724/cookbooks/vim/recipes/package.rb:23:in
from_file' ==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/from_file.rb:30:ininstance_eval’
==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/from_file.rb:30:in
from_file' ==> default: /opt/chef/embedded/apps/chef/lib/chef/cookbook_version.rb:245:inload_recipe’
==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:169:in
load_recipe' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:138:inblock in include_recipe’
==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:137:in
each' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:137:ininclude_recipe’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/dsl/include_recipe.rb:26:in
include_recipe' ==> default: /tmp/vagrant-chef/fde7703d3d9a9afc6709c47aeb2e0724/cookbooks/vim/recipes/default.rb:21:infrom_file’
==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/from_file.rb:30:in
instance_eval' ==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/from_file.rb:30:infrom_file’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/cookbook_version.rb:245:in
load_recipe' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:169:inload_recipe’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/run_context/cookbook_compiler.rb:140:in
block in compile_recipes' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context/cookbook_compiler.rb:138:ineach’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/run_context/cookbook_compiler.rb:138:in
compile_recipes' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context/cookbook_compiler.rb:75:incompile’
==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:92:in
load' ==> default: /opt/chef/embedded/apps/chef/lib/chef/policy_builder/expand_node_object.rb:73:insetup_run_context’
==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:235:in
setup_run_context' ==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:397:inrun’
==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:261:in
block in fork_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:249:infork’
==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:249:in
fork_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:215:inblock in run_chef_client’
==> default: /opt/chef/embedded/apps/chef/lib/chef/local_mode.rb:38:in
with_server_connectivity' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:201:inrun_chef_client’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:245:in block in interval_run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:234:inloop’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:234:in
interval_run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:224:inrun_application’
==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:58:in
run' ==> default: /opt/chef/embedded/apps/chef/bin/chef-solo:25:in<top
(required)>’
==> default: /usr/bin/chef-solo:40:in load' ==> default: /usr/bin/chef-solo:40:in

Here is the provision section of my Vagrant file:

config.vm.provision :chef_zero do |chef|
# Do not need to specify cookbook path
# because of the berkshelf plugin
# Enable this for debug info
chef.log_level = :debug
chef.data_bags_path = "data_bags"
chef.add_recipe 'apt’
chef.add_recipe 'python’
chef.add_recipe 'vim’
chef.add_recipe 'git’
end

Do you know why it failed and how can I fix it?

Cheers, Tony

Tony,

If you look at the chef_zero documentation, it looks like it’s
"chef_zero" not :chef_zero.

Can you humor me and see if that fixes it?

Also, in this case, I’d look at chef-apply over chef_zero, it seems
closer to what you’re attempting to do.

HTH,
JJ
Best Regards,
JJ Asghar
c: 512.619.0722 t: @jjasghar irc: j^2

On Wed, Jan 28, 2015 at 3:22 AM, Anthony Kong anthony.hw.kong@gmail.com wrote:

Hi,

When I tried to install the vim recipe, I got this error message:

==> default: [2015-01-28T08:30:19+00:00] DEBUG: Found recipe package in
cookbook vim
==> default: [2015-01-28T08:30:19+00:00] DEBUG: Caught
InvalidVersionConstraint. This means that a key in value_for_platform cannot
be interpreted as a Chef::VersionConstraint.
==> default: [2015-01-28T08:30:19+00:00] DEBUG: ‘default’
(Chef::Exceptions::InvalidVersionConstraint)
==> default:
/opt/chef/embedded/apps/chef/lib/chef/version_constraint.rb:113:in parse' ==> default: /opt/chef/embedded/apps/chef/lib/chef/version_constraint.rb:36:ininitialize’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:79:in
new' ==> default: /opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:79:inblock in match_versions’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:77:in
each' ==> default: /opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:77:inmatch_versions’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:54:in
value_for_node' ==> default: /opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:149:invalue_for_platform’
==> default:
/tmp/vagrant-chef/fde7703d3d9a9afc6709c47aeb2e0724/cookbooks/vim/recipes/package.rb:23:in
from_file' ==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/from_file.rb:30:ininstance_eval’
==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/from_file.rb:30:in
from_file' ==> default: /opt/chef/embedded/apps/chef/lib/chef/cookbook_version.rb:245:inload_recipe’
==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:169:in
load_recipe' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:138:inblock in include_recipe’
==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:137:in
each' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:137:ininclude_recipe’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/dsl/include_recipe.rb:26:in
include_recipe' ==> default: /tmp/vagrant-chef/fde7703d3d9a9afc6709c47aeb2e0724/cookbooks/vim/recipes/default.rb:21:infrom_file’
==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/from_file.rb:30:in
instance_eval' ==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/from_file.rb:30:infrom_file’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/cookbook_version.rb:245:in
load_recipe' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:169:inload_recipe’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/run_context/cookbook_compiler.rb:140:in
block in compile_recipes' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context/cookbook_compiler.rb:138:ineach’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/run_context/cookbook_compiler.rb:138:in
compile_recipes' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context/cookbook_compiler.rb:75:incompile’
==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:92:in
load' ==> default: /opt/chef/embedded/apps/chef/lib/chef/policy_builder/expand_node_object.rb:73:insetup_run_context’
==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:235:in
setup_run_context' ==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:397:inrun’
==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:261:in
block in fork_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:249:infork’
==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:249:in
fork_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:215:inblock in run_chef_client’
==> default: /opt/chef/embedded/apps/chef/lib/chef/local_mode.rb:38:in
with_server_connectivity' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:201:inrun_chef_client’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:245:in block in interval_run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:234:inloop’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:234:in
interval_run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:224:inrun_application’
==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:58:in
run' ==> default: /opt/chef/embedded/apps/chef/bin/chef-solo:25:in<top
(required)>’
==> default: /usr/bin/chef-solo:40:in load' ==> default: /usr/bin/chef-solo:40:in

Here is the provision section of my Vagrant file:

config.vm.provision :chef_zero do |chef|
# Do not need to specify cookbook path
# because of the berkshelf plugin
# Enable this for debug info
chef.log_level = :debug
chef.data_bags_path = "data_bags"
chef.add_recipe 'apt’
chef.add_recipe 'python’
chef.add_recipe 'vim’
chef.add_recipe 'git’
end

Do you know why it failed and how can I fix it?

Cheers, Tony

Hi JJ,

No luck. Same problem:

DEBUG: Caught InvalidVersionConstraint. This means that a key in
value_for_platform cannot be interpreted as a Chef::VersionConstraint.

Cheers, Tony

On Thu, Jan 29, 2015 at 7:56 AM, JJ Asghar jj@chef.io wrote:

Tony,

https://docs.vagrantup.com/v2/provisioning/chef_zero.html

If you look at the chef_zero documentation, it looks like it’s
"chef_zero" not :chef_zero.

Can you humor me and see if that fixes it?

Also, in this case, I’d look at chef-apply over chef_zero, it seems
closer to what you’re attempting to do.
https://docs.vagrantup.com/v2/provisioning/chef_apply.html

HTH,
JJ
Best Regards,
JJ Asghar
c: 512.619.0722 t: @jjasghar irc: j^2

On Wed, Jan 28, 2015 at 3:22 AM, Anthony Kong anthony.hw.kong@gmail.com
wrote:

Hi,

When I tried to install the vim recipe, I got this error message:

==> default: [2015-01-28T08:30:19+00:00] DEBUG: Found recipe package in
cookbook vim
==> default: [2015-01-28T08:30:19+00:00] DEBUG: Caught
InvalidVersionConstraint. This means that a key in value_for_platform
cannot
be interpreted as a Chef::VersionConstraint.
==> default: [2015-01-28T08:30:19+00:00] DEBUG: ‘default’
(Chef::Exceptions::InvalidVersionConstraint)
==> default:
/opt/chef/embedded/apps/chef/lib/chef/version_constraint.rb:113:in
parse' ==> default: /opt/chef/embedded/apps/chef/lib/chef/version_constraint.rb:36:ininitialize’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:79:in
new' ==> default: /opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:79:inblock in match_versions’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:77:in
each' ==> default: /opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:77:inmatch_versions’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:54:in
`value_for_node’
==> default:

/opt/chef/embedded/apps/chef/lib/chef/dsl/platform_introspection.rb:149:in

`value_for_platform’
==> default:

/tmp/vagrant-chef/fde7703d3d9a9afc6709c47aeb2e0724/cookbooks/vim/recipes/package.rb:23:in

from_file' ==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/from_file.rb:30:ininstance_eval’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/mixin/from_file.rb:30:in
from_file' ==> default: /opt/chef/embedded/apps/chef/lib/chef/cookbook_version.rb:245:inload_recipe’
==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:169:in
load_recipe' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:138:inblock in include_recipe’
==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:137:in
each' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:137:ininclude_recipe’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/dsl/include_recipe.rb:26:in
`include_recipe’
==> default:

/tmp/vagrant-chef/fde7703d3d9a9afc6709c47aeb2e0724/cookbooks/vim/recipes/default.rb:21:in

from_file' ==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/from_file.rb:30:ininstance_eval’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/mixin/from_file.rb:30:in
from_file' ==> default: /opt/chef/embedded/apps/chef/lib/chef/cookbook_version.rb:245:inload_recipe’
==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:169:in
`load_recipe’
==> default:

/opt/chef/embedded/apps/chef/lib/chef/run_context/cookbook_compiler.rb:140:in

`block in compile_recipes’
==> default:

/opt/chef/embedded/apps/chef/lib/chef/run_context/cookbook_compiler.rb:138:in

`each’
==> default:

/opt/chef/embedded/apps/chef/lib/chef/run_context/cookbook_compiler.rb:138:in

`compile_recipes’
==> default:

/opt/chef/embedded/apps/chef/lib/chef/run_context/cookbook_compiler.rb:75:in

compile' ==> default: /opt/chef/embedded/apps/chef/lib/chef/run_context.rb:92:inload’
==> default:

/opt/chef/embedded/apps/chef/lib/chef/policy_builder/expand_node_object.rb:73:in

setup_run_context' ==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:235:insetup_run_context’
==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:397:in run' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:261:inblock in fork_chef_client’
==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:249:in
fork' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:249:infork_chef_client’
==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:215:in
block in run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/local_mode.rb:38:inwith_server_connectivity’
==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:201:in
run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:245:inblock
in
interval_run_chef_client’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:234:in loop' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:234:ininterval_run_chef_client’
==> default:
/opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:224:in
run_application' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:58:inrun’
==> default: /opt/chef/embedded/apps/chef/bin/chef-solo:25:in <top (required)>' ==> default: /usr/bin/chef-solo:40:inload’
==> default: /usr/bin/chef-solo:40:in `’

Here is the provision section of my Vagrant file:

config.vm.provision :chef_zero do |chef|
# Do not need to specify cookbook path
# because of the berkshelf plugin
# Enable this for debug info
chef.log_level = :debug
chef.data_bags_path = "data_bags"
chef.add_recipe 'apt’
chef.add_recipe 'python’
chef.add_recipe 'vim’
chef.add_recipe 'git’
end

Do you know why it failed and how can I fix it?

Cheers, Tony

On Thu, 29 Jan 2015, Anthony Kong wrote:

DEBUG: Caught InvalidVersionConstraint. This means that a key in
value_for_platform cannot be interpreted as a Chef::VersionConstraint.

Can you post your vim/recipes/package.rb? What version of Chef are you
using? What OS and version is the guest?

  • Julian

Hi Julian,

I did not make my own vim package. I specify the package in Berksfile

encoding: utf-8

source ‘https://supermarket.getchef.com

cookbook "apt"
cookbook “python”, {}
cookbook “vim”, {}
cookbook “git”, {}
cookbook “postfix”, {}
cookbook ‘sensu’, '~> 2.3.0’
cookbook “uchiwa”

Chef version

$ chef -v
Chef Development Kit Version: 0.3.6

The vagrant plugin I am using

$ vagrant plugin list
chef-zero (2.2.1)
vagrant-aws (0.6.0)
vagrant-berkshelf (4.0.2)
vagrant-cachier (1.2.0)
vagrant-chef-zero (0.7.1)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.3, system)

My OS is OSX 10.10.1

The guest OS is “ubuntu/trusty64”

Cheers, Konga

Tony Kong
blog: www.ahwkong.com
linkedin: www.linkedin.com/in/anthonykong

Don’t EVER make the mistake that you can design something better than what
you get from ruthless massively parallel trial-and-error with a feedback
cycle. That’s giving your intelligence much too much credit.

  • Linus Torvalds

On Thu, Jan 29, 2015 at 12:25 PM, Julian C. Dunn jdunn@aquezada.com wrote:

On Thu, 29 Jan 2015, Anthony Kong wrote:

DEBUG: Caught InvalidVersionConstraint. This means that a key in

value_for_platform cannot be interpreted as a Chef::VersionConstraint.

Can you post your vim/recipes/package.rb? What version of Chef are you
using? What OS and version is the guest?

  • Julian

On Wednesday, January 28, 2015 at 6:13 PM, Anthony Kong wrote:

Hi Julian,

I did not make my own vim package. I specify the package in Berksfile
Based on the last release date of that cookbook (see: https://supermarket.chef.io/cookbooks/vim ) it looks like it may not be compatible with Chef 12. You can file a bug report here: https://github.com/opscode-cookbooks/vim

HTH,


Daniel DeLeo

Hi Daniel,

Lodged a bug report https://github.com/opscode-cookbooks/vim/issues/9

Cheers

On Thu, Jan 29, 2015 at 1:50 PM, Daniel DeLeo dan@kallistec.com wrote:

On Wednesday, January 28, 2015 at 6:13 PM, Anthony Kong wrote:

Hi Julian,

I did not make my own vim package. I specify the package in Berksfile
Based on the last release date of that cookbook (see:
https://supermarket.chef.io/cookbooks/vim ) it looks like it may not be
compatible with Chef 12. You can file a bug report here:
https://github.com/opscode-cookbooks/vim

HTH,


Daniel DeLeo