Skip to content

Typesense sink fails on IPv6-only Fly.io .internal hosts due to Finch pool missing inet6 transport opts #2146

Description

@uncvrd

Hi there, I am absolutely not an Elixir expert but I've been tinkering around trying to get Sequin deployed on Fly.io and I think I ran in to an ipv6 issue? See my exploration below...

Sequin’s Typesense sink fails to connect to a Typesense service on Fly.io private networking when the endpoint is an IPv6-only .internal hostname.

Fly.io .internal hostnames resolve to AAAA/6PN addresses only. In this setup, curl from the same Sequin machine succeeds, and Erlang can resolve/connect over IPv6 when explicitly told to use :inet6, but Sequin’s Req/Finch HTTP path fails with :nxdomain.

For example I see this

curl -sv "http://foundry-staging-typesense-v2.internal:8080/health"

IPv6: fdaa:0:3735:a7b:2ef:d5a3:2347:2
Connected ...
{"ok":true}

And then from erlang?

/home/app/prod/rel/sequin/bin/sequin rpc ':inet_res.lookup(~c"foundry-staging-typesense-v2.internal", :in, :a) |> IO.inspect()'
# []

/home/app/prod/rel/sequin/bin/sequin rpc ':inet_res.lookup(~c"foundry-staging-typesense-v2.internal", :in, :aaaa) |> IO.inspect()'
# [{64938, 0, 14133, 2683, 751, 54691, 9031, 2}]

As a result, when trying to connect I see

[Typesense] Failed to get collection: non-existing domain

Where the sink itself shows

[typesense]: Transport error: non-existing domain

Sequin configures a shared Finch pool via Sequin.Finch. The pool appears to be configured with only pool size/count, without IPv6 transport options.

For AAAA-only hosts, Finch needs IPv6 transport options

inet6: true

or Finch-level:

conn_opts: [transport_opts: [inet6: true]]

Because Sequin globally sets finch: Sequin.Finch, users cannot work around this per request with Req connect_options; Req rejects using both :finch and :connect_options.

So...is it feasible to add the inet6 option to the pool like this? Assuming this is correct?

pools = %{
  default: [
    size: pool_size,
    count: config!(:pool_count),
    conn_opts: [transport_opts: [inet6: true]] <---- this?
  ]
}

Edit: obviously this would fail for other sinks it's just the sink I was trying to build with currently

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions