Skip to content
This repository has been archived by the owner on Dec 26, 2017. It is now read-only.

Error after updating chefDK #316

Open
gbonk opened this issue Feb 6, 2017 · 10 comments
Open

Error after updating chefDK #316

gbonk opened this issue Feb 6, 2017 · 10 comments

Comments

@gbonk
Copy link

gbonk commented Feb 6, 2017

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)

  • Version Constraint: > 0
    vagrant-share (1.1.6)
  • Version Constraint: > 0
    vagrant-vbguest (0.13.0)
  • Version Constraint: > 0

$ 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
Copy link

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

@gbonk
Copy link
Author

gbonk commented Feb 6, 2017

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

@CarlGranstrom
Copy link

CarlGranstrom commented Feb 9, 2017

Same issue here, downgrading(1.2.20) did it.

@gbonk
Copy link
Author

gbonk commented Feb 9, 2017 via email

@colinpetruno
Copy link

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
Copy link

Same issue. Agree with @colinpetruno . Downgrade worked.

  • Rich Theobald

@SeanSith
Copy link

This is caused by a problem with the version of Hashie included in the Berkshelf within the latest ChefDK: berkshelf/berkshelf#1669

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

@bdwyertech
Copy link

bdwyertech commented Mar 3, 2017

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
Copy link

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
Copy link
Author

gbonk commented Apr 5, 2017

@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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants