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

reporter: chef-compliance fails with error "ArgumentError: wrong number of arguments (given 2, expected 1)>" #232

Closed
qubitrenegade opened this issue Jun 7, 2017 · 0 comments

Comments

@qubitrenegade
Copy link

Cookbook version

v4.0.0

Chef-client version

12.20.3

Platform Details

CentOS: 6.5 and 7.2
Inspec: 1.27.0

Scenario:

Attempting to use chef-compliance reporter.

Steps to Reproduce:

  • Set attributes:
{
  "audit": {
    "quiet": false,
    "reporter": [
      "chef-compliance"
    ],
    "server": "https://chef-compliance.lab.com/api",
    "refresh_token": "35/GpFMfdasfdjakfldajsfkldasjfdakls;fjdaskl;fjdsakl==",
    "insecure": true,
    "owner": "lab",
    "profiles": [
      {
        "name": "linux",
        "compliance": "base/linux"
      }
    ]
  }
}
  • Set run list as recipe[audit::default]

Expected Result:

Compliance profile should run and report directly to Chef Compliance.

Actual Result:

Receive an error: Report handler Chef::Handler::AuditReport raised #<ArgumentError: wrong number of arguments (given 2, expected 1)>

Running handlers:
[2017-06-07T12:48:00-06:00] INFO: Running report handlers
[2017-06-07T12:48:01-06:00] ERROR: Report handler Chef::Handler::AuditReport raised #<ArgumentError: wrong number of arguments (given 2, expected 1)>
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.27.0/lib/bundles/inspec-compliance/api.rb:64:in `version'
[2017-06-07T12:48:01-06:00] ERROR: /var/chef/cache/cookbooks/audit/libraries/compliance.rb:57:in `login_to_compliance'
[2017-06-07T12:48:01-06:00] ERROR: /var/chef/cache/cookbooks/audit/files/default/handler/audit_report.rb:45:in `report'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/handler.rb:259:in `run_report_unsafe'
[2017-06-07T12:48:01-06:00] ERROR: /var/chef/cache/cookbooks/audit/files/default/handler/audit_report.rb:75:in `run_report_safely'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/handler.rb:125:in `block in run_report_handlers'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/handler.rb:123:in `each'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/handler.rb:123:in `run_report_handlers'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/handler.rb:135:in `block in <class:Handler>'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/client.rb:443:in `block in run_completed_successfully'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/client.rb:442:in `each'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/client.rb:442:in `run_completed_successfully'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/client.rb:301:in `run'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/application.rb:295:in `block in fork_chef_client'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/application.rb:283:in `fork'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/application.rb:283:in `fork_chef_client'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/application.rb:248:in `block in run_chef_client'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/local_mode.rb:44:in `with_server_connectivity'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/application.rb:236:in `run_chef_client'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/application/client.rb:450:in `loop'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/application/client.rb:450:in `interval_run_chef_client'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/application/client.rb:434:in `run_application'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/lib/chef/application.rb:59:in `run'
[2017-06-07T12:48:01-06:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3/bin/chef-client:26:in `<top (required)>'
[2017-06-07T12:48:01-06:00] ERROR: /usr/bin/chef-client:57:in `load'
[2017-06-07T12:48:01-06:00] ERROR: /usr/bin/chef-client:57:in `<main>'
  - Chef::Handler::AuditReport
Running handlers complete
[2017-06-07T12:48:01-06:00] INFO: Report handlers complete
Chef Client finished, 0/2 resources updated in 03 seconds
[2017-06-07T12:48:01-06:00] INFO: Sending resource update report (run-id: 3b13399f-dbdb-42d3-be1c-96c8b6a7b8c0)

This points to line 57 of libraries/compliance.rb, which the new version of inspec Compliance::API does not support anymore. inspec v1.24.0 appears to be the last version of this library to support this.

qubitrenegade added a commit to qubitrenegade/audit that referenced this issue Jun 7, 2017
…on in metadata. Fixes chef-boneyard#232

Signed-off-by: qubitrenegade <qubitrenegade@gmail.com>
@qubitrenegade qubitrenegade changed the title chef-compliance reporter fails with message "Chef::Handler::AuditReport raised #<ArgumentError: wrong number of arguments (given 2, expected 1)>" reporter: chef-compliance fails with error "ArgumentError: wrong number of arguments (given 2, expected 1)>" Jun 7, 2017
chris-rock pushed a commit that referenced this issue Jun 29, 2017
…on in metadata. Fixes #232

Signed-off-by: qubitrenegade <qubitrenegade@gmail.com>
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