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

in_forward plugin bind on both ipv4 and ipv6 #3001

Open
inistor opened this issue May 21, 2020 · 13 comments
Open

in_forward plugin bind on both ipv4 and ipv6 #3001

inistor opened this issue May 21, 2020 · 13 comments
Labels
enhancement Feature request or improve operations ipv6

Comments

@inistor
Copy link

inistor commented May 21, 2020

Describe the bug
While using the in_forward plugin, I’m trying to have it bind on both IPv4 and IPv6 addresses (for dual-stack systems); typically, when using. “::” for bind config parameter, the socket api will bind to both (as long as AF_INET6 is used).
However, if I use “::” for bind config parameter, an IPv6 only socket will be created.
With the default value of bind (“0.0.0.0”), an IPv4 only socket is created.

To Reproduce
Using the configuration below:

<source>
        @type forward
        bind "::"
</source>

ipv6 works

[root@centos8-ion ~]# telnet -6 localhost 24224
Trying ::1...
Connected to localhost.
Escape character is '^]'.

ipv4 does not:

[root@centos8-ion ~]# telnet -4 localhost 24224
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

A workaround is to use two sections:

<source>
        @type forward
        bind "::"
</source>
<source>
        @type forward
        bind "0.0.0.0"
</source>

Expected behavior
When binding on "::" (IPv6 name for any address), IPv4 should also be bound on any address.
Your Environment

  • Fluentd or td-agent version: fluentd --version or td-agent --version
[root@centos8-ion ~]# fluentd --version
fluentd 1.10.4
  • Operating system: cat /etc/os-release
[root@centos8-ion ~]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"
  • Kernel version: uname -r
[root@centos8-ion ~]# uname -r
4.18.0-147.8.1.el8_1.x86_64

Your Configuration

<source>
        @type forward
        bind "::"
</source>

Issue discussed on fluentd Google Group here.

@inistor
Copy link
Author

inistor commented Aug 27, 2020

Hi there,

Has anyone taken a look over the issue described above?

Thanks,
Ion

@github-actions
Copy link

This issue has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days

@github-actions github-actions bot added the stale label Dec 18, 2020
@repeatedly repeatedly added feature request *Deprecated Label* Use enhancement label in general and removed stale labels Dec 18, 2020
@inistor
Copy link
Author

inistor commented Apr 6, 2021

@repeatedly hi there; any updates here?

@minusbat
Copy link

Just found this, as hitting the same issue. No updates I assume ?

@ashie
Copy link
Member

ashie commented May 28, 2021

FYI: From #2902

Describe the solution you'd like

  • When specifying a hostname like localhost, all relevant addresses are listend/bound. For example:
irb(main):016:0> Addrinfo.getaddrinfo('localhost', 5140).select { |x| x.socktype == Socket::SOCK_DGRAM }           
=> [#<Addrinfo: [::1]:5140 UDP (localhost)>, #<Addrinfo: 127.0.0.1:5140 UDP (localhost)>]

@jaymzh
Copy link

jaymzh commented May 28, 2021

So #2902 got de-duped here, which is cool, but I wanna clarify there's 2 different use-cases being discussed:

  1. :: should be all-families, all-addresses
  2. should be all families that a name resolves to (ala comment in_forward plugin bind on both ipv4 and ipv6 #3001 (comment) where @ashie is quoting my other ticket)

The first is table-stakes, but the latter should also work.

@inistor
Copy link
Author

inistor commented May 29, 2021

Correct - the first item refers to how a numeric address is handled, while the second involves DNS resolution.

@ashie ashie added the ipv6 label Feb 25, 2022
@soostdijck
Copy link

I just ran into this on a v6 only k8s cluster. It's been a while, is this going to make the roadmap any time soon?

soostdijck added a commit to soostdijck/helm-charts-1 that referenced this issue Nov 21, 2023
Metrics must listen on ipv4 and ipv6 so that this helm chart will work in ipv6 enabled k8s clusters.

This is a implementation of a work around found in this bug:
fluent/fluentd#3001

Signed-off-by: Sjoerd Oostdijck <[email protected]>
@kenhys kenhys added enhancement Feature request or improve operations and removed feature request *Deprecated Label* Use enhancement label in general labels Jul 31, 2024
@Athishpranav2003
Copy link
Contributor

Athishpranav2003 commented Sep 28, 2024

@daipom

i guess this issue got resolved in Webrick itself as per this comment
ruby/webrick#99

But switching out of Webrick is the correct direction i guess
#4648

I am not sure if this is 100% correct but i guess this is the right way

@daipom
Copy link
Contributor

daipom commented Oct 2, 2024

@Athishpranav2003 Thanks!
So, do you think we should enhance this feature after #4648?

@Athishpranav2003
Copy link
Contributor

I guess this issue is simply solved by either #4648 or by simply updating webrick. But need to check it after the changes again

@daipom
Copy link
Contributor

daipom commented Oct 2, 2024

Fluentd uses WEBrick mainly for the RPC feature.
The server-helper does not use it.
So, WEBrick appears to have nothing to do with this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or improve operations ipv6
Projects
None yet
Development

No branches or pull requests

9 participants