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

Undefined method 'path' for nil:NilClass #39

chef09210 opened this Issue May 4, 2016 · 2 comments


None yet
2 participants

chef09210 commented May 4, 2016

Cookbook version


Chef-client version


Platform Details

Windows 7 Enterprise


Trying to run audit cookbook on node.

Steps to Reproduce:

Execute a remote chef-client call using knife windows winrm that has the audit cookbook in the node's runlist

Expected Result:

INFO: Processing compliance_profile[windows] action fetch (audit::default line 28)
WARN: Using inspec version: (0.19.3)
INFO: Fetch compliance profile base/windows
INFO: Processing directory[c:/chef/cache/compliance] action create (c:/chef/cache/cookbooks/audit/libraries/profile.rb line 40)
INFO: Processing directory[c:/chef/cache/compliance] action create (c:/chef/cache/cookbooks/audit/libraries/profile.rb line 40)
INFO: Processing compliance_profile[windows] action execute (audit::default line 28)
WARN: Using inspec version: (0.19.3)
INFO: Execute compliance profile base/windows

Actual Result:

    [Error executing action `fetch` on resource 'compliance_profile[windows]'   

undefined method `path' for nil:NilClass    

    Cookbook Trace: 
c:/chef/cache/cookbooks/audit/libraries/profile.rb:71:in `block (2 levels) in <class:ComplianceProfile>'
    c:/chef/cache/cookbooks/audit/libraries/profile.rb:35:in `block in <class:ComplianceProfile>'   

    Resource Declaration:   
# In c:/chef/cache/cookbooks/audit/recipes/default.rb

     28:   compliance_profile p do
     29:     owner o
     30:     server server
     31:     token token
     32:     inspec_version node['audit']['inspec_version']
     33:     action [:fetch, :execute]
     34:   end
     35: end

    Compiled Resource:  
# Declared in c:/chef/cache/cookbooks/audit/recipes/default.rb:28:in `block in from_file'

    compliance_profile("windows") do
      action [:fetch, :execute]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :compliance_profile
      cookbook_name "audit"
      recipe_name "default"
      owner "base"
      inspec_version "latest"
      profile "windows"



This comment has been minimized.


alexpop commented May 5, 2016

Thanks for the bug report. I see you are using audit 0.5.0. I believe this issue has been fixed in this PR:

Please give audit 0.6.0 a try and let us know if you are still having issues. Cheers!


This comment has been minimized.

chef09210 commented May 5, 2016

Hi alex,

That fixed the error message from appearing in the Chef log, but the underlying issue was due to a time synchronization issue. Thanks for the response.

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