{"action":"opened","issue":{"url":"https://api.github.com/repos/chef-cookbooks/audit/issues/34","repository_url":"https://api.github.com/repos/chef-cookbooks/audit","labels_url":"https://api.github.com/repos/chef-cookbooks/audit/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/chef-cookbooks/audit/issues/34/comments","events_url":"https://api.github.com/repos/chef-cookbooks/audit/issues/34/events","html_url":"https://github.com/chef-cookbooks/audit/issues/34","id":151203416,"number":34,"title":"chef-client audit-mode exception when the audit cookbook is used","user":{"login":"alexpop","id":107378,"avatar_url":"https://avatars.githubusercontent.com/u/107378?v=3","gravatar_id":"","url":"https://api.github.com/users/alexpop","html_url":"https://github.com/alexpop","followers_url":"https://api.github.com/users/alexpop/followers","following_url":"https://api.github.com/users/alexpop/following{/other_user}","gists_url":"https://api.github.com/users/alexpop/gists{/gist_id}","starred_url":"https://api.github.com/users/alexpop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexpop/subscriptions","organizations_url":"https://api.github.com/users/alexpop/orgs","repos_url":"https://api.github.com/users/alexpop/repos","events_url":"https://api.github.com/users/alexpop/events{/privacy}","received_events_url":"https://api.github.com/users/alexpop/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chef-cookbooks/audit/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-26T18:16:25Z","updated_at":"2016-04-26T18:16:25Z","closed_at":null,"body":"### Cookbook version\r\naudit 0.5.0\r\n\r\n### Chef-client version\r\n12.5.1, 12.9.38\r\n\r\n### Platform Details\r\nCentOS 6\r\n\r\n### Steps to Reproduce:\r\n\r\nRun chef-client in audit mode with the `audit::default` in the runlist. The failure is not impacting in any way the chef-client run.\r\n\r\n```\r\n[root@vagrant-local-linux ~]# chef-client --audit-mode enabled\r\nStarting Chef Client, version 12.5.1\r\nresolving cookbooks for run list: [\"audit::default\"]\r\nSynchronizing Cookbooks:\r\n  - audit (0.5.0)\r\nCompiling Cookbooks...\r\nConverging 2 resources\r\nRecipe: audit::default\r\n  * compliance_profile[mylinux] action fetch\r\n    * chef_gem[inspec] action install (up to date)\r\n[2016-04-26T18:13:30+00:00] WARN: Using inspec version: (0.19.3)\r\n    - install/update inspec\r\n    * directory[/var/chef/cache/compliance] action create (up to date)\r\n    - fetch compliance profile\r\n    * chef_gem[inspec] action install (up to date)\r\n    * directory[/var/chef/cache/compliance] action create (up to date)\r\n\r\n  * compliance_profile[mylinux] action execute\r\n    * chef_gem[inspec] action install (up to date)\r\n[2016-04-26T18:13:30+00:00] WARN: Using inspec version: (0.19.3)\r\n    - install/update inspec..F\r\n\r\nFailures:\r\n\r\n  1) Service iptables should be running\r\n     Failure/Error: Unable to find admin/mylinux/controls/services_spec.rb to read failed line\r\n       expected that `Service iptables` is running\r\n     # admin/mylinux/controls/services_spec.rb:12:in `block (3 levels) in load'\r\n     # /var/chef/cache/cookbooks/audit/libraries/profile.rb:112:in `block (2 levels) in <class:ComplianceProfile>'\r\n     # /var/chef/cache/cookbooks/audit/libraries/profile.rb:93:in `block in <class:ComplianceProfile>'\r\n\r\nFinished in 0.09885 seconds (files took 0.78511 seconds to load)\r\n3 examples, 1 failure\r\n\r\nFailed examples:\r\n\r\nrspec  # Service iptables should be running\r\n\r\n\r\n    - execute compliance profile\r\n    * chef_gem[inspec] action install (up to date)\r\n    * file[/var/chef/cache/compliance/admin_mylinux_report.json] action create\r\n      - update content in file /var/chef/cache/compliance/admin_mylinux_report.json from 6f5303 to de6456\r\n      - suppressed sensitive resource\r\n      - restore selinux security context\r\n\r\n  * compliance_report[chef-server] action execute\r\n    - report compliance profiles' results\r\nStarting audit phase\r\nRSpec's reporter has already been initialized with #<IO:<STDOUT>> as the output stream, so your change to `output_stream` will be ignored. You should configure it earlier for it to take effect. (Called from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/audit/runner.rb:120:in `set_streams')\r\n\r\n[2016-04-26T18:13:31+00:00] ERROR: Audit phase failed with error message: undefined method `split' for nil:NilClass\r\n\r\n\r\nAudit phase exception:\r\n  undefined method `split' for nil:NilClass\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/audit/audit_event_proxy.rb:63:in `build_control_from'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/audit/audit_event_proxy.rb:48:in `block in stop'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/audit/audit_event_proxy.rb:47:in `each'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/audit/audit_event_proxy.rb:47:in `stop'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:184:in `block in notify'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:183:in `each'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:183:in `notify'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:178:in `stop'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:152:in `block in finish'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:170:in `close_after'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:151:in `finish'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:79:in `report'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:113:in `run_specs'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/audit/runner.rb:189:in `do_run'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/audit/runner.rb:35:in `run'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/client.rb:721:in `run_audits'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/client.rb:276:in `run'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application.rb:270:in `block in fork_chef_client'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application.rb:258:in `fork'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application.rb:258:in `fork_chef_client'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application.rb:224:in `block in run_chef_client'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/local_mode.rb:44:in `with_server_connectivity'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application.rb:212:in `run_chef_client'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/client.rb:408:in `block in interval_run_chef_client'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/client.rb:398:in `loop'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/client.rb:398:in `interval_run_chef_client'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/client.rb:388:in `run_application'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application.rb:60:in `run'\r\n  /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/bin/chef-client:26:in `<top (required)>'\r\n  /usr/bin/chef-client:54:in `load'\r\n  /usr/bin/chef-client:54:in `<main>'\r\n\r\n  Running handlers:\r\n  Running handlers complete\r\n  Chef Client finished, 4/10 resources updated in 05 seconds\r\n[2016-04-26T18:13:31+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out\r\n[2016-04-26T18:13:31+00:00] ERROR: Found 1 errors, they are stored in the backtrace\r\n[2016-04-26T18:13:32+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)\r\n[root@vagrant-local-linux ~]#\r\n```"}}