chef / chef-workstation

Chef Workstation gives you everything you need to get started with Chef, so you can automate how you audit, configure, and manage applications end environments.
Apache License 2.0
134 stars 112 forks source link

Windows domain in http_proxy causes failure #188

Open tyler-ball opened 6 years ago

tyler-ball commented 6 years ago

Description

https_proxy='https://domain\user:1234@hostname:8080/' be chef-run vagrant@ubuntu1 package ntp action=install raises the following stack trace:

2018-05-30 16:09:49 -0600: Error encountered while running the following:
  vagrant@ubuntu1 package ntp action=install -i ./.vagrant/machines/ubuntu1/virtualbox/private_key
Backtrace:
ChefDK::PolicyfileInstallError: Failed to generate Policyfile.lock
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_services/install.rb:113:in `rescue in generate_lock_and_install'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_services/install.rb:92:in `generate_lock_and_install'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_services/install.rb:62:in `run'
        /Users/tball/github/chef-workstation/components/chef-run/lib/chef-run/cli.rb:403:in `create_local_policy'
        /Users/tball/github/chef-workstation/components/chef-run/lib/chef-run/cli.rb:228:in `perform_run'
        /Users/tball/github/chef-workstation/components/chef-run/lib/chef-run/cli.rb:152:in `block in run'
        /Users/tball/github/chef-workstation/components/chef-run/lib/chef-run/telemeter.rb:85:in `block in timed_capture'
        /Users/tball/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/benchmark.rb:293:in `measure'
        /Users/tball/github/chef-workstation/components/chef-run/lib/chef-run/telemeter.rb:85:in `timed_capture'
        /Users/tball/github/chef-workstation/components/chef-run/lib/chef-run/telemeter.rb:74:in `timed_run_capture'
        /Users/tball/github/chef-workstation/components/chef-run/lib/chef-run/cli.rb:150:in `run'
        /Users/tball/github/chef-workstation/components/chef-run/bin/chef-run:22:in `<top (required)>'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bin/chef-run:23:in `load'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bin/chef-run:23:in `<main>'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bin/ruby_executable_hooks:15:in `eval'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bin/ruby_executable_hooks:15:in `<main>'
Caused by: URI::InvalidURIError: bad URI(is not URI?): https://domain\user:1234@hostname:8080/
        /Users/tball/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/rfc3986_parser.rb:67:in `split'
        /Users/tball/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/rfc3986_parser.rb:73:in `parse'
        /Users/tball/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/common.rb:237:in `parse'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-config-14.1.12/lib/chef-config/config.rb:1015:in `proxy_uri'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-14.1.12/lib/chef/http/basic_client.rb:103:in `proxy_uri'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-14.1.12/lib/chef/http/basic_client.rb:133:in `http_client_builder'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-14.1.12/lib/chef/http/basic_client.rb:112:in `build_http_client'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-14.1.12/lib/chef/http/basic_client.rb:50:in `http_client'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-14.1.12/lib/chef/http/basic_client.rb:69:in `request'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-14.1.12/lib/chef/http.rb:372:in `block in send_http_request'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-14.1.12/lib/chef/http.rb:411:in `block in retrying_http_errors'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-14.1.12/lib/chef/http.rb:409:in `loop'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-14.1.12/lib/chef/http.rb:409:in `retrying_http_errors'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-14.1.12/lib/chef/http.rb:365:in `send_http_request'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-14.1.12/lib/chef/http.rb:149:in `request'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/gems/chef-14.1.12/lib/chef/http.rb:115:in `get'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile/community_cookbook_source.rb:88:in `full_community_graph'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile/community_cookbook_source.rb:56:in `universe_graph'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_compiler.rb:291:in `block in remote_artifacts_graph'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_compiler.rb:290:in `each'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_compiler.rb:290:in `remote_artifacts_graph'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_compiler.rb:266:in `artifacts_graph'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_compiler.rb:234:in `block in graph'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_compiler.rb:233:in `tap'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_compiler.rb:233:in `graph'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_compiler.rb:229:in `graph_solution'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_compiler.rb:176:in `install'
        /Users/tball/.rvm/gems/ruby-2.5.1@chef-workstation/bundler/gems/chef-dk-148826310ae9/lib/chef-dk/policyfile_services/install.rb:100:in `generate_lock_and_install'
        ... 14 more

Chef Workstation Version

0.1.126

Platform Version

Mac OSX

tyler-ball commented 6 years ago

@marcparadise I'm wondering if we could use the same www-form we use for passwords on the 'user' portion of the connection string. I bet that would at least get us past the URI parsing bug. I'll work with the customer to see if we can test that.

tyler-ball commented 6 years ago

Quote from a community member:

Try "user@domain":password for the domain creds. Including the quotes like that. I can't say for sure it'll work, but from OSX I'm able to SSH into a domain joined Linux box basically that way.

Maybe we could try that?