berkshelf / berkshelf

A Chef Cookbook manager
Other
1.07k stars 313 forks source link

Berkshelf3 - Berkshelf::MismatchedCookbookName - unable to provision box #1236

Closed dmanchikalapudi closed 10 years ago

dmanchikalapudi commented 10 years ago

I am currently using the following versions of gems

vagrant 1.6.3 berkshelf 3.1.3 test kitchen 1.2.1 kitchen vagrant 0.15.0

kitchen converge fails with the following error.

I, [2014-06-12T13:02:50.645399 #105604]  INFO -- Kitchen: -----> Starting Kitchen (v1.2.1)
I, [2014-06-12T13:02:53.837399 #105604]  INFO -- Kitchen: -----> Creating <default-centos-59>...
I, [2014-06-12T13:06:52.190399 #105604]  INFO -- Kitchen: -----> Converging <default-centos-59>...
E, [2014-06-12T13:06:54.907899 #105604] ERROR -- Kitchen: ------Exception-------
E, [2014-06-12T13:06:54.907899 #105604] ERROR -- Kitchen: Class: Kitchen::ActionFailed
E, [2014-06-12T13:06:54.907899 #105604] ERROR -- Kitchen: Message: Failed to complete #converge action: [Berkshelf::MismatchedCookbookName]
E, [2014-06-12T13:06:54.908399 #105604] ERROR -- Kitchen: ---Nested Exception---
E, [2014-06-12T13:06:54.908399 #105604] ERROR -- Kitchen: Class: Berkshelf::MismatchedCookbookName
E, [2014-06-12T13:06:54.908399 #105604] ERROR -- Kitchen: Message: Berkshelf::MismatchedCookbookName
E, [2014-06-12T13:06:54.908399 #105604] ERROR -- Kitchen: ------Backtrace-------
E, [2014-06-12T13:06:54.908399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-3.1.3/lib/berkshelf/locations/base.rb:69:in `validate_cached!'
E, [2014-06-12T13:06:54.908399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-3.1.3/lib/berkshelf/locations/git.rb:67:in `install'
E, [2014-06-12T13:06:54.908399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:179:in `block in download_locations'
E, [2014-06-12T13:06:54.908399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:176:in `each'
E, [2014-06-12T13:06:54.908399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:176:in `download_locations'
E, [2014-06-12T13:06:54.908399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:149:in `install_from_universe'
E, [2014-06-12T13:06:54.908399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:39:in `run'
E, [2014-06-12T13:06:54.908399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-3.1.3/lib/berkshelf/berksfile.rb:371:in `install'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-3.1.3/lib/berkshelf/berksfile.rb:590:in `vendor'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/provisioner/chef/berkshelf.rb:55:in `block in resolve'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/shell/basic.rb:20:in `mute'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/provisioner/chef/berkshelf.rb:51:in `resolve'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/provisioner/chef_base.rb:394:in `block in resolve_with_berkshelf'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: <internal:prelude>:10:in `synchronize'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/provisioner/chef_base.rb:393:in `resolve_with_berkshelf'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/provisioner/chef_base.rb:259:in `prepare_cookbooks'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/provisioner/chef_base.rb:120:in `create_sandbox'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/provisioner/chef_solo.rb:33:in `create_sandbox'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/driver/ssh_base.rb:40:in `converge'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/kitchen-vagrant-0.15.0/lib/kitchen/driver/vagrant.rb:75:in `converge'
E, [2014-06-12T13:06:54.908899 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:273:in `public_send'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:273:in `block in perform_action'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:308:in `call'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:308:in `synchronize_or_call'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:283:in `block in action'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/1.9.1/benchmark.rb:280:in `measure'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:282:in `action'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:273:in `perform_action'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:256:in `converge_action'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:246:in `block in transition_to'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:245:in `each'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:245:in `transition_to'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:119:in `converge'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/command.rb:109:in `public_send'
E, [2014-06-12T13:06:54.909399 #105604] ERROR -- Kitchen: C:/Ruby193/lib/ruby/gems/1.9.1/gems/test-kitchen-1.2.1/lib/kitchen/command.rb:109:in `block (2 levels) in run_action'
E, [2014-06-12T13:06:54.909899 #105604] ERROR -- Kitchen: ----------------------

following is my berksfile. I verified that all the names match the names in the cookbook metadata.rb. What does this error mean and how can I fix it?

site :opscode
cookbook 'ihg-users', git: 'gitosis@r19magpredev63.hiw.com:chef-ihg-users'
cookbook 'ihg-java', git: 'gitosis@r19magpredev63.hiw.com:chef-ihg-java'
cookbook 'ihg-tcserver', git: 'gitosis@r19magpredev63.hiw.com:chef-ihg-tcserver'
cookbook 'ihg-apache2', git: 'gitosis@r19magpredev63.hiw.com:chef-ihg-apache2'
cookbook 'ihg-resolver', git: 'gitosis@r19magpredev63.hiw.com:chef-ihg-resolver'
cookbook 'ihg-zonerules', git: 'gitosis@r19magpredev63.hiw.com:chef-ihg-zonerules'
cookbook 'zonerules', git: 'gitosis@r19magpredev63.hiw.com:chef-ihg-zonerules'
cookbook 'ihg-hostsfile', git: 'gitosis@r19magpredev63.hiw.com:chef-ihg-hostsfile'
cookbook 'ihg-appdynamics', git: 'gitosis@r19magpredev63.hiw.com:chef-ihg-appdynamics'
sethvargo commented 10 years ago

@dmanchikalapudi that means that one of those cookbooks has a name attribute that does not match they entry in your Berksfile.

cookbook 'foo'

Needs to map to a metadata entry with:

name 'foo'

It looks like you are prefixing things with ihg, but zonerules is not. That could be the issue. You may also want to empty your ~/.berkshelf directory in case there is something stale in the cache.

Also, please note that using SCM locations is highly discouraged and not supported. It is near impossible to resolve dependencies for an SCM graph like this one.

dmanchikalapudi commented 10 years ago

Thanks for your prompt reply Seth. Is there a way to turn this validation off? This seems to be working just fine with some of the older versions of berkshelf .. I am using 2.0.17 without any issue with the exact berksfile. BTW, I checked inside the cookbook for zonerules and it is named 'zonerules'

name             'zonerules'
maintainer       'YOUR_COMPANY_NAME'
maintainer_email 'YOUR_EMAIL'
license          'All rights reserved'
description      'Installs/Configures zonerules'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          '1.0.0'

I have checked all other cookbooks as well. the name attribute matches exactly as defined in the berksfile.

sethvargo commented 10 years ago

There is no way to turn it off. What about dependencies or other cookbooks in the shelf? If you just run Berkshelf (instead of vagrant-berkshelf), you might get more verbose output from the error.

dmanchikalapudi commented 10 years ago

Thanks Seth. Turns out that the name and version of the cookbook changed.... the new metadata looks like the following.

name             'ihg-zonerules'
maintainer       'IHG'
maintainer_email 'mike.rich@ihg.com'
license          'All rights reserved'
description      'Installs/Configures zonerules'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          '1.0.1'

After changing the name to ihg-zonerules, I get the following error:

E, [2014-06-16T15:57:01.110827 #57988] ERROR -- Kitchen:
----------------------
I, [2014-06-16T16:30:22.411047 #58392]  INFO -- Kitchen: -----> Starting
Kitchen (v1.2.1)
I, [2014-06-16T16:30:25.796047 #58392]  INFO -- Kitchen: -----> Converging
<default-centos-59>...
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
------Exception-------
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen: Class:
Kitchen::ActionFailed
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen: Message: Failed to
complete #converge action: [SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed]
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen: ---Nested
Exception---
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen: Class:
Faraday::SSLError
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen: Message:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B:
certificate verify failed
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
------Backtrace-------
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:800:in `connect'
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:800:in `block in connect'
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/1.9.1/timeout.rb:69:in `timeout'
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/1.9.1/timeout.rb:100:in `timeout'
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:800:in `connect'
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:756:in `do_start'
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:745:in `start'
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1285:in `request'
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1027:in `get'
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/faraday-0.9.0/lib/faraday/adapter/net_http.rb:78:in
`perform_request'
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/faraday-0.9.0/lib/faraday/adapter/net_http.rb:39:in
`call'
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/faraday-0.9.0/lib/faraday/request/retry.rb:87:in
`call'
E, [2014-06-16T16:32:14.318047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/faraday-0.9.0/lib/faraday/response.rb:8:in
`call'
E, [2014-06-16T16:32:14.319047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/faraday-0.9.0/lib/faraday/response.rb:8:in
`call'
E, [2014-06-16T16:32:14.319047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/faraday-0.9.0/lib/faraday/rack_builder.rb:139:in
`build_response'
E, [2014-06-16T16:32:14.319047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/faraday-0.9.0/lib/faraday/connection.rb:377:in
`run_request'
E, [2014-06-16T16:32:14.319047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/faraday-0.9.0/lib/faraday/connection.rb:140:in
`get'
E, [2014-06-16T16:32:14.319047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-api-client-1.2.0/lib/berkshelf/api_client/connection.rb:62:in
`universe'
E, [2014-06-16T16:32:14.319047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-3.1.3/lib/berkshelf/source.rb:22:in
`build_universe'
E, [2014-06-16T16:32:14.319047 #58392] ERROR -- Kitchen:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:21:in
`block (2 levels) in build_universe'

I dont know if this is a berkshelf issue, but I saw this post from Sean Carolan:

https://gist.github.com/scarolan/791f1e390778a84b63d2

He suggests turning off the ssl verification. Is this a work around? what is the suggested fix for this issue?

sethvargo commented 10 years ago

@dmanchikalapudi please open a new issue