devopsgroup-io / vagrant-hostmanager

:pencil: A Vagrant plugin that manages hosts files within a multi-machine environment.
Mozilla Public License 2.0
1.46k stars 146 forks source link

"The box is not able to report an address for WinRM to connect to yet" on windows machine that doesn't exist. #168

Closed RyanJarv closed 9 years ago

RyanJarv commented 9 years ago

I am getting the following error when hostmanager is run on one of my non-existent windows machines.

The box is not able to report an address for WinRM to connect to yet. WinRM cannot access this Vagrant environment. Please wait for the Vagrant environment to be running and try again.

Looking at the logs I believe this is because winrm is raising VagrantPlugins::CommunicatorWinRM::Errors::WinRMNotReady and not catching it here https://github.com/smdahlen/vagrant-hostmanager/blob/a5f69d8e15f2285188deb36e26cc37934a979d7b/lib/vagrant-hostmanager/hosts_file/updater.rb#L16

This is happening on the master branch of vagrant-hostmanager and the default version winrm.

RyanJarv commented 9 years ago

This commit fixes the issue for me.

https://github.com/RyanJarv/vagrant-hostmanager/commit/22edd634315897b54254cc2a08c26a468a514519

Note, this is happening on vagrant hostmanager and vagrant up, so I can't bring up the machine to workaround the issue.

RyanJarv commented 9 years ago

I think this is an issue with the WinRM communicator in vagrant, I don't think it should be raising any exceptions on failure. The following issue is open on the vagrant project regarding this.

https://github.com/mitchellh/vagrant/issues/6356#issuecomment-153135797