berkshelf / vagrant-berkshelf

A Vagrant plugin to add Berkshelf integration to the Chef provisioners
Other
378 stars 100 forks source link

Error after updating chefDK #316

Open gbonk opened 7 years ago

gbonk commented 7 years ago

I have not found a matching issue on here like I am having at the moment.. Note the version is dot

I just uninstalled ChefDk 1.1.6 and installed 1.2.22

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
The Berkshelf version at "C:\\opscode\\chefdk\\bin/berks.BAT" is invalid.
Vagrant Berkshelf requires >= 4.0, but the current version is .

Please download and install the latest version of the ChefDK from:

    https://downloads.chef.io/chef-dk

and follow the installation instructions. Do not forget to add the ChefDK to
your PATH.

I'm running this from a Git-Bash shell on windows.

I downloaded the Windows 2012r2 x86_64 but I'm on Windows 7 Enterprise

$ vagrant plugin list vagrant-berkshelf (5.1.1)

$ vagrant --version Vagrant 1.9.1

$ which berks /c/opscode/chefdk/bin/berks

$ chef --version Chef Development Kit Version: 1.2.22 chef-client version: 12.18.31 delivery version: master (0b746cafed65a9ea1a79de3cc546e7922de9187c) berks version: 2017-02-06T10:59:37.347824 19644] 2017-02-06T10:59:37.347824 19644] 2017-02-06T10:59:37.347824 19644] 2017-02-06T10:59:37.348824 19644] 2017-02-06T10:59:37.426824 19644] 2017-02-06T10:59:37.426824 19644] 5.6.0 kitchen version: 1.15.0

pelletiermaxime commented 7 years ago

Had the same problem this morning. Downgrading to chefdk 1.2.20 (containing berks 5.5) fixed it for now.

gbonk commented 7 years ago

Same here, Downgrading to chefdk 1.2.20. Now it's fine

CarlGranstrom commented 7 years ago

Same issue here, downgrading(1.2.20) did it.

gbonk commented 7 years ago

I un installed and reinstalled the older version.

On Feb 9, 2017, at 6:41 AM, CarlGran notifications@github.com wrote:

Same issue here, what is the best way to downgrade chefdk?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

colinpetruno commented 7 years ago

I ran into this today. It looks to be caused by new warnings outputted during the version check. image

This hits JSON.parse https://github.com/berkshelf/vagrant-berkshelf/blob/master/lib/vagrant-berkshelf/action/check.rb#L36

And then raises the version error https://github.com/berkshelf/vagrant-berkshelf/blob/master/lib/vagrant-berkshelf/action/check.rb#L42-L43

Then it doesn't output the version in the error message but the current version is . since it does not get parsed.

vt-devops commented 7 years ago

Same issue. Agree with @colinpetruno . Downgrade worked.

SeanSith commented 7 years ago

This is caused by a problem with the version of Hashie included in the Berkshelf within the latest ChefDK: https://github.com/berkshelf/berkshelf/issues/1669

You can do a workaround on ChefDK by patching Berkshelf with https://github.com/berkshelf/berkshelf/pull/1668/files

bdwyertech commented 7 years ago

ChefDK Workaround

  1. sudo chef exec gem install berkshelf
  2. Edit /opt/chefdk/bin/berks and change version to 5.6.3 or whatever the current gem version is

sudo vim /opt/chefdk/bin/berks

gem "berkshelf", "= 5.6.3"

spec = Gem::Specification.find_by_name("berkshelf", "= 5.6.3")
jeffbyrnes commented 7 years ago

So @bdwyertech’s solution eventually worked, but it involves not having the gem bin of berks on your $PATH, and making the changes they suggest.

gbonk commented 7 years ago

@bdwyertech worked for me and i can now use 1.2.22

Directions for Git Bash on windows

  1. chef exec gem install berkshelf
  2. vi /c/opscode/chefdk/bin/berks