[pkg-go] Bug#942871: prometheus-mongodb-exporter: segfaults with mongodb 4.2

Santiago Vila sanvila at unex.es
Tue Oct 22 16:40:17 BST 2019


Package: prometheus-mongodb-exporter
Version: 1.0.0+git20180522.e755a44-1
Severity: important
Tags: patch

Dear maintainer:

On a replica set where mongodb 4.0 and prometheus-mongodb-exporter used
to work ok, an upgrade to mongodb 4.2 makes prometheus-mongodb-exporter
to crash as soon as a request from prometheus is received:

prometheus-mongodb-exporter.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
prometheus-mongodb-exporter.service: Unit entered failed state.
prometheus-mongodb-exporter.service: Failed with result 'exit-code'.
prometheus-mongodb-exporter.service: Service hold-off time over, scheduling restart.

My /etc/default/prometheus-mongodb-exporter is like this:

ARGS='-mongodb.uri="mongodb://user:password@localhost:27017" -log_dir /var/log/prometheus -web.listen-address :9201'

And this is what I do to trigger a segfault:

curl localhost:9201/metrics


I found a solution here:

https://www.bountysource.com/issues/65886524-nil-pointer-panic-when-monitoring-a-mongodb-with-no-username-and-password-set

The attached patch, based on the post above, solves the problem for
me, and I believe it is otherwise harmless for anybody who does not
have the problem. I tested it by applying the patch to the package in
stretch-backports.

Maybe another option would be to switch to this upstream which is said
to be more up-to-date:

https://github.com/percona/mongodb_exporter

but I have not tested it.

Thanks.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: prometheus-mongodb-exporter.diff.txt
URL: <http://alioth-lists.debian.net/pipermail/pkg-go-maintainers/attachments/20191022/ed199e17/attachment-0001.txt>


More information about the Pkg-go-maintainers mailing list