chef-boneyard / chef-dk

DEPRECATED: A streamlined development and deployment workflow for Chef Infra platform.
Apache License 2.0
380 stars 170 forks source link

semverse stack level too deep with berkshelf 3.1.1 #126

Closed rchekaluk closed 10 years ago

rchekaluk commented 10 years ago

Original error (using vagrant-aws plugin):

$ vagrant up --provider=aws
Bringing machine 'default' up with 'aws' provider...
==> default: HandleBoxUrl middleware is deprecated. Use HandleBox instead.
==> default: This is a bug with the provider. Please contact the creator
==> default: of the provider you use to fix this.
==> default: The cookbook path '/home/USER/.berkshelf/default/vagrant/berkshelf-20140715-22243-kc8gp6-default' doesn't exist. Ignoring...
Updating Vagrant's berkshelf: '/home/USER/.berkshelf/default/vagrant/berkshelf-20140715-22243-kc8gp6-default'
Berkshelf::BerksError: Berks command Failed: /opt/chefdk/bin/berks vendor /home/USER/.berkshelf/default/vagrant/berkshelf-20140715-22243-kc8gp6-default --berksfile=/home/USER/DIR/Berksfile, reason: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/semverse-1.1.0/lib/semverse/version.rb:79: stack level too deep (SystemStackError)

Able to reproduce manually using ChefDK berks 3.1.1 (seems similar to https://github.com/berkshelf/vagrant-berkshelf/issues/51#issuecomment-41013747):

$ /opt/chefdk/bin/berks --version
3.1.1

$ /opt/chefdk/bin/berks vendor /home/USER/.berkshelf/default/vagrant/berkshelf-20140715-22243-kc8gp6-default --berksfile=/home/USER/DIR/Berksfile
Resolving cookbook dependencies...
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/semverse-1.1.0/lib/semverse/version.rb:79: stack level too deep (SystemStackError)

However, manually using rubygems berks 3.1.4 works fine: (possibly fixed by commits https://github.com/berkshelf/berkshelf/commit/186e807a4911e621a18bfe9395cf9aa257252e86 and https://github.com/berkshelf/berkshelf/commit/4010cc7c8d6267be1039cfc35fa9480fb211edac ?)

$ /usr/local/rvm/gems/ruby-2.0.0-p353/bin/berks --version
3.1.4

$ /usr/local/rvm/gems/ruby-2.0.0-p353/bin/berks vendor /home/USER/.berkshelf/default/vagrant/berkshelf-20140715-22243-kc8gp6-default --berksfile=/home/USER/DIR/Berksfile
Resolving cookbook dependencies...
Fetching 'casperjs' from git://github.com/jenkinslaw/casperjs-cookbook.git (at master)
...
Installing s3_file (2.4.0) from https://api.berkshelf.com ([opscode] https://supermarket.getchef.com/api/v1)
...
Vendoring zip (1.1.0) to /home/USER/.berkshelf/default/vagrant/berkshelf-20140715-22243-kc8gp6-default/zip

Removing Berksfile.lock works around the issue per https://github.com/berkshelf/berkshelf/issues/1154#issuecomment-41877803

It seems to me that ChefDK needs to package a newer version of berkshelf.

Versions:

$ ruby --version
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
$ vagrant --version
Vagrant 1.6.3
$ vagrant plugin list
vagrant-aws (0.5.0)
vagrant-berkshelf (3.0.1)
vagrant-login (1.0.1, system)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.0, system)
vagrant-vbguest (0.10.0)
$ rvm current
Warning! PATH is not properly set up, '/usr/local/rvm/gems/ruby-2.0.0-p353/bin' is not at first place,
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-2.0.0-p353'.
ruby-2.0.0-p353
sethvargo commented 10 years ago

@rchekaluk this is a known issue and the ChefDK team is working on getting a new version of ChefDK released.

rchekaluk commented 10 years ago

ChefDK 0.2.0 appears to fix this issue.

$ chef --version
Chef Development Kit Version: 0.2.0

$ /opt/chefdk/bin/berks --version
3.1.3