SOLVED: Ruby errors: knife fetch bad gateway error - learn chef tutorial


#1

SOLUTION: added local chef server to no_proxy

I’m attempting to go through the learn.chef.io tutorial “Install a Chef Server”.

I’m not sure what to do with all these ruby errors

$ knife ssl fetch
WARNING: Certificates from chef-server.test will be fetched and placed in your trusted_cert
directory (c:\users\212336986\documents\training\learn-chef.chef\trusted_certs).

Knife has no means to verify these are the correct certificates. You should
verify the authenticity of these certificates after downloading.

ERROR: bad gateway
C:/opscode/chefdk/embedded/lib/ruby/2.3.0/net/http/response.rb:331:in stream_check': undefined methodclosed?’ for nil:NilClass (NoMethodError)
from C:/opscode/chefdk/embedded/lib/ruby/2.3.0/net/http/response.rb:200:in read_body' from C:/opscode/chefdk/embedded/lib/ruby/2.3.0/net/http/response.rb:227:inbody’
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.2-universal-mingw32/lib/chef/knife.rb:537:in rescue in format_rest_error' from C:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.2-universal-mingw32/lib/chef/knife.rb:535:informat_rest_error’
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.2-universal-mingw32/lib/chef/knife.rb:503:in humanize_http_exception' from C:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.2-universal-mingw32/lib/chef/knife.rb:456:inhumanize_exception’
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.2-universal-mingw32/lib/chef/knife.rb:447:in rescue in run_with_pretty_exceptions' from C:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.2-universal-mingw32/lib/chef/knife.rb:437:inrun_with_pretty_exceptions’
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.2-universal-mingw32/lib/chef/knife.rb:219:in run' from C:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.2-universal-mingw32/lib/chef/application/knife.rb:156:inrun’
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.2-universal-mingw32/bin/knife:25:in <top (required)>' from C:/opscode/chefdk/bin/knife:68:inload’
from C:/opscode/chefdk/bin/knife:68:in `’

$ chef --version
Chef Development Kit Version: 1.5.0 <-- also tested on 2.3.1, same error
chef-client version: 12.21.2
delivery version: master (17c1b0fed9be4c70f69091a6d21a4cbf0df60a23)
berks version: 5.6.4
kitchen version: 1.16.0
inspec version: 1.25.1

My chef-server is a local vagrant box


#2

You need to add these certificates as trusted else sometimes it doesn’t allow to connect to chef server.