title: got Error on start "unsupported address family"
body: <p>Than you for reading this</p>
  
  <p>when I run from source, I got "unsupported address family"  Error, because method "_get_wildcard_address"  returned a value of  "::"</p>
  
  <p>in tensorboard source code, I modified program.py, print some vars</p>
  
  <p>program.py</p>
  
  <pre><code>  def _get_wildcard_address(self, port):
      """Returns a wildcard address for the port in question.
  
      This will attempt to follow the best practice of calling getaddrinfo() with
      a null host and AI_PASSIVE to request a server-side socket wildcard address.
      If that succeeds, this returns the first IPv6 address found, or if none,
      then returns the first IPv4 address. If that fails, then this returns the
      hardcoded address "::" if socket.has_ipv6 is True, else "0.0.0.0".
      """
      print("port:", port)
      fallback_address = '::' if socket.has_ipv6 else '0.0.0.0'
      if hasattr(socket, 'AI_PASSIVE'):
        try:
          addrinfos = socket.getaddrinfo(None, port, socket.AF_UNSPEC,
                                         socket.SOCK_STREAM, socket.IPPROTO_TCP,
                                         socket.AI_PASSIVE)
          print("addrinfos:", addrinfos)
        except socket.gaierror as e:
          logger.warn('Failed to auto-detect wildcard address, assuming %s: %s',
                      fallback_address, str(e))
          return fallback_address
        addrs_by_family = defaultdict(list)
        for family, _, _, _, sockaddr in addrinfos:
          # Format of the "sockaddr" socket address varies by address family,
          # but [0] is always the IP address portion.
          addrs_by_family[family].append(sockaddr[0])
        print("addrs_by_family:", addrs_by_family)
        print("socket.AF_INET6:", socket.AF_INET6)
        print("socket.AF_INET:", socket.AF_INET)
        if hasattr(socket, 'AF_INET6') and addrs_by_family[socket.AF_INET6]:
          print("return INET6 addr:", addrs_by_family[socket.AF_INET6][0])
          return addrs_by_family[socket.AF_INET6][0]
        if hasattr(socket, 'AF_INET') and addrs_by_family[socket.AF_INET]:
          print("return INET addr:", addrs_by_family[socket.AF_INET][0])
          return addrs_by_family[socket.AF_INET][0]
      logger.warn('Failed to auto-detect wildcard address, assuming %s',
              fallback_address)
  return fallback_address
  </code></pre>
  
  <p>run command got this:</p>
  
  <pre><code>$ bazel run //tensorboard --  --logdir  /home/admin/sean.xd/tmp/   
  INFO: Analysed target //tensorboard:tensorboard (0 packages loaded).
  INFO: Found 1 target...
  Target //tensorboard:tensorboard up-to-date:
    bazel-bin/tensorboard/tensorboard
  INFO: Elapsed time: 0.280s, Critical Path: 0.00s
  INFO: 0 processes.
  INFO: Build completed successfully, 1 total action
  INFO: Build completed successfully, 1 total action
  port: 6006
  addrinfos: [(2, 1, 6, '', ('0.0.0.0', 6006)), (10, 1, 6, '', ('::', 6006, 0, 0))]
  addrs_by_family: defaultdict(&lt;type 'list'&gt;, {2: ['0.0.0.0'], 10: ['::']})
  socket.AF_INET6: 10
  socket.AF_INET: 2
  return INET6 addr: ::
  host: ::
  E1116 20:02:21.122143 MainThread program.py:201] Tensorboard could not bind to unsupported address family ::
  WARNING: Logging before flag parsing goes to stderr.
  E1116 20:02:21.122143 139781956085568 program.py:201] Tensorboard could not bind to unsupported address family ::
  ERROR: Tensorboard could not bind to unsupported address family ::
  </code></pre>
  
  <p>envivonment:</p>
  
  <p>$ uname -a</p>
  
  <p>Linux arks7.inc.alipay.net 3.10.0-327.ali2000.alios7.x86_64 #1 SMP Tue Dec 29 19:54:05 CST 2015 x86_64 x86_64 x86_64 GNU/Linux
  (xudong_test) </p>