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

Plugin network with "Listen" reports getnameinfo failed and does not collect data from clients #3477

Closed
fabianwenk opened this issue Jun 6, 2020 · 6 comments

Comments

@fabianwenk
Copy link

fabianwenk commented Jun 6, 2020

  • Version of collectd: 5.11.0
  • Operating system / distribution: FreeBSD 11.3-RELEASE-p9
  • Kernel version (if applicable):

Expected behavior

Collecting data a remote clients sends.

Actual behavior

Data gets not collected and instead the error messages "network plugin: getnameinfo failed: Non-recoverable failure in name resolution" is logged.

Steps to reproduce

Install collectd 5.11.0 from FreeBSD port net-mgmt/collectd5 and setup Plugin network with listen on a IPv4 or IPv6 address or both. Configure an additional client which sends data to this server.

The error message does suggest that resolving does not work, but all the systems which send data to my servers have proper PTR entries in DNS and do resolve from IP to hostname and hostname to IP.

With reverting the pull request #3191 I got collected 5.11.0 working on FreeBSD.

FreeBSD bug report 247036 at: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247036

@ashie
Copy link
Contributor

ashie commented Jul 2, 2020

getnameinfo failed: Non-recoverable failure in name resolution"

It means that getnameinfo returns EAI_FAIL.
Although I'm not sure which case returns such error, we shouldn't drop recieved metrics even if such error is occurred.

@fabianwenk
Copy link
Author

In the meantime the ticket at FreeBSD got some updates, including my configuration, if this may be helpful. And I also did add this information as well:

Some other thing which I had forgotten to mention, but may be a problem. The host names used in server and listen (on both collectors) resolve to a IPv6 address, e.g. collectd.home4u.ch to 2001:8a8:1005:1::2. But in return 2001:8a8:1005:1::2 resolves to batman.home4u.ch. And then batman.home4u.ch does resolve to 2x IPv4 (62.12.173.2 and 62.2.85.178) and 2x IPv6 (2001:8a8:1005:1::2 and 2001:8a8:1005:2::178) addresses.

I have systems running with this dual (quadruple) IP configuration since many years and I did not yet had any difficulties with that so far. Maybe it helps in resolving this.

@ashie
Copy link
Contributor

ashie commented Jul 17, 2020

I read the implementation of getnameinfo(3) of FreeBSD:
https://github.com/freebsd/freebsd/blob/cb0ef80502174516118ddcae9a38508665679fbb/lib/libc/net/getnameinfo.c#L115

It returns EAI_FAIL only when the first argument (const struct sockaddr *sa) is NULL.
Hmm, it's strange, collectd never passes NULL to it:

collectd/src/network.c

Lines 444 to 448 in 41b1e33

if (address != NULL) {
char host[48];
status = getnameinfo((struct sockaddr *)address,
sizeof(struct sockaddr_storage), host, sizeof(host),
NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV);

@wtps0n
Copy link

wtps0n commented Sep 23, 2020

Problem exists in FreeBSD 11.4. As you can see https://github.com/freebsd/freebsd/blob/releng/11.3/lib/libc/net/getnameinfo.c EAI_FAIL is returned more then one case. So maybe that's the clue with problem?

And there is dual stack (IPv4/IPv6). Also fwd dns and rev dns differ...

@ashie
Copy link
Contributor

ashie commented Sep 23, 2020

Problem exists in FreeBSD 11.4. As you can see https://github.com/freebsd/freebsd/blob/releng/11.3/lib/libc/net/getnameinfo.c EAI_FAIL is returned more then one case. So maybe that's the clue with problem?

Ah I see. Thanks!

@fabianwenk
Copy link
Author

Sorry for the long delay, I forgot that this bug still exists. I did upgrade my systems to FreeBSD 12.x a long time ago and all is fine now. As FreeBSD 11.x is not supported any more, I will close this bug now.

Thanks for all who helped.

Best regards,
Fabian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants