Question

I wanted to use test-kitchen to deploy ubuntu with java and hadoop cookbook. I had installed 1 suite up with the test-kitchen.

I put in another suite in the kitchen config file and now kitchen is broken.

I put undid the changes to my kitchen config file but kitchen is still broken.

When I do a

  kitchen list

I get the following error

/home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/test-kitchen-1.2.1/lib/kitchen/instance.rb:209:in `last_action': undefined method `[]' for false:FalseClass (NoMethodError)
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/test-kitchen-1.2.1/lib/kitchen/command/list.rb:53:in `display_instance'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/test-kitchen-1.2.1/lib/kitchen/command/list.rb:73:in `block in list_table'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/test-kitchen-1.2.1/lib/kitchen/command/list.rb:73:in `map'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/test-kitchen-1.2.1/lib/kitchen/command/list.rb:73:in `list_table'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/test-kitchen-1.2.1/lib/kitchen/command/list.rb:38:in `call'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/test-kitchen-1.2.1/lib/kitchen/cli.rb:47:in `perform'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/test-kitchen-1.2.1/lib/kitchen/cli.rb:81:in `list'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/test-kitchen-1.2.1/lib/kitchen/cli.rb:233:in `invoke_task'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/test-kitchen-1.2.1/bin/kitchen:13:in `block in <top (required)>'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/test-kitchen-1.2.1/lib/kitchen/errors.rb:81:in `with_friendly_errors'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/gems/test-kitchen-1.2.1/bin/kitchen:13:in `<top (required)>'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/bin/kitchen:23:in `load'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/bin/kitchen:23:in `<main>'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/bin/ruby_executable_hooks:15:in `eval'
from /home/anupam/.rvm/gems/ruby-2.0.0-p451@chef/bin/ruby_executable_hooks:15:in `<main>'

And I don't know what of make of the error message.

I get get the similar error message when I try to create/destroy/converge/login also.


EDIT: Adding .kitchen.yml

driver:
 name: vagrant

provisioner:
  name: chef_solo

platforms:
  - name: ubuntu-12.04
    driver_config:
      network:
      - ["private_network", {ip: "192.168.56.103"}]
      customize:
        memory: 512
  # - name: centos-6.4
  # - name: centos-6.4-i386
  #   # driver_config:
  #   #   network:
  #   #   - ["private_network", {ip: "192.168.56.103"}]
  #   #   customize:
  #   #     memory: 512
  # - name: fedora-20-i386

suites:
  - name: default
    run_list:
      - recipe[odin-solr::default]
    attributes:
  # - name: default-2
  #   run_list:
  #     - recipe[odin-solr::default]
  #   attributes:
Was it helpful?

Solution

You have an unfinished YAML key from your commenting:

# <snip>
suites:
  - name: default
    run_list:
      - recipe[odin-solr::default]
    attributes: # <== here
  # - name: default-2
  #   run_list:
  #     - recipe[odin-solr::default]
  #   attributes:

OTHER TIPS

This error stems from the kitchen list choking on bad YAML. It can happen in the .kitchen.yml or in the .kitchen/*.yml files (which are used to store the state of VM's in the .kitchen file). Possible fixes:

  1. Make sure you don't have any dangling hash keys like following in either of these locations

    run_list:
      - recipe[thing::default]       
    attributes: 
      # having no keys here is invalid.
    
  2. Remove the .kitchen/*.yml files. Running kitchen list again will rebuild them (without necessarily reprovisioning the machines)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top