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

Knife is ignoring values in config.rb on Windows 10 #8648

Open
jsnider-mtu opened this issue Sep 22, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@jsnider-mtu
Copy link

commented Sep 22, 2018

Description

I've installed chefdk v3.2.30 on my Windows 10 laptop and have a chef server running in AWS. I created the following config.rb in both the current working directory (..chef\config.rb) and verified that it is being used when knife runs:

current_dir = File.dirname(__FILE__)
log_level                 :debug
log_location              STDOUT
node_name                 "chefadmin"
client_key                "#{current_dir}/chefadmin.pem"
chef_server_url           'https://ec2-52-87-185-47.compute-1.amazonaws.com/organizations/4thcoffee'
cookbook_path             ["#{current_dir}/../cookbooks"]

When I run knife ssl check it tries to connect to localhost however:

PS C:\Users\jsnider1\workspace\learn-chef> knife ssl check -V -V
INFO: Using configuration from C:/Users/jsnider1/workspace/learn-chef/.chef/config.rb
Connecting to host localhost:443
Traceback (most recent call last):
        13: from C:/opscode/chefdk/bin/knife:306:in `<main>'
        12: from C:/opscode/chefdk/bin/knife:306:in `load'
        11: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56-universal-mingw32/bin/knife:24:in `<top (required)>'
        10: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56-universal-mingw32/lib/chef/application/knife.rb:161:in `run'
         9: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56-universal-mingw32/lib/chef/knife.rb:220:in `run'
         8: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56-universal-mingw32/lib/chef/knife.rb:445:in `run_with_pretty_exceptions'
         7: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
         6: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56-universal-mingw32/lib/chef/knife.rb:446:in `block in run_with_pretty_exceptions'
         5: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56-universal-mingw32/lib/chef/knife/ssl_check.rb:249:in `run'
         4: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56-universal-mingw32/lib/chef/knife/ssl_check.rb:130:in `verify_cert'
         3: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56-universal-mingw32/lib/chef/knife/ssl_check.rb:80:in `verify_peer_socket'
         2: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56-universal-mingw32/lib/chef/mixin/proxified_socket.rb:36:in `proxified_socket'
         1: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56-universal-mingw32/lib/chef/mixin/proxified_socket.rb:36:in `new'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56-universal-mingw32/lib/chef/mixin/proxified_socket.rb:36:in `initialize': No connection could be made because the target machine actively refused it. - connect(2) for "localhost" port 443 (Errno::ECONNREFUSED)

But if I supply the chef server URL as a command-line option it works:

PS C:\Users\jsnider1\workspace\learn-chef> knife ssl check -V -V -s https://ec2-52-87-185-47.compute-1.amazonaws.com/org
anizations/4thcoffee
INFO: Using configuration from C:/Users/jsnider1/workspace/learn-chef/.chef/config.rb
Connecting to host ec2-52-87-185-47.compute-1.amazonaws.com:443
Successfully verified certificates from `ec2-52-87-185-47.compute-1.amazonaws.com'

I have no way of supplying other configuration parameters (such as node_name) via the command-line however, so knife cookbook list and similar fail.

ChefDK Version

PS C:\Users\jsnider1\workspace\learn-chef> chef --version
Chef Development Kit Version: 3.2.30
chef-client version: 14.4.56
delivery version: master (6862f27aba89109a9630f0b6c6798efec56b4efe)
berks version: 7.0.6
kitchen version: 1.23.2
inspec version: 2.2.70

Platform Version

Windows 10

Replication Case

Create a chef server that is configured with a self signed cert that matches the FQDN and a config.rb configured for talking to it. Then try using knife without command-line options.

Stacktrace

Stacktrace included in description.

NOTE: CHEFDK BUGS ONLY

This issue tracker is for the code contained within this repo -- chefdk.

@tas50 tas50 transferred this issue from chef/chef-dk Jun 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.