worstcase / blockade

Docker-based utility for testing network failures and partitions in distributed applications
http://blockade.readthedocs.org
Apache License 2.0
907 stars 72 forks source link

Problem determining host network device #25

Closed joshbenner closed 7 years ago

joshbenner commented 8 years ago

I am frequently encountering this error for no apparent reason:

Error:
Problem determining host network device for container '157795997a89682870860bb97f4f18383c9b7b4112b4be4cf047f1d8e4db217c'

Can you help me understand what causes this, and how I might resolve it?

labisso commented 8 years ago

I haven't seen that error before, but it can come from a few conditions in this method: https://github.com/dcm-oss/blockade/blob/6c79655d6550962c5385becb053270a520a93202/blockade/net.py#L67-L96

This method attempts to find the network interface device name for a container, and this is an area that has changed a few times, with different docker releases and container drivers. There must be some case we are not handling. Can you please provide:

joshbenner commented 8 years ago

It seems the issue is that if there is anything that causes the container to hit an error on run, this is the error that manifests. In my case, I had a typo in the volume I was attempting to mount.

So I think the problem here is that the error is misleading; or rather, some set of problems leading up to this point are not caught.

labisso commented 8 years ago

Interesting.. I'm surprised the run didn't fail earlier. I agree the error messages need to be better for this case. I'll keep this issue open as a reminder to address that.

Thanks for reporting this!

donovansolms commented 8 years ago

A note, Ubuntu images don't seem to have the ip command available anymore. I tried with ubuntu:16:04. Use ubuntu:14.04.

labisso commented 7 years ago

Closing this issue. In 0.3.1, blockade has a couple of fixes that address problems discussed here:

  1. Vastly improved error handling around finding a container's interface
  2. ip is no longer required to be installed in containers. Instead Blockade directly reads the /sys FS to find the needed information from the container.