Skip to content

Hosts file should not contain IPv6 loopback if IPv6 is not enabled #100

@vito

Description

@vito

Description

Since upgrading to Garden-runC 1.9.4 we've observed that a few test frameworks now fail (notably, Selenium) on our BOSH deployed Concourse instances. They fail with the following error:

Errno::EAFNOSUPPORT:
       Address family not supported by protocol - socket(2) for "::1" port 9515

It looks like it's finding the IPv6 loopback entry and trying to use it, even though it's not supported by the kernel. We've submitted a patch to have Selenium swallow this error, but it seems more correct to not put an unsupported address in /etc/hosts in the first place; today it's Selenium, who knows what else may be confused.

Steps to reproduce

  • Guardian release version: 1.9.4
  • Linux kernel version: 4.4.0
  • Concourse version: 3.5.1 release candidate (we haven't shipped a version with 1.9.4 yet)
  • Go version: 1.9

Here's our steps:

  1. BOSH-deployed Concourse or just Garden

  2. Run the following in a container (this is what Selenium does, distilled):

    require "socket"
    
    Socket.getaddrinfo('localhost', 8080).map { |e| e[3] }.each do |i|
      TCPServer.new(i, 0).tap { |s| p [i, s] }.close
    end
  3. No errors should be raised.

The tl;dr is that Socket.getaddrinfo('localhost', 8080) is what returns the ::1 address, which it then tries to listen on.

/cc @topherbullock

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions