ERROR: Exception: HTTPClient::KeepAliveDisconnected: An existing connection was forcibly closed by the remote host. @ io_fillbuf - fd :4

About two weeks ago I got interested in Chef and decided to follow the steps shown here: https://learn.chef.io/manage-a… Everything went smoothly until I began bootstrapping my Windows 2012R2 Instance in AWS. I have RDPed into my instance and have done everything you stated in your article above, yet each time I type:

knife bootstrap windows winrm “IP” --winrm-user “Administrator” --winrm-password “XXXX” --node-name ‘MyNode’ --run-list ‘recipe[learn_chef_iis]’

I get the following error:

ERROR: Exception: HTTPClient::KeepAliveDisconnected: An existing connection was forcibly closed by the remote host. @ io_fillbuf - fd :4

Note: I get the same error with : knife wsman test

This has been ongoing for over a week now. Any help will be appreciated.

Does your security groups on AWS allow winrm connexions (port 5985) ?

Quoting the tutorial here (from this part when clicking on the AWS block in 1.):

When you create your security group, ensure that ports 80 (HTTP), 3389 (RDP), and 5985 (WinRM) are open for inbound network traffic, and that port 443 (HTTPS) is open for outbound traffic.

The error message makes me think the connexion is closed by AWS filtering.

If it isn’t the AWS security group, it may be your output filtering - a number of environments with proxies or outbound access control block outbound connections to 5895 (the default port for WinRM).