Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mkingsbury opened this issue Apr 13, 2017 · 0 comments

Comments

@mkingsbury
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant