# How to bootstrap private IP node to open source server

**URL:** <https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502>\
**Category:** Chef Infra (archive)\
**Created:** [December 22, 2015, 5:27pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502 "2015-12-22T17:27:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![phanikumar](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@phanikumar](https://discourse.chef.io/u/phanikumar)\
**Post date:** [December 22, 2015, 5:27pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/1 "2015-12-22T17:27:27Z")

</div>

I would like to register private node to open source Chef server. I had problem of making it register to the chef-server as it can’t identify the private IP in my local domain. I don’t have any NAT mechanism implemented on my private node. But it has access to internet. I will be thankful if someone help me in sorting out this issue.

---

<div class="post-metadata">

**Author:** ![jdunn](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jdunn/32/1800_2.png) [@jdunn](https://discourse.chef.io/u/jdunn)\
**Post date:** [December 22, 2015, 11:05pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/2 "2015-12-22T23:05:28Z")

</div>

Not quite sure what you mean. Chef Server doesn’t care what the IP address of your node is. Can you paste some error messages?

---

<div class="post-metadata">

**Author:** ![phanikumar](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@phanikumar](https://discourse.chef.io/u/phanikumar)\
**Post date:** [December 26, 2015, 3:12pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/3 "2015-12-26T15:12:06Z")

</div>

Hi, I am getting problem with windows node, It is simply specifying connection refused I have enabled all the ports. But I was unable to know how to bootstrap it.

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [December 26, 2015, 4:29pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/4 "2015-12-26T16:29:25Z")

</div>

I’m assuming you are trying to connect via WinRM and have enabled ports 5985(HTTP) and 5986(HTTPS) in windows firewall.

Can you share your bootstrap command to help diagnose?

In addition to enabling firewall ports, you want to:

- use the [knife-windows](https://github.com/chef/knife-windows#knife-bootstrap-windows-winrm) `knife bootstrap windows WinRM` command
- unless you are bootstrapping 2012R2 (where it is already enabled), enable WinRM on the node `winrm quickconfig -q`
- if you are trying to connect via SSL, create an SSL listener

Also see [this post](http://www.hurryupandwait.io/blog/understanding-and-troubleshooting-winrm-connection-and-authentication-a-thrill-seekers-guide-to-adventure) covering winrm connectivity and authentication troubleshooting tips.

Matt

---

<div class="post-metadata">

**Author:** ![phanikumar](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@phanikumar](https://discourse.chef.io/u/phanikumar)\
**Post date:** [December 26, 2015, 4:37pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/5 "2015-12-26T16:37:17Z")

</div>

Hi Matt\_Wrock, Thanks for the response the above helped me to some extent, now I am getting the following error

ERROR: WinRM::WinRMHTTPTransportError: Unable to parse WinRM response: #\<ArgumentError: invalid byte sequence in UTF-8\>

Could you please help me out in resolving this.

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [December 26, 2015, 4:51pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/6 "2015-12-26T16:51:36Z")

</div>

Can you share your boottrapping command and the full error you are receiving? Notably is there text after “#” with the error message and response code?

What version of windows is the node running?

---

<div class="post-metadata">

**Author:** ![phanikumar](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@phanikumar](https://discourse.chef.io/u/phanikumar)\
**Post date:** [December 26, 2015, 4:58pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/7 "2015-12-26T16:58:22Z")

</div>

Please find the command and complete error below.

knife bootstrap windows winrm 192.168.1.5 -x DDVN -P !$#Mother -N sample

192.168.1.5 C:\Users\DDVN\>goto install  
192.168.1.5 Checking for existing downloaded package at "C:\Users\DDVN\AppData\Local\Temp\chef-client-latest.msi"  
192.168.1.5 Found existing downloaded package, deleting.  
192.168.1.5 Attempting to download client package using PowerShell if available…  
192.168.1.5 powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File C:\chef\wget.ps1 “[https://www.chef.io/chef/download?p=windows&pv=200](https://www.chef.io/chef/download?p=windows&pv=200)  
r2&m=i686&DownloadContext=PowerShell&v=12” "C:\Users\DDVN\AppData\Local\Temp\chef-client-latest.msi"  
ERROR: WinRM::WinRMHTTPTransportError: Unable to parse WinRM response: #\<ArgumentError: invalid byte sequence in UTF-8\>  
C:/opscode/chef/embedded/lib/ruby/2.0.0/rexml/source.rb:219:in `match' C:/opscode/chef/embedded/lib/ruby/2.0.0/rexml/source.rb:219:in`match’  
C:/opscode/chef/embedded/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:202:in `pull_event' C:/opscode/chef/embedded/lib/ruby/2.0.0/rexml/parsers/baseparser.rb:183:in`pull’  
C:/opscode/chef/embedded/lib/ruby/2.0.0/rexml/parsers/treeparser.rb:22:in `parse' C:/opscode/chef/embedded/lib/ruby/2.0.0/rexml/document.rb:283:in`build’  
C:/opscode/chef/embedded/lib/ruby/2.0.0/rexml/document.rb:43:in `initialize' C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/winrm-1.3.4/lib/winrm/http/response_handler.rb:42:in`new’  
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/winrm-1.3.4/lib/winrm/http/response\_handler.rb:42:in `response_xml' C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/winrm-1.3.4/lib/winrm/http/response_handler.rb:61:in`raise\_if\_wsman\_fault’  
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/winrm-1.3.4/lib/winrm/http/response\_handler.rb:51:in `raise_if_error' C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/winrm-1.3.4/lib/winrm/http/response_handler.rb:35:in`parse\_to\_xml’  
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/winrm-1.3.4/lib/winrm/http/transport.rb:50:in `send_request' C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/winrm-1.3.4/lib/winrm/winrm_service.rb:430:in`send\_message’  
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/winrm-1.3.4/lib/winrm/winrm\_service.rb:415:in `send_get_output_message' C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/winrm-s-0.3.1/lib/winrm/winrm_service_patch.rb:64:in`get\_command\_output’  
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/knife-windows-1.1.1/lib/chef/knife/winrm\_session.rb:61:in `get_output' C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/knife-windows-1.1.1/lib/chef/knife/winrm_session.rb:52:in`relay\_command’  
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/knife-windows-1.1.1/lib/chef/knife/winrm\_knife\_base.rb:140:in `block in relay_winrm_command' C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/knife-windows-1.1.1/lib/chef/knife/winrm_knife_base.rb:138:in`each’  
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/knife-windows-1.1.1/lib/chef/knife/winrm\_knife\_base.rb:138:in `relay_winrm_command' C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/knife-windows-1.1.1/lib/chef/knife/winrm_knife_base.rb:125:in`run\_command’  
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/knife-windows-1.1.1/lib/chef/knife/bootstrap\_windows\_base.rb:328:in `bootstrap' C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/knife-windows-1.1.1/lib/chef/knife/bootstrap_windows_winrm.rb:53:in`run’  
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.4.1-universal-mingw32/lib/chef/knife.rb:425:in `block in run_with_pretty_exceptions' C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.4.1-universal-mingw32/lib/chef/local_mode.rb:39:in`with\_server\_connectivity’  
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.4.1-universal-mingw32/lib/chef/knife.rb:424:in `run_with_pretty_exceptions' C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.4.1-universal-mingw32/lib/chef/knife.rb:215:in`run’  
C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.4.1-universal-mingw32/lib/chef/application/knife.rb:142:in `run' C:/opscode/chef/embedded/lib/ruby/gems/2.0.0/gems/chef-12.4.1-universal-mingw32/bin/knife:25:in`\<top (required)\>'  
C:/opscode/chef/embedded/bin/knife:23:in `load' C:/opscode/chef/embedded/bin/knife:23:in`'  
…  
invalid byte sequence in UTF-8  
Line: 7

I have tried the following command

winrm set winrm/config/service @{AllowUnencrypted=“false”} but it has no impact

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [December 26, 2015, 5:29pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/8 "2015-12-26T17:29:56Z")

</div>

Ahh. Looks like you are using the winrm gem version 1.3.4 which had a regression bug in its encoding. This was fixed in v1.3.5 and the latest version is 1.4.0. You should be able to overcome this by installing the latest (1.4.0) winrm gem.

---

<div class="post-metadata">

**Author:** ![phanikumar](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@phanikumar](https://discourse.chef.io/u/phanikumar)\
**Post date:** [December 26, 2015, 6:06pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/9 "2015-12-26T18:06:57Z")

</div>

I have upgraded to winrm to 1.4 but still I am facing the same issue.

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [December 26, 2015, 6:11pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/10 "2015-12-26T18:11:20Z")

</div>

Just to confirm the newer gem is actually loading, does the stack trace now have the path to the 1.4 gem or is it still 1.3.4?

---

<div class="post-metadata">

**Author:** ![phanikumar](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@phanikumar](https://discourse.chef.io/u/phanikumar)\
**Post date:** [December 26, 2015, 6:15pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/11 "2015-12-26T18:15:59Z")

</div>

It is still bootstrapping with winrm 1.3.4 but when I execute

chef gem list it is showing winrm 1.4 ,1.3.4

Do I need to make any modifications to let it use only winrm 1.4

or shall I need to uninstall winrm 1.3.4 gem

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [December 26, 2015, 6:21pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/12 "2015-12-26T18:21:02Z")

</div>

go ahead and uninstall 1.3.4.

---

<div class="post-metadata">

**Author:** ![phanikumar](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@phanikumar](https://discourse.chef.io/u/phanikumar)\
**Post date:** [December 26, 2015, 7:15pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/14 "2015-12-26T19:15:44Z")

</div>

Still it is using the same gem and it is installing the chef-client partially on the node

---

<div class="post-metadata">

**Author:** ![kkeane](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@kkeane](https://discourse.chef.io/u/kkeane)\
**Post date:** [December 26, 2015, 7:24pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/15 "2015-12-26T19:24:19Z")

</div>

As an aside, please be sure to change your password. It’s easy to forget to redact the password in command lines like this, but now that it showed up on this list, it should be considered compromised.

Kevin Keane  
The NetTech  
[http://www.4nettech.com](http://www.4nettech.com)  
Our values: Privacy, Liberty, Justice  
See [https://www.4nettech.com/corp/the-nettech-values.html](https://www.4nettech.com/corp/the-nettech-values.html)

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [December 26, 2015, 7:56pm UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/16 "2015-12-26T19:56:04Z")

</div>

might try both `gem uninstall winrm -v 1.3.4` and `chef gem uninstall -v 1.3.4`

---

<div class="post-metadata">

**Author:** ![phanikumar](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@phanikumar](https://discourse.chef.io/u/phanikumar)\
**Post date:** [December 27, 2015, 4:36am UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/17 "2015-12-27T04:36:08Z")

</div>

I have uninstalled both but still there is no progress.

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [December 27, 2015, 6:32am UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/18 "2015-12-27T06:32:25Z")

</div>

Is it the same error `invalid byte sequence` and does the stacktrace indicate winrm 1.4.0 is active?

---

<div class="post-metadata">

**Author:** ![phanikumar](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@phanikumar](https://discourse.chef.io/u/phanikumar)\
**Post date:** [December 27, 2015, 6:35am UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/19 "2015-12-27T06:35:32Z")

</div>

In chef gem list it is showing 1.4 and 1.3.6 and I am getting the same error

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [December 27, 2015, 7:07am UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/20 "2015-12-27T07:07:10Z")

</div>

ok thanks. I just did some investigation and it looks like this is an issue with the winrm-s gem which monkey patches winrm to provide negotiate auth on “windows to windows” bootstraps. The [same fix](https://github.com/WinRb/WinRM/commit/58518e964c2e85b53e3326107a373aec15a5e95c) applied to winrm 1.3.5 which strips the BOM injected by windows 2008R2 nodes needs to be applied in winrm-s. I’ll focus on releasing a fix there early next week.

I’m assuming you are trying to bootstrap windows 2008R2 or win 7 or older which is where we discovered the original encoding bug with winrm.

In the meantime you can work around this by either:

- using SSL
- using basic authentication.(strongly discouraged for production nodes)
- revert to winrm (v1.3.3)

I would suggest the latter route since it is the simplest. The encoding change to UTF-8 in 1.3.4 only benefits newer windows OS versions - namely Windows nano.

I apologize for the hassle involved here.

---

<div class="post-metadata">

**Author:** ![phanikumar](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@phanikumar](https://discourse.chef.io/u/phanikumar)\
**Post date:** [December 27, 2015, 7:17am UTC](https://discourse.chef.io/t/how-to-bootstrap-private-ip-node-to-open-source-server/7502/21 "2015-12-27T07:17:55Z")

</div>

Hi Matt\_Wrock, No need to say apologize and I should thank you for your support and I have already gone through the error that you have mentioned above about winrm-s monkey patch and found that the issue got closed and tried some stuff from there. Anyway thanks for the support.
