Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpk fails to connect to an ipv6 admin-api address #23363

Closed
sundbry opened this issue Sep 18, 2024 · 4 comments · Fixed by #24982
Closed

rpk fails to connect to an ipv6 admin-api address #23363

sundbry opened this issue Sep 18, 2024 · 4 comments · Fixed by #24982
Labels
area/rpk kind/bug Something isn't working

Comments

@sundbry
Copy link

sundbry commented Sep 18, 2024

I am running redpanda in an ipv6 only environment, and the admin-api is listening on a private ipv6 address. I attempted to use rpc to show the cluster health.

Version & Environment

Redpanda version: (use rpk version):

rpk version
Version:     v24.1.7
Git ref:     53e6eab6ab
Build date:  2024-06-06T19:49:38Z
OS/Arch:     linux/amd64
Go version:  go1.22.2

What went wrong?

redpanda@redpanda1:/$ rpk cluster health
unable to initialize admin client: invalid host "[[fddb:1e1b:80b7:c98f:c0df:c5d3:8685:4141]]:9644" does not match "host", nor "host:port", nor "scheme://host:port"

What should have happened instead?

The IPv6 compatible host:port should take the form [fddb:1e1b:80b7:c98f:c0df:c5d3:8685:4141]:9644 and rpk should print the cluster health.

How to reproduce the issue?

redpanda.yaml

redpanda:
    data_directory: /var/lib/redpanda/data
    seed_servers: []
    rpc_server:
        address: "fddb:1e1b:80b7:c98f:c0df:c5d3:8685:4141"
        port: 33145
    kafka_api:
        - address: "fddb:1e1b:80b7:c98f:c0df:c5d3:8685:4141"
          port: 9092
    admin:
        - address: "fddb:1e1b:80b7:c98f:c0df:c5d3:8685:4141"
          port: 9644
    advertised_rpc_api:
        address: "fddb:1e1b:80b7:c98f:c0df:c5d3:8685:4141"
        port: 33145
    advertised_kafka_api:
        - address: "fddb:1e1b:80b7:c98f:c0df:c5d3:8685:4141"
          port: 9092
    developer_mode: false
    auto_create_topics_enabled: true
    fetch_reads_debounce_timeout: 10
    group_initial_rebalance_delay: 0
    group_topic_partitions: 3
    log_segment_size_min: 1
    storage_min_free_bytes: 10485760
    topic_partitions_per_shard: 1000
    write_caching_default: "true"
rpk:
    overprovisioned: false
    coredump_dir: /var/lib/redpanda/coredump
pandaproxy:
    pandaproxy_api:
        - address: "fddb:1e1b:80b7:c98f:c0df:c5d3:8685:4141"
          port: 8082
schema_registry:
    schema_registry_api:
        - address: "fddb:1e1b:80b7:c98f:c0df:c5d3:8685:4141"
          port: 8081

JIRA Link: CORE-7340

@sundbry sundbry added the kind/bug Something isn't working label Sep 18, 2024
@matthieugouel
Copy link

matthieugouel commented Nov 1, 2024

I have a similar issue by having ipv6 only kafka_api listeners.

  kafka_api:
    - address: 2a06:de00:50:cafe:100::b
      name: dmz
      port: 9092
    - address: 2a06:de00:50:cafe:10::102
      name: backend
      port: 9092

In this case I have:

redpanda@cd0e7641e750:/$ rpk cluster info
unable to initialize kafka client: invalid addr: [[2a06:de00:50:cafe:100::b]]:9092

It does not work either if I put a third listener with an ipv4 address like this:

        - address: 127.0.0.1
          name: local
          port: 9092
        - address: 2a06:de00:50:cafe:100::b
          name: dmz
          port: 9092
        - address: 2a06:de00:50:cafe:10::102
          name: backend
          port: 9092

However redpanda is working correctly, so I guess it is an rpk issue.
To be able to use rpk, I override the broker configuration like this:

rpk -X "brokers=2a06:de00:50:cafe:10::102" cluster info

Hope it helps.

@piyushredpanda
Copy link
Contributor

I don't know if we support ipv6? cc: @twmb

@sundbry
Copy link
Author

sundbry commented Jan 21, 2025

@piyushredpanda it does.
There is just a bug in the implementation of the configuration where it double-brackets the IP address. The system works fine for IPv6 in all other respects.

@piyushredpanda
Copy link
Contributor

Interesting data point, @sundbry. @mattschumpert and @twmb could perhaps then look into the rpk bits. cc: @r-vasquez too

vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Feb 4, 2025
This fixes a bug where we were adding double
brackets to IPV6 addresses.

Fixes redpanda-data#23363

(cherry picked from commit 3607a3b)
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Feb 4, 2025
This fixes a bug where we were adding double
brackets to IPV6 addresses.

Fixes redpanda-data#23363

(cherry picked from commit 3607a3b)
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Feb 4, 2025
This fixes a bug where we were adding double
brackets to IPV6 addresses.

Fixes redpanda-data#23363

(cherry picked from commit 3607a3b)
r-vasquez added a commit to r-vasquez/redpanda that referenced this issue Feb 8, 2025
This fixes a bug where we were adding double
brackets to IPV6 addresses.

Fixes redpanda-data#23363

(cherry picked from commit 3607a3b)

Manually edited as the RpkNodeConfig does not
have the SR struct in older versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rpk kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants