chef-boneyard / chef-provisioning

A library for creating machines and infrastructures idempotently in Chef.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

machine_file fails with NoMethodError: undefined method `[]' for nil:NilClass

mkingsbury opened this issue · comments

Very simple attempt of provisioning a VMware VM. The VM gets created, runs a recipe. It then fails in the machine_file statement in the provisioning recipe. I'm trying to upload RPMs to the newly created VM. Sample.txt contains the provisioning recipe, chef-provision-output.txt contains the chef provision -D run. Is anyone aware of a bug in here?

  • run 'chef-client -c /etc/chef/client.rb -l info' on dev-box-1
  • machine_file[/tmp/cacheio.rpm] action upload

    ================================================================================
    Error executing action upload on resource 'machine_file[/tmp/cacheio.rpm]'

    NoMethodError

    undefined method `[]' for nil:NilClass

    Resource Declaration:

    In /Users/mkingsbury/chef-repo/cookbooks/sample/recipes/default.rb

    43: machine_file '/tmp/cacheio.rpm' do
    44: machine 'dev-box-1'
    45: local_path '/tmp/cacheio.rpm'
    46: action :upload
    47: end

    Compiled Resource:

    Declared in /Users/mkingsbury/chef-repo/cookbooks/sample/recipes/default.rb:43:in `from_file'

    machine_file("/tmp/cacheio.rpm") do
    action [:upload]
    retries 0
    retry_delay 2
    default_guard_interpreter :default
    chef_server {:chef_server_url=>"https://chef.cacheio.com/organizations/cacheio", :options=>{:client_name=>"mkingsbury", :signing_key_filename=>"/Users/mkingsbury/.chef/mkingsbury.pem", :api_version=>"0"}}
    declared_type :machine_file
    cookbook_name :sample
    recipe_name "default"
    machine "dev-box-1"
    local_path "/tmp/cacheio.rpm"
    path "/tmp/cacheio.rpm"
    end

    Platform:

    x86_64-darwin14

Error: Chef failed to converge: machine_file[/tmp/cacheio.rpm] (sample::default line 43) had an error: NoMethodError: undefined method []' for nil:NilClass Reason: (NoMethodError) machine_file[/tmp/cacheio.rpm] (sample::default line 43) had an error: NoMethodError: undefined method []' for nil:NilClass

[
chef-provision-output.txt
](url)

sample.txt