title: " TypeError: no implicit conversion of nil into String " during knife bootstrap
body: <p>When I am using the knife bootstrap command to connect the node to the chef server I am facing this issue.</p>
  
  <blockquote>
    <p>Doing old-style registration with the validation key at ...
        Delete your validation key in order to use your user credentials instead</p>
    
    <p>Connecting to xx.xx.xxx.xxx ( some IP address )
        ERROR: TypeError: no implicit conversion of nil into String</p>
  </blockquote>
  
  <p>When I searched in google I got the few answers regarding to the " Doing old-style registration with the validation key at ..." but I saw some location in "..." in above that line.</p>
  
  <p>I don't know what wrong I am doing.</p>
  
  <p><strong><em>Chef Information:</em></strong>
  I used GCP for the workstation, node and for the server I used <code>"manage.chef.io"</code> ( chef server )</p>
  
  <blockquote>
    <h1>NOTE : please see the comment below</h1>
  </blockquote>
  
  <p>When I executed this command :</p>
  
  <pre><code>knife bootstrap 35.XX.xx.x --ssh-user USER-NAME --sudo --identity-file SSH-FILE-LOCATION -N node1 -VV
  </code></pre>
  
  <p>I am getting this :</p>
  
  <pre><code>INFO: Using configuration from /home/sandeep.nayak/chef-repo/.chef/knife.rb
  Doing old-style registration with the validation key at ...
  Delete your validation key in order to use your user credentials instead
  
  Connecting to 35.200.203.207
  Traceback (most recent call last):
          16: from /usr/bin/knife:75:in `&lt;main&gt;'
          15: from /usr/bin/knife:75:in `load'
          14: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.3.37/bin/knife:24:in `&lt;top (required)&gt;'
          13: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.3.37/lib/chef/application/knife.rb:161:in `run'
          12: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.3.37/lib/chef/knife.rb:220:in `run'
          11: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.3.37/lib/chef/knife.rb:441:in `run_with_pretty_exceptions'
          10: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.3.37/lib/chef/local_mode.rb:44:in `with_server_connectivity'
           9: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.3.37/lib/chef/knife.rb:442:in `block in run_with_pretty_exceptions'
           8: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.3.37/lib/chef/knife/bootstrap.rb:391:in `run'
           7: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.3.37/lib/chef/knife/bootstrap.rb:426:in `knife_ssh'
           6: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.3.37/lib/chef/knife/bootstrap.rb:448:in `ssh_command'
           5: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.3.37/lib/chef/knife/bootstrap.rb:354:in `render_template'
           4: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb:74:in `evaluate'
           3: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb:74:in `instance_eval'
           2: from (erubis):196:in `block in evaluate'
           1: from /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.3.37/lib/chef/knife/core/bootstrap_context.rb:49:in `validation_key'
  /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.3.37/lib/chef/knife/core/bootstrap_context.rb:49:in `expand_path': no implicit conversion of nil into String (TypeError)
  </code></pre>
  
  <p>My knife.rb file :</p>
  
  <pre><code># See http://docs.chef.io/config_rb_knife.html for more information on knife configuration options
  
  current_dir = File.dirname(__FILE__)
  log_level                :info
  log_location             STDOUT
  node_name                "techrealm"
  client_key               "#{current_dir}/techrealm.pem"
  chef_server_url          "https://api.chef.io/organizations/techrealm"
  cookbook_path            ["#{current_dir}/../cookbooks"]
  </code></pre>
  
  <p>There are few I have noticed when I try to solving this issue:</p>
  
  <ol>
  <li><p>Initially, I am unable to see the file called "validation.pem" at /etc/chef in workstation ( I dont know where validation.pem file is present ( workstation or node )). So I tried </p>
  
  <p>knife configure client /etc/chef
  It created the two files <em>1. client.pem</em> <em>2. validation.pem</em> but validation.pem file is empty.</p></li>
  <li><p>I am seeing some ruby line at </p></li>
  </ol>
  
  <blockquote>
    <p>default(:validation_key) 
        { chef_zero.enabled ? nil : platform_specific_path("/etc/chef/techrealm.pem") }</p>
  </blockquote>
  
  <p>at this location " opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-config-14.3.37/lib/chef-config/config.rb" </p>
  
  <p>Hope this will help you</p>