-
Notifications
You must be signed in to change notification settings - Fork 118
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
init_auth': undefined method
split' for nil:NilClass
#208
Comments
Yup. definitely a proxy issue. This reminds me that we REALLY need a proxy section in the readme and better error messages here that say something like "maybe you are using a proxy so try this..." So even if the below unblocks tou, lets keep this open so its not forgotten. The guidance of "This" would be to set the |
I equally agree that this is most likely a proxy issue. I get that error when my ENV proxies are set as suggested. When I go off proxy (remove the env variables) I get an expected Connection Refused error.
Could my proxies be setup to mess with or interrupt my winrm traffic specifically? Are there any other tests I could run to help identify the issue I'm seeing? |
Hmm. Its possible that winrm simply is not listnening, the firewall is blocking it or you don't have port mappings setup propperly in EC2. First thing i do is RDP (ugh...i know) to the EC2 instance and running:
This will ensure winrm is "on" and the 5985 firewall rule is wide open and not just the local subnet. |
Been there, done that as well, I will double check those though, it cannot hurt. I do also sometimes get these.
I'm going to go with our proxies are causing some disconnect. We recently had to change proxy addresses and perhaps something is blocked on the new proxies that was open on the old proxies. |
The above was a result of turning SSL on which I don't think our servers are setup for. |
I composed an email to our proxy team, but haven't heard anything back. As a workaround, I'm fortunate to have a linux jump host that I was able to establish a local SSH tunnel for port 5985. Modified my default-windows-2012r2.yml to point to 127.0.0.1 and I'm able to converge properly after the initial failure. Thank you @mwrock for your time and attention. |
I have a related issue. It appears that the Only Internet-bound traffic should go through our Web Proxies. Traffic to our AWS VPC should not go through our proxy. BackgroundWe have Steps to Reproduce:
# <snip>
driver:
name: ec2
http_proxy: http://proxygateway1.nordstrom.net:8181
https_proxy: http://proxygateway1.nordstrom.net:8181
no_proxy: nordstrom.net,localhost,127.0.0.1,169.254.169.254,172.16.0.0/12
aws_ssh_key_id: <%= aws_ssh_key_id %>
region: us-west-2
instance_type: t2.small
subnet_id: <%= subnet_foo_az1 %>
security_group_ids: <%= security_group_ids %>
transport:
ssh_key: <%= aws_ssh_key %>
platforms:
- name: windows-2012r2
image_search:
architecture: x86_64
name: Windows_Server-2012-R2_RTM-English-64Bit-Base-2016.* HTTP response from our Proxy server:
Stacktrace:
|
Hey @dougireton try setting |
@mwrock Here's my no_proxy=localhost,127.0.0.1,172.16.0.0/12 |
Hmm. doesn't look like cidr is valid: https://github.com/nahi/httpclient/blob/master/lib/httpclient.rb#L521-530
|
@mwrock the issue is that when WinRM tries to connect to the Here's an example of the endpoint address it tries to connect to: |
Just to add to this, I'm in the same situation and I added the full IP address to my no_proxy (after running kitchen create) and then kitchen converge worked. So theoretically, CIDR support should fix this issue. |
The issue with supporting CIDR in test-kitchen is that |
Yeah, I was just looking at the underlying code. It would be ideal to fix this issue at that level. I looked around at some similar implementations in other libraries and it looks like go and chrome both have libraries that support CIDR blocks, so there's some (external) precedence for supporting CIDR blocks. |
The httpclient gem owns the underlying code: https://github.com/nahi/httpclient/blob/master/lib/httpclient.rb and is the best place to add cidr support |
Yes, I may attempt a PR for it later this week. https://github.com/nahi/httpclient/blob/master/lib/httpclient.rb#L521-530 |
Let's set no_proxy CIDR aside for a bit and focus on the reported problem which seemingly is a proxy usage issue with winrm. There is another customer who is reporting the same problem with very similar stack trace:
Winrm works fine with ChefDK 0.10.0 for them. When they try either 0.13.21 or 0.14.25 they get the above error / stack trace. |
@jeremymv2 we definitely need better error messaging here but I'd be curious if setting the |
I'm hitting the same issue when running kitchen converge or vagrant up from Windows7 on VMWare Workstation with proxy settings set via $env:http_proxy and $env:https_proxy. If I launch a new PS session without the proxy settings, and run vagrant up, vagrant fails to check if the box is the latest version (can't get out without proxy settings), but succeeds in building the VM. |
Just one more case to the list... I'm using Vagrant with This command fails:
Unsetting environment variables (parentheses to unset temporary for
The proxy variables are definitely set correctly because downloads from Internet via FocusI want to put this focus on the issue: Note also that I'm not connecting to guest VM over any real network - all communication is local over virtual interfaces (as compared to some cases mentioning AWS above). So, again, since reliance on Internet is ruled out (where HTTP is predominant), there should not be no reason to fail. |
I just experienced this issue. There is a library I use for this in Powershell now: https://github.com/majkinetor/posh/blob/master/MM_Network/Update-CLIProxy.ps1 I use with number of tools such as git, pip etc... to set up console proxy, but here it is used to reset it:
|
For clarification, WinRM is indeed an HTTP/HTTPS transport. It relays commands to and from a remote machine via a SOAP service on the remote node. The winrm gem uses the http-client gem to manage this communication which will honor the |
Sometimes it would be simply a problem that the port 5985 is being used by other applications instead of WinRM service. See Ruby WinRM undefined method `split' for nil:NilClass |
When running a kitchen converge on a windows node from my Mac I'm getting the following error when Kitchen attempts to connect via winrm to my ec2 instance. Please note I have proxies involved and are most likely the culprit, but would like to see if its not something I'm doing wrong.
Doing some additional digging I attempted to isolate the winrm connection and using the readme I built a ruby script to perform the winrm connection independently:
This returns the following error:
Reviewing the code, it appears this is the negotiate step, but I don't have enough knowledge of winrm to know what exactly is failing and it must be nil because r isn't getting populated.
Any thoughts, ideas appreciated.
The text was updated successfully, but these errors were encountered: