apache / apache/couchdb

IPv6 cluster

Open
#3,973 3 comments 1 reaction 0 assignees View on GitHub
bug needs-triage waiting on user
Dominant language
Erlang
Stars
7k
Forks
1.1k
Avg merge
1d 16h
Merged PRs (30d)
9

Description

I cannot setup a IPv6 cluster, because the `_cluster_setup` action `add_node` doesn't accept IPv6.

```
curl -H 'Content-type: application/json' "admin:password@host1.vlan0:5984/_cluster_setup" -d '{"action": "add_node", "host":"host2.vlan0", "port": 5984, "username": "admin", "password":"password"}' | jq
{
"error": "invalid_ejson",
"reason": "{conn_failed,{error,nxdomain}}",
"ref": 878456848
}
```

* `host1.vlan0` resolves (AAAA) to an address similar to `abcd:1234:abcd:1234:abcd:123:abcd:1`
* `host2.vlan0` resolves (AAAA) to an address similar to `abcd:1234:abcd:1234:abcd:123:abcd:2`

When trying to set the "host" to the IPv6 address, I get:

```
{
"error": "invalid_ejson",
"reason": "{url_parsing_failed,{error,invalid_uri}}",
"ref": 878456848
}
```

I also try to include the IPv6 between `[ ]` (thinking maybe couchdb tries to setup a URL like `http://{ host }:{ port }`) ... but it fails with the same error as if I used an hostname (`error, nxdomain`). (I wonder if there's a regex figuring out if the thing is an IP that only matches IPv4?)

*Note*: another hiccup was that `apache.jfrog.io` does not resolve in IPv6 (solved by downloading and copying the deb file manually... meh). But that's a different issue.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the `_cluster_setup` `add_node` request using the hostname and IPv6 forms shown in the issue, including bracketed addresses. Trace the host parsing and connection path implicated by the `invalid_uri` and `nxdomain` errors; done means adding a node to an IPv6 cluster succeeds without those errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
databases, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.