telegraf v1.12.0 mongodb input plugin executes listCollections even when gather_col_stats=false with clusterMonitor role #6362
Labels
area/mongodb
bug
unexpected problem or unintended behavior
regression
something that used to work, but is now broken
Milestone
Relevant telegraf.conf:
System info:
https://dl.influxdata.com/telegraf/releases/telegraf-1.12.0-1.x86_64.rpm - NOT OK
https://dl.influxdata.com/telegraf/releases/telegraf-1.11.5-1.x86_64.rpm - OK
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2018.03
Steps to reproduce:
Expected behavior:
By default the built-in clusterMonitor mongodb role doesn't allow listCollections command. It shouldn't be used when gather_col_stats = false or document the way how to setup correct user roles in the mongodb server.
https://docs.mongodb.com/manual/reference/built-in-roles/#clusterMonitor
Actual behavior:
It works with older versions of telegraf except 1.12.0.
2019-09-06T14:57:40Z E! [inputs.mongodb] Error getting collection names: not authorized on admin to execute command { listCollections: 1, cursor: { batchSize: 0 }, $readPreference: { mode: "secondaryPreferred" }, $db: "admin" }
2019-09-06T14:57:40Z E! [inputs.mongodb] Error getting collection names: not authorized on tripmarket-worker to execute command { listCollections: 1, cursor: { batchSize: 0 }, $readPreference: { mode: "secondaryPreferred" }, $db: "tripmarket-worker" }
Additional info:
telegraf user was created as usual using:
The text was updated successfully, but these errors were encountered: