Fails integration chef-server - chef-compliance (I suspect chef_gate)


#1

Hi,
first, sorry for my english I speak spanish!!:speak_no_evil:
I hope someone can help me!!:grinning::grinning:
Perform a clean chef-server and chef-compliance installation for testing.
Integrate w / chef-server following the link documentation. link.
I was able to login to the chef-compliance with the chef-server credentials using oAuth2.
But I can not use the audit cookbook because it fails.

Chef Server Version: 12.16.14
Chef Compliance: 1.11.6 / 1.11.10 (test both)
Chef Gate : 1.11.6 / 1.11.10

Detect the following errors in the Logs.

chef-compliance: /var/log/chef-compliance/core/current

2017-10-19_14:35:25.45092 14:35:25.450 ERR => DB error: sql: no rows in result set 
2017-10-19_14:35:25.45750 [GIN] 2017/10/19 - 14:35:25 | 200 |   27.199655ms | 192.168.176.175 |   GET     /owners/4621c523-7226-4418-823d-637e084d7b14/jobs
2017-10-19_14:35:27.46448 14:35:27.464 ERR => Could not retrieve Chef Server organizations. Please check chef-gate configuration. 
2017-10-19_14:35:27.46463 14:35:27.464 DEB => Authenticated user: &{PasswordHash: Login:lmariani Name:lmariani IsOrg:false Source:{String: Valid:false} UUID:{ID:4621c523-7226-4418-823d-637e084d7b14}} 

chef-server: /var/log/opscode/chef_gate/current

2017-10-19_14:35:16.77675 2017/10/19 11:35:16 Panic recovery -> runtime error: invalid memory address or nil pointer dereference
2017-10-19_14:35:16.77681 /opt/chef-compliance/embedded/lib/go/src/runtime/panic.go:489 (0x42a71f)
2017-10-19_14:35:16.77682 /opt/chef-compliance/embedded/lib/go/src/runtime/panic.go:63 (0x4295ce)
2017-10-19_14:35:16.77685 /opt/chef-compliance/embedded/lib/go/src/runtime/signal_unix.go:290 (0x43f55f)
2017-10-19_14:35:16.77685 /var/cache/omnibus/cache/go-workspace/src/github.com/chef/chef-compliance/chef-gate/oidc/oidc.go:247 (0x81b708)
2017-10-19_14:35:16.77686 /var/cache/omnibus/cache/go-workspace/src/github.com/chef/chef-compliance/chef-gate/oidc/oidc.go:211 (0x81b415)
2017-10-19_14:35:16.77686 /var/cache/omnibus/cache/go-workspace/src/github.com/chef/chef-compliance/chef-gate/oidc/oidc.go:138 (0x81c363)
2017-10-19_14:35:16.77686 /var/cache/omnibus/cache/go-workspace/src/github.com/gin-gonic/gin/context.go:90 (0x76a7ba)
2017-10-19_14:35:16.77687 /var/cache/omnibus/cache/go-workspace/src/github.com/gin-gonic/gin/logger.go:56 (0x777feb)
2017-10-19_14:35:16.77687 /var/cache/omnibus/cache/go-workspace/src/github.com/gin-gonic/gin/context.go:90 (0x76a7ba)
2017-10-19_14:35:16.77687 /var/cache/omnibus/cache/go-workspace/src/github.com/gin-gonic/gin/recovery.go:43 (0x778b8a)
2017-10-19_14:35:16.77689 /var/cache/omnibus/cache/go-workspace/src/github.com/gin-gonic/gin/context.go:90 (0x76a7ba)
2017-10-19_14:35:16.77689 /var/cache/omnibus/cache/go-workspace/src/github.com/gin-gonic/gin/gin.go:283 (0x770010)
2017-10-19_14:35:16.77690 /var/cache/omnibus/cache/go-workspace/src/github.com/gin-gonic/gin/gin.go:264 (0x76f92b)
2017-10-19_14:35:16.77690 /var/cache/omnibus/src/core/chef-gate/main.go:36 (0x81c74b)
2017-10-19_14:35:16.77690 <autogenerated>:1 (0x81dd56)
2017-10-19_14:35:16.77691 /opt/chef-compliance/embedded/lib/go/src/net/http/server.go:2568 (0x674d22)
2017-10-19_14:35:16.77691 /opt/chef-compliance/embedded/lib/go/src/net/http/server.go:1825 (0x670f32)
2017-10-19_14:35:16.77691 /opt/chef-compliance/embedded/lib/go/src/runtime/asm_amd64.s:2197 (0x456711)

and on the nodes with the cookbook audit:

[2017-10-18T18:28:42-03:00] ERROR: 403 "Forbidden" (Net::HTTPServerException)
/opt/chef/embedded/lib/ruby/2.4.0/net/http/response.rb:122:in `error!'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/http.rb:239:in `streaming_request'
/var/chef/cache/cookbooks/audit/files/default/vendor/chef-server/fetcher.rb:90:in `block in download_archive_to_temp'
/var/chef/cache/cookbooks/audit/libraries/helper.rb:45:in `with_http_rescue'
/var/chef/cache/cookbooks/audit/files/default/vendor/chef-server/fetcher.rb:89:in `download_archive_to_temp'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.25.1/lib/fetchers/url.rb:120:in `temp_archive_path'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.25.1/lib/fetchers/url.rb:103:in `sha256'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.25.1/lib/fetchers/url.rb:93:in `cache_key'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.25.1/lib/inspec/cached_fetcher.rb:32:in `cache_key'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.25.1/lib/inspec/cached_fetcher.rb:39:in `fetch'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.25.1/lib/inspec/profile.rb:71:in `for_fetcher'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.25.1/lib/inspec/profile.rb:78:in `for_target'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/inspec-1.25.1/lib/inspec/runner.rb:169:in `add_target'
/var/chef/cache/cookbooks/audit/files/default/handler/audit_report.rb:145:in `block in call'
/var/chef/cache/cookbooks/audit/files/default/handler/audit_report.rb:145:in `each'
/var/chef/cache/cookbooks/audit/files/default/handler/audit_report.rb:145:in `call'
/var/chef/cache/cookbooks/audit/files/default/handler/audit_report.rb:63:in `report'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/handler.rb:259:in `run_report_unsafe'
/var/chef/cache/cookbooks/audit/files/default/handler/audit_report.rb:81:in `run_report_safely'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/handler.rb:125:in `block in run_report_handlers'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/handler.rb:123:in `each'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/handler.rb:123:in `run_report_handlers'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/handler.rb:135:in `block in <class:Handler>'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/client.rb:443:in `block in run_completed_successfully'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/client.rb:442:in `each'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/client.rb:442:in `run_completed_successfully'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/client.rb:301:in `run'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application.rb:291:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application.rb:279:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application.rb:279:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application.rb:244:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application.rb:232:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application/client.rb:469:in `sleep_then_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application/client.rb:458:in `block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application/client.rb:457:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application/client.rb:457:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application/client.rb:441:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/lib/chef/application.rb:59:in `run'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3/bin/chef-client:26:in `<top (required)>'

Best Regards.


#2

Hello,

I was getting same error with the version of chef-compliance. troubleshooted for 3 days. then later tried with older version of chef-compliance(1.7.7) it worked fine for me.!!