Disconnected while in bootstrap

Hi Geeks,

I’m bootstrapping a windows server via winrm. If the node just got disconnected (network unreachable) chef hangs… and will only stop after an hour to say httpclient receivetimeout error.

Any ideas how can it reconnect to the node?


Looks like you have uncovered a winrm bug that I have just submitted a fix for here. While the fix does not implement a retry, it at least will fail much more quickly (no longer than 70 seconds) rather than hang silently for an hour.

Until this is released you can workaround the long hang by feeding a --session-timeout to the bootstrap command. I recommend 1 (this is in minutes). Note that this does not state winrm will timeout if a command takes longer than a minute. Winrm receives “heartbeats” from the server during a long running command and continues to look for output until the command exits. This timeout will cause a timeout if no heartbeat is sent which would surely be the case in the event of a disconnection.

Not sure what you are referring to…

Sorry if this was not clear kawolfe. The problem here is that winrm currently sets a default timeout of one hour for receiving an http response from the node. If the internet connection is broken, it will just sit there for one hour. While knife does not have built in reconnection logic, the workaround of setting a shorter timeout will at least prevent this scenario from incurring a one hour wait and will instead fail much more quickly (about a minute).