chef/chef-zero

Unexplicable delay when running in non-networked mode

Closed this issue · 1 comments

Hi,

I was trying to clean up some cookbooks (which don't have any network dependency) during a long flight (without network connectivity) and in order to do this I created a vagrant box with a presinstalled Chef.

To my surprise, what was a single < 5 seconds run when connected to a network (Wifi enabled in the Host), became a > 8 minutes when non connected to any network (Wifi disabled in the Host).
Initially I thought it might have something to do with TestKitchen, but running the chef-client command directly on the guest resulted in the same behaviour.

You can find debug mode runs as gists for a cookbook that just gets some attributes and logs them. For what I can tell there is only delays, not any kind of errors (or logged errors). I have the feeling that it might have to do with DNS lookups or some connection attempts that just timeout without causing any harm (because they are not needed), instead of be completely ignored or fail quickly.
One example is the first two lines of the debug logs.

This is not a show stopper because I reckon this is not the most typical use case, but for some of us travellers being highly mobile and not requiring network connectivity is very much appreciated.
If there is a way to fix this or to tweak the delay, please let me know.

I am using Mavericks as a host (MacBook Air) and the guest is a solaris box.

The timeout is trying to connect to the GCE metadata endpoint in ohai, so not a chef zero bug. (this fails fast when you've got an internet connection.)
We've fixed that in ohai, so closing this ticket. Thanks for the report.