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

Telegraf getting "protocol wrong type for socket" error while trying to connect to powerdns-recursor socket #12252

Closed
rumato163 opened this issue Nov 16, 2022 · 1 comment · Fixed by #9633
Labels
bug unexpected problem or unintended behavior help wanted Request for community participation, code, contribution size/m 2-4 day effort

Comments

@rumato163
Copy link

Relevant telegraf.conf

[global_tags]

[agent]
  interval                                   = "30s"
  round_interval                             = false
  metric_batch_size                          = 1000
  metric_buffer_limit                        = 10000
  collection_jitter                          = "1s"
  flush_interval                             = "30s"
  flush_jitter                               = "0s"
  precision                                  = ""
  debug                                      = false
  quiet                                      = false
  logfile                                    = "/var/log/telegraf/telegraf_pdns.log"
  omit_hostname                              = true

[[inputs.powerdns_recursor]]
  unix_sockets = ["/var/run/pdns-recursor/pdns_recursor.controlsocket"]
  socket_dir = "/var/run/pdns-recursor"

Logs from Telegraf

2022-11-16T18:06:30Z E! [inputs.powerdns_recursor] Error in plugin: dial unixgram /var/run/pdns-recursor/pdns_recursor_telegraf5655722885986422923->/var/run/pdns-recursor/pdns_recursor.controlsocket: connect: protocol wrong type for socket
2022-11-16T18:06:59Z E! [inputs.powerdns_recursor] Error in plugin: dial unixgram /var/run/pdns-recursor/pdns_recursor_telegraf7462219148622404987->/var/run/pdns-recursor/pdns_recursor.controlsocket: connect: protocol wrong type for socket
2022-11-16T18:07:29Z E! [inputs.powerdns_recursor] Error in plugin: dial unixgram /var/run/pdns-recursor/pdns_recursor_telegraf8389597005953665423->/var/run/pdns-recursor/pdns_recursor.controlsocket: connect: protocol wrong type for socket
2022-11-16T18:07:59Z E! [inputs.powerdns_recursor] Error in plugin: dial unixgram /var/run/pdns-recursor/pdns_recursor_telegraf7230448861768785540->/var/run/pdns-recursor/pdns_recursor.controlsocket: connect: protocol wrong type for socket

System info

gentoo Linux 5.15.26-gentoo

Docker

No response

Steps to reproduce

  1. Install powerdns-recursor >=4.5.X version and run it with all the necessary steps to grant telegraf user access rights to socket directory and socket itself
  2. Install telegraf
  3. Configure inputs.powerdns-recursor plugin as it show in README
  4. Try to get metrics with telegraf
  5. Get "connect: protocol wrong type for socket" error

Expected behavior

Be able to get all necessary metrics listed in README

Actual behavior

Getting "connect: protocol wrong type for socket" error instead

Additional info

No response

@rumato163 rumato163 added the bug unexpected problem or unintended behavior label Nov 16, 2022
@powersj
Copy link
Contributor

powersj commented Nov 16, 2022

I can reproduce using a Ubuntu 22.04 LTS LXD:

2022-11-16T19:11:37Z E! [inputs.powerdns_recursor] Error in plugin: dial unixgram /var/run/pdns-recursor/pdns_recursor_telegraf5246241964455496166->/var/run/pdns-recursor/pdns_recursor.controlsocket: connect: protocol wrong type for socket

It looks like we need #9633 to land due to a changes in pdns.

next steps: review that PR and see what needs to happen to wrap it up

@powersj powersj added help wanted Request for community participation, code, contribution size/m 2-4 day effort labels Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior help wanted Request for community participation, code, contribution size/m 2-4 day effort
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants