Skip to content

Pact Broker does not bind to [::], only 0.0.0.0 #163

@rmartine-ias

Description

@rmartine-ias

Pre issue-raising checklist

I have already (please mark the applicable with an x):

  • Confirmed this is the right place to raise the issue - only issues related to the Dockerization of the Pact Broker should be raised here. Issues related to the Pact Broker application itself should be raised in the Pact Broker project.
  • Upgraded to the latest Pact Broker Docker image OR
  • Checked the CHANGELOG to see if the issue I am about to raise has been fixed
  • Read the Troubleshooting page

Software versions

  • pact-broker docker version: 2.111.0-pactbroker2.107.1
  • OS: Any

Expected behaviour

Pact broker binds to ipv6 "any" address.

Actual behaviour

The containerized pact broker is not reachable in an ipv6-only environment.

Steps to reproduce

docker-compose -f docker-compose.yml up pact-broker # using example conf in this repo's root
curl [::1]:9292 # fails
curl 127.0.0.1:9292 # succeeds

Context

See also: https://pact-foundation.slack.com/archives/C9VPNUJR2/p1706574031623059

We're moving to ipv6-only kubernetes clusters.
We're using https://github.com/pact-foundation/pact-broker-docker via the https://github.com/pact-foundation/pact-broker-chart.
The container was failing to be reachable, because puma was only binding to the ipv4 port. We saw this by kubectl execing in and running netstat -nl:

Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:9292            0.0.0.0:*               LISTEN

This is resolved by modifying entrypoint.sh to read bundle exec puma --bind 'tcp://[::]:9292' (note: --bind 'tcp://[::]' --port 9292 does NOT work.)
Then we get:

tcp        0      0 :::9292                 :::*                    LISTEN

and everything works.
Ideally, I think puma should bind to both the ipv4 and ipv6 "any" addresses.

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