blueboxgroup / kitchen-bluebox

Test Kitchen Driver for Blue Box Blocks API
2 stars 4 forks source link

need better feedback when a cookbook is missing #3

Closed scoop206 closed 10 years ago

scoop206 commented 11 years ago

It is not obvious that a cookbook is missing

The failure you see in kitchen-vagrant when a cookbook is missing:

[Berkshelf] Using build-essential (1.2.0) [Berkshelf] Using windows (1.7.0) [Berkshelf] Using chef_handler (1.1.4) [Berkshelf] Using logrotate (1.0.2)[Berkshelf] Using ark (0.1.0) [Berkshelf] Using bluepill (2.2.0) [Berkshelf] Using rsyslog (1.5.0) [Berkshelf] Using ohai (1.1.6) [Berkshelf] Using openssl (1.0.0) STDERR: Berkshelf::CookbookNotFound: Cookbook 'bluebox' not found in any of the default locations ---- End output of vagrant up --no-provision ---- Ran vagrant up --no-provision returned 1] from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:277:in action' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:249:inperform_action' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:228:in create_action' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:222:inblock in transition_to' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:221:in each' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:221:intransition_to' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:143:in verify' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:172:inblock in test' from /Users/scooper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/benchmark.rb:280:in measure' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:168:intest' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:in public_send' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:inblock in run_serial' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:in map' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:inrun_serial' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:110:in block in test' from /Users/scooper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/benchmark.rb:280:inmeasure' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:102:in test' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:inrun' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in invoke_task' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:229:ininvoke_task' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor.rb:275:in dispatch' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:instart' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/bin/kitchen:12:in <top (required)>' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bin/kitchen:23:inload' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bin/kitchen:23:in `

'

The failure you see in kitchen-bluebox when a cookbook is missing:

[06:06:33 dhcp121:~/git_repos/cookbooks/squash][master*] $ be kitchen test -----> Starting Kitchen -----> Cleaning up any prior instances of -----> Destroying DEBUG: test Finished destroying (0m0.00s). -----> Testing -----> Creating DEBUG: state is {} Blocks instance created. ............................. (server ready) (ssh ready)

   DEBUG: test
   Finished creating <default-scientific-63> (0m55.11s).

-----> Converging -----> Installing Chef Omnibus (10.22) Downloading Chef for el... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 14.4M 100 14.4M 0 0 1251k 0 0:00:11 0:00:11 --:--:-- 1616k Installing Chef warning: /tmp/tmp.fezZMoA1/chef-.x8664.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY Preparing... ##### ########################################### [100%] 1:chef ########################################### [100%] Thank you for installing Chef! [local command] BEGIN (if ! command -v berks >/dev/null; then exit 1; fi) [local command] END (0m0.01s) [local command] BEGIN (berks install --path /var/folders/b/xydcbx6n5v95btgc5j_wp7qr0000gn/T/default-scientific-63-cookbooks20130401-92307-ecdubr) Using squash (0.1.0) at path: '/Users/scooper/git_repos/cookbooks/squash' Using yum (2.1.0) Using apt (1.8.4) Using git (2.1.2) Installing java (1.10.0) from git: 'git://github.com/opscode-cookbooks/java.git' with branch: 'c9fe9875b2e4f764847070972b5a2559b1d72cd3' Installing jboss (0.0.13) from git: 'git://github.com/sandfish8/chef-jboss.git' with branch: 'bluebox' Installing maven (0.15.0) from git: 'git://github.com/bbg-cookbooks/maven.git' with branch: '23b2e9393fd9ba3f505565a761292c58344177dd' Installing ruby_build (0.7.2) from git: 'git://github.com/fnichol/chef-ruby_build.git' with branch: 'c940b5e9cd40eaba10d6285de6648f4d25fe959d' Installing rbenv (0.7.3) from git: 'git://github.com/fnichol/chef-rbenv.git' with branch: '3b1c59abc1134a50b0b8844954eca9a566aaffb8' Installing nginx (1.1.2) from git: 'git://github.com/bbg-cookbooks/nginx.git' with branch: 'bluebox' Using unicorn (1.1.0) Installing postgresql (2.2.2) from git: 'git://github.com/opscode-cookbooks/postgresql.git' with branch: '1dfa582a9b844c3cbe6019a3ddb831af004dce52' Installing bbg_repositories (0.1.1) from git: 'git@github.blueboxgrid.com:chef/bbg_repositories.git' with branch: '565973bfd289bf65b573f5be7efaccbc3adbd0b0' Installing user (0.3.0) from site: 'http://cookbooks.opscode.com/api/v1/cookbooks' Using dmg (1.0.0) Using runit (0.15.0) Using build-essential (1.2.0) Using windows (1.7.0) Using chef_handler (1.1.4) Using logrotate (1.0.2) Using ark (0.1.0) Using bluepill (2.2.0) Using rsyslog (1.5.0) Using ohai (1.1.6) Using openssl (1.0.0) [local command] END (0m35.89s) /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:274:in rescue in action': Failed to complete #converge action: [can't convert nil into String] (Kitchen::ActionFailed) from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:277:inaction' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:249:in perform_action' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:232:inconverge_action' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:222:in block in transition_to' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:221:ineach' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:221:in transition_to' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:143:inverify' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:172:in block in test' from /Users/scooper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/benchmark.rb:280:inmeasure' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/instance.rb:168:in test' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:inpublic_send' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:in block in run_serial' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:inmap' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:255:in run_serial' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:110:inblock in test' from /Users/scooper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/benchmark.rb:280:in measure' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:102:intest' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in run' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:ininvoke_task' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/lib/kitchen/cli.rb:229:in invoke_task' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor.rb:275:indispatch' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in start' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bundler/gems/test-kitchen-5fe88947b6a6/bin/kitchen:12:in<top (required)>' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bin/kitchen:23:in load' from /Users/scooper/.rvm/gems/ruby-1.9.3-p286/bin/kitchen:23:in

'

bbg-deploy commented 10 years ago

is this actually a kitchen-bluebox problem?

scoop206 commented 10 years ago

I assume it is since kitchen-vagrant handles it gracefully.

nathwill commented 10 years ago

woops, posted under the wrong account before >__<

so the reason i was asking is that we only do the Blocks API calls, and don't make any of the converge or berkshelf calls in the driver, so I was kind of confused about where we could be doing something wrong.

After running this through a quick test (see below), I think the issue was likely that we were depending on an older version of test-kitchen. at this point, this issue seems to be resolved.

[nathwill@wyrd chef-monit]$ kitchen destroy
-----> Starting Kitchen (v1.1.2.dev)
-----> Destroying <monit-default-ubuntu-1204>...
       Blocks instance <d3ddbd82-2305-4a3e-a929-a854a3696b4a> destroyed.
       Finished destroying <monit-default-ubuntu-1204> (0m0.68s).
-----> Destroying <monit-default-centos-65>...
       Finished destroying <monit-default-centos-65> (0m0.00s).
-----> Destroying <monit-source-ubuntu-1204>...
       Finished destroying <monit-source-ubuntu-1204> (0m0.00s).
-----> Destroying <monit-source-centos-65>...
       Finished destroying <monit-source-centos-65> (0m0.00s).
-----> Kitchen is finished. (0m1.18s)
[nathwill@wyrd chef-monit]$ kitchen create monit-default-ubuntu && kitchen converge monit-default-ubuntu
-----> Starting Kitchen (v1.1.2.dev)
-----> Creating <monit-default-ubuntu-1204>...
       Blocks instance <27497e3e-edb0-4829-b112-5ea0f5db1a47> created.
.............................................       (server ready)
       (ssh ready)

       Finished creating <monit-default-ubuntu-1204> (1m21.54s).
-----> Kitchen is finished. (1m22.03s)
-----> Starting Kitchen (v1.1.2.dev)
-----> Converging <monit-default-ubuntu-1204>...
       Preparing files for transfer
       Resolving cookbook dependencies with Berkshelf...
       Removing non-cookbook files before transfer
-----> Installing Chef Omnibus (true)
       downloading https://www.getchef.com/chef/install.sh
         to file /tmp/install.sh
       trying curl...
         % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 13347  100 13347    0     0  34280      0 --:--:-- --:--:-- --:--:-- 62957       
       Downloading Chef  for ubuntu...
       downloading https://www.getchef.com/chef/metadata?v=&prerelease=false&p=ubuntu&pv=12.04&m=x86_64
         to file /tmp/install.sh.438/metadata.txt
       trying curl...
       url  https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef_11.8.2-1.ubuntu.12.04_amd64.deb
       md5  3d3b3662830a44eeec71aadc098a4018
       sha256   a5b00a24e68e29a01c7ab9de5cdaf0cc9fd1c889599ad9af70293e5b4de8615c
       downloaded metadata file looks valid...
       downloading https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef_11.8.2-1.ubuntu.12.04_amd64.deb
         to file /tmp/install.sh.438/chef_11.8.2-1.ubuntu.12.04_amd64.deb
       trying curl...
       Checksum compare with sha256sum succeeded.
       Installing Chef 
       installing with dpkg...
       Selecting previously unselected package chef.
       (Reading database ... 
(Reading database ... 10618 files and directories currently installed.)
       Unpacking chef (from .../chef_11.8.2-1.ubuntu.12.04_amd64.deb) ...
       Setting up chef (11.8.2-1.ubuntu.12.04) ...
       Thank you for installing Chef!
       Transfering files to <monit-default-ubuntu-1204>
       [2014-02-06T04:14:38+00:00] INFO: Forking chef instance to converge...
       Starting Chef Client, version 11.8.2
       [2014-02-06T04:14:38+00:00] INFO: *** Chef 11.8.2 ***
       [2014-02-06T04:14:38+00:00] INFO: Chef-client pid: 532
       [2014-02-06T04:14:39+00:00] INFO: Setting the run_list to ["recipe[setup]", "recipe[monit::default]", "recipe[monit::sshd]"] from JSON
       [2014-02-06T04:14:39+00:00] INFO: Run List is [recipe[setup], recipe[monit::default], recipe[monit::sshd]]
       [2014-02-06T04:14:39+00:00] INFO: Run List expands to [setup, monit::default, monit::sshd]
       [2014-02-06T04:14:39+00:00] INFO: Starting Chef Run for monit-default-ubuntu-1204
       [2014-02-06T04:14:39+00:00] INFO: Running start handlers
       [2014-02-06T04:14:39+00:00] INFO: Start handlers complete.
       Compiling Cookbooks...
       [2014-02-06T04:14:39+00:00] ERROR: Running exception handlers
       [2014-02-06T04:14:39+00:00] ERROR: Exception handlers complete
       [2014-02-06T04:14:39+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       Chef Client failed. 0 resources updated
       [2014-02-06T04:14:39+00:00] ERROR: Cookbook setup not found. If you're loading setup from another cookbook, make sure you configure the dependency in your metadata
       [2014-02-06T04:14:39+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> Converge failed on instance <monit-default-ubuntu-1204>.
>>>>>> Please see .kitchen/logs/monit-default-ubuntu-1204.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sudo chef-solo --config /tmp/kitchen/solo.rb --json-attributes /tmp/kitchen/dna.json  --log_level info]
>>>>>> ----------------------
scoop206 commented 10 years ago

thanks!