# Pmm2  MongoDB error

**URL:** <https://forums.percona.com/t/pmm2-mongodb-error/7489>\
**Category:** PMM 2.x\
**Created:** [March 29, 2020, 3:07am UTC](https://forums.percona.com/t/pmm2-mongodb-error/7489 "2020-03-29T03:07:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gajendra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/gajendra/32/44_2.png) [@Gajendra](https://forums.percona.com/u/Gajendra)\
**Post date:** [March 29, 2020, 3:07am UTC](https://forums.percona.com/t/pmm2-mongodb-error/7489/1 "2020-03-29T03:07:57Z")

</div>

Hi Team,

we are using PMM2.2 version to monitor MongoDB database but we are getting lots of messages in mongoDb log

Please let know how can i fix it .

monitoring by mongodb\_exporter user

db.getSiblingDB(“admin”).createUser({

user: “mongodb\_exporter”,

pwd: "\*\*\*\*,

roles: [

```
{ role: "clusterMonitor", db: "admin" },

{ role: "read", db: "local" }

```

]

})

pmm-admin config --server-insecure-tls --server-url=[https://admin:admin@XX.XX.XX.XX:443](https://admin:admin@XX.XX.XX.XX:443)

pmm-admin add mongodb --username mongodb\_exporter --password \*\*\*\*\* --service-name=Testm2 --query-source=none --host=127.0.0.1 --port=27017

2020-03-29T10:11:26.695+0200 I ACCESS [conn7401125] Unauthorized: not authorized on config to execute command { collStats: “system.sessions”, scale: 1, lsid: { id: UUID(“05347118-6397-4d9a-92da-bdc293d8674b”) }, $clusterTime: { clusterTime: Timestamp(1585469484, 1), signature: { hash: BinData(0, 7EFE52FC1986771F502C7A2D477FCD8ECFA1CC70), keyId: 6775416033059536897 } }, $db: “config”, $readPreference: { mode: “primaryPreferred” } }

2020-03-29T10:11:26.696+0200 I ACCESS [conn7401125] Unauthorized: not authorized on config to execute command { collStats: “system.profile”, scale: 1, lsid: { id: UUID(“05347118-6397-4d9a-92da-bdc293d8674b”) }, $clusterTime: { clusterTime: Timestamp(1585469484, 1), signature: { hash: BinData(0, 7EFE52FC1986771F502C7A2D477FCD8ECFA1CC70), keyId: 6775416033059536897 } }, $db: “config”, $readPreference: { mode: “primaryPreferred” } }

2020-03-29T10:11:26.713+0200 I ACCESS [conn7401125] Unauthorized: not authorized on customer\_ABC to execute command { collStats: “system.profile”, scale: 1, lsid: { id: UUID(“05347118-6397-4d9a-92da-bdc293d8674b”) }, $clusterTime: { clusterTime: Timestamp(1585469484, 1), signature: { hash: BinData(0, 7EFE52FC1986771F502C7A2D477FCD8ECFA1CC70), keyId: 6775416033059536897 } }, $db: “customer\_docs”, $readPreference: { mode: “primaryPreferred” } }

---

<div class="post-metadata">

**Author:** ![steve.hoffman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/steve.hoffman/32/66_2.png) [@steve.hoffman](https://forums.percona.com/u/steve.hoffman)\
**Post date:** [March 30, 2020, 8:45am UTC](https://forums.percona.com/t/pmm2-mongodb-error/7489/2 "2020-03-30T08:45:06Z")

</div>

Just to eliminate a basic typo as a possibility (it may simply have been from masking the password) but I see you have pwd: “ **, in your permissions statement, looks like that line is missing the second set of quotes to be: pwd: "** ”,

---

<div class="post-metadata">

**Author:** ![steve.hoffman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/steve.hoffman/32/66_2.png) [@steve.hoffman](https://forums.percona.com/u/steve.hoffman)\
**Post date:** [March 30, 2020, 3:39pm UTC](https://forums.percona.com/t/pmm2-mongodb-error/7489/3 "2020-03-30T15:39:05Z")

</div>

Quick Update, was able to get a mongo instance setup on my testbed and tried to grant the permissions omitting the second quote and the command won’t even complete (kind of figured that) and the fact that you were able to connect the exporter and PMM with the credentials without error says it’s not the permission step. I added the instance to my PMM (2.4) and had no issue or errors in the logs so you might want to try and upgrade to 2.4 (several great new features in there!). I will see about spinning up a container later tonight or tomorrow with 2.2 and see if I can recreate it there. Another thing to consider is if permissions changed after you set them…again, unlikely but throwing out suggestions.

---

<div class="post-metadata">

**Author:** ![Akira\_Kurogane](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/akira_kurogane/32/1280_2.png) [@Akira\_Kurogane](https://forums.percona.com/u/Akira_Kurogane)\
**Post date:** [March 30, 2020, 9:01pm UTC](https://forums.percona.com/t/pmm2-mongodb-error/7489/4 "2020-03-30T21:01:06Z")

</div>

Hi Gajendra. (And hi Steve too)

If you want to do something immediately to prevent the bloat in the mongod log files is to disable the -collect.collection option of mongodb\_exporter and start again. (And -collection.indexusage option if you are using that too.)

But to make it work with those options on the mongodb\_exporter user will have to wait for a fix, sorry. The information mentioned is in [https://jira.percona.com/browse/PMM-5351](https://jira.percona.com/browse/PMM-5351). The fix is developed, but not expected to be released until PMM 2.6 in maybe May.

---

<div class="post-metadata">

**Author:** ![Gajendra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/gajendra/32/44_2.png) [@Gajendra](https://forums.percona.com/u/Gajendra)\
**Post date:** [March 31, 2020, 3:01am UTC](https://forums.percona.com/t/pmm2-mongodb-error/7489/5 "2020-03-31T03:01:12Z")

</div>

Thanks Akira

---

<div class="post-metadata">

**Author:** ![Gajendra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/gajendra/32/44_2.png) [@Gajendra](https://forums.percona.com/u/Gajendra)\
**Post date:** [March 31, 2020, 8:36am UTC](https://forums.percona.com/t/pmm2-mongodb-error/7489/6 "2020-03-31T08:36:33Z")

</div>

Hi Akira,

Disabling collect.collection option is not working

could you please suggest me how to disable it

pmm-admin add mongodb --username mongodb\_exporter --password \*\*\*\*\* --disable-collect.collection --service-name=Testm2 --query-source=none --host=127.0.0.1 --port=27017

---

<div class="post-metadata">

**Author:** ![Gajendra](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/gajendra/32/44_2.png) [@Gajendra](https://forums.percona.com/u/Gajendra)\
**Post date:** [April 5, 2020, 11:50pm UTC](https://forums.percona.com/t/pmm2-mongodb-error/7489/7 "2020-04-05T23:50:26Z")

</div>

Hi Team,  
Please help me on this.  
Otherwise i have to downgrade my PMM2&nbsp; to pmm1.17.3  
Thanks
