#1120510 prometheus-blackbox-exporter: Error in "/etc/init.d/prometheus-blackbox-exporter" in function "config_check()"

Package:
prometheus-blackbox-exporter
Source:
prometheus-blackbox-exporter
Description:
blackbox prober for Prometheus
Submitter:
Matthias
Date:
2025-11-11 12:45:02 UTC
Severity:
normal
#1120510#5
Date:
2025-11-11 12:42:43 UTC
From:
To:
Dear Maintainer,

I am using MX Linux 23.6, which is based on Debian 12.12.
I have installed the "prometheus-blackbox-exporter" and "prometheus" packages.

When I execute the following command, I get approximately the following error
message.

$ service prometheus-blackbox-exporter start
 failed!
Configuration test failed. Output of config test was:
Checking /etc/prometheus/blackbox.yml
  FAILED: parsing YAML file /etc/prometheus/blackbox.yml: yaml: unmarshal
errors:  line 49: field modules not found in type config.plain


As far as I understand the problem, it is not the configuration file
blackbox.yml, but rather the command that is supposed to check the
configuration file.

The “service” command accesses the file “/etc/init.d/prometheus-blackbox-
exporter”.
To start the service, the function do_start_prepare() is executed, which in
turn executes the function config_check(). In this function, the command
“promtool” is executed, which checks the configuration file
CFGFILE=/etc/prometheus/blackbox.yml.
The problem is that the promtool program, which is designed to check the
prometheus configuration, checks the configuration of the prometheus-blackbox-
exporter. But they are different programs with different configuration files.


My suggestion is to change the following line:
----------------------------------------------------
packet: prometheus-blackbox-exporter_0.23.0-4+b4_amd64.deb

Faulty line 35: errors="$(/usr/bin/promtool check config $CFGFILE 2>&1)" ||
retcode=$?
Corrected line: errors="$(/usr/bin/prometheus-blackbox-exporter --config.check
--config.file  $CFGFILE 2>&1)" || retcode=$?

It would be nice if the following text were also displayed in the event of an
error. (After Line 39: echo "$errors" >&2)
Use the command prometheus-blackbox-exporter --config.check to check the
configuration file.


Best regards
Matthias