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

Data Collector requires token to log to a file #8156

Open
lamont-granquist opened this Issue Jan 23, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@lamont-granquist
Copy link
Contributor

lamont-granquist commented Jan 23, 2019

It logs that it needs a token then throws trying to setup an http client:

[2019-01-23T11:12:20-08:00] TRACE: Data collector token must be configured to use Chef Automate data collector with Chef Solo
[2019-01-23T11:12:20-08:00] TRACE: Re-raising exception: URI::InvalidURIError - bad URI(is not URI?):
/Users/lamont/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/uri/rfc3986_parser.rb:18:in `rescue in split'
  /Users/lamont/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/uri/rfc3986_parser.rb:15:in `split'
  /Users/lamont/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/uri/rfc3986_parser.rb:73:in `parse'
  /Users/lamont/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/uri/common.rb:237:in `parse'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/http.rb:492:in `chef_zero_uri?'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/server_api.rb:38:in `initialize'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/data_collector.rb:298:in `new'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/data_collector.rb:298:in `setup_http_client'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/data_collector.rb:119:in `initialize'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/client.rb:1029:in `new'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/client.rb:1029:in `register_data_collector_reporter'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/client.rb:265:in `run'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/application.rb:303:in `run_with_graceful_exit_option'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/application.rb:279:in `block in run_chef_client'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/local_mode.rb:44:in `with_server_connectivity'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/application.rb:261:in `run_chef_client'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/application/client.rb:440:in `run_application'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/lib/chef/application.rb:66:in `run'
  /Users/lamont/.rvm/gems/ruby-2.5.3/gems/chef-14.9.13/bin/chef-client:25:in `<top (required)>'
  /Users/lamont/.rvm/gems/ruby-2.5.3/bin/chef-client:23:in `load'
  /Users/lamont/.rvm/gems/ruby-2.5.3/bin/chef-client:23:in `<main>'
  /Users/lamont/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `eval'
  /Users/lamont/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `<main>'
Chef::Config[:data_collector][:output_locations] = { files:  [ "/Users/lamont/data_collector.out" ] }
#Chef::Config[:data_collector][:token] = "foo"

uncommenting the token line there makes it work.

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