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

Undefined method 'path' for nil:NilClass #39

Closed
chef09210 opened this issue May 4, 2016 · 2 comments
Closed

Undefined method 'path' for nil:NilClass #39

chef09210 opened this issue May 4, 2016 · 2 comments

Comments

@chef09210
Copy link

chef09210 commented May 4, 2016

Cookbook version

0.5.0

Chef-client version

12.9.38-1

Platform Details

Windows 7 Enterprise

Scenario:

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

https://gist.github.com/chef09210/c8b116b747e340e5ba6afbe81d4adb62

Actual Result:

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

    NoMethodError   
-------------   
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"
    end

    Platform:   
---------   
x64-mingw32

https://gist.github.com/chef09210/77b1e9d23118bf06864b3bbb8a88eb50

@alexpop
Copy link
Contributor

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:
https://github.com/chef-cookbooks/audit/pull/35/files

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

@chef09210
Copy link
Author

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
Labels
None yet
Development

No branches or pull requests

2 participants