Collectd: write_prometheus plugin fails with "MHD_start_daemon() failed" (on version 5.7.2.44)

Created on 10 Oct 2017  路  11Comments  路  Source: collectd/collectd

  • Version of collectd: 5.7.2.44.gbe906f9
  • Operating system / distribution: Debian/wheezy

This last update (5.7.2.44.gbe906f9) makes the write_prometheus fail.
On the previous version (I had 5.7.2.37.g45492ba) it worked perfectly.

The logs only show this:

[2017-10-10 18:35:52] plugin_load: plugin "write_prometheus" successfully loaded.
[2017-10-10 18:35:52] write_prometheus plugin: MHD_start_daemon() failed.
[2017-10-10 18:35:52] write_prometheus plugin: MHD_start_daemon() failed.
[2017-10-10 18:35:52] Initialization of plugin `write_prometheus' failed with status -1. Plugin will be unloaded.
[2017-10-10 18:35:52] plugin_unregister_read: No such read function: write_prometheus
[2017-10-10 18:35:52] Error: one or more plugin init callbacks failed.

Steps to reproduce

  • activate write_prometheus plugin

I will be glad to help (just don't know what to do)

Bug Pending feedback

Most helpful comment

It is related to SELinux

All 11 comments

Judging from the commit range, this is a regression introduced in #2466.

Hi @tcarreira, thanks for reporting this! Could you please provide the version of libmicrohttpd you're using? E.g. the output of:

apt-cache policy libmicrohttpd-dev

Sure!

# apt-cache policy libmicrohttpd-dev
libmicrohttpd-dev:
  Installed: 0.9.20-1+deb7u1

Thanks! Could you try running collectd in the foreground (collectd -f) to see if the HTTP library we use logs anything to STDERR?

There is nothing relevant in the output:

# collectd -C /etc/collectd/collectd.conf -f
option = Hostname; value = xxxx;
option = FQDNLookup; value = false;
Done parsing `/usr/share/collectd/types.db'
option = Interval; value = 60.000000;
option = Timeout; value = 2.000000;
option = ReadThreads; value = 5.000000;
option = WriteThreads; value = 5.000000;
Created new plugin context.
[2017-10-10 23:07:13] plugin_load: plugin "logfile" successfully loaded.
[2017-10-10 23:07:13] type = logfile, key = LogLevel, value = info

And it is just this.
Even if I change the log level to debug, there is nothing about this error (just what I reported)

@tcarreira Thanks for that! It's quite possible that libmicrohttpd only logs anything if the MHD_USE_DEBUG is set. Could you give #2476 a shot to see if that surfaces anything useful?

Well, it did change nothing.

(the logfile plugin is sending to STDOUT now, and LogLevel is debug)

# /opt/collectd/sbin/collectd -C /opt/collectd/etc/collectd.conf -f
[2017-10-11 09:38:27] plugin_load: plugin "logfile" successfully loaded.
[2017-10-11 09:38:27] logfile: invalid loglevel [debug] defaulting to 'info'
[2017-10-11 09:38:27] [info] plugin_load: plugin "cpu" successfully loaded.
[2017-10-11 09:38:27] [info] plugin_load: plugin "interface" successfully loaded.
[2017-10-11 09:38:27] [info] plugin_load: plugin "load" successfully loaded.
[2017-10-11 09:38:27] [info] plugin_load: plugin "memory" successfully loaded.
[2017-10-11 09:38:27] [info] plugin_load: plugin "network" successfully loaded.
[2017-10-11 09:38:27] [info] plugin_load: plugin "write_prometheus" successfully loaded.
[2017-10-11 09:38:27] [error] write_prometheus plugin: MHD_start_daemon() failed.
[2017-10-11 09:38:27] [error] write_prometheus plugin: MHD_start_daemon() failed.
[2017-10-11 09:38:27] [error] Initialization of plugin `write_prometheus' failed with status -1. Plugin will be unloaded.
[2017-10-11 09:38:27] [warning] plugin_unregister_read: No such read function: write_prometheus
[2017-10-11 09:38:27] [error] Error: one or more plugin init callbacks failed.
[2017-10-11 09:38:27] [info] Initialization complete, entering read-loop.

@octo Would you give this fix a try? https://github.com/collectd/collectd/pull/2481
Looks very simple. Would you be able to hotfix it?

thanks

Fixed by #2481, thanks @tcarreira!

It is related to SELinux

@mojili can you give us some more context? I was under the impression that #2481 identified and fixed the problem.

Best regards,
鈥攐cto

Was this page helpful?
0 / 5 - 0 ratings

Related issues

octo picture octo  路  38Comments

jblaine picture jblaine  路  9Comments

catamphetamine picture catamphetamine  路  3Comments

faxm0dem picture faxm0dem  路  11Comments

klausman picture klausman  路  13Comments