# Cannot auto discover databases and collections (pmm-client container)

**URL:** <https://forums.percona.com/t/cannot-auto-discover-databases-and-collections-pmm-client-container/18735>\
**Category:** Percona Operator for MongoDB\
**Created:** [November 23, 2022, 11:54am UTC](https://forums.percona.com/t/cannot-auto-discover-databases-and-collections-pmm-client-container/18735 "2022-11-23T11:54:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarmo](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@tarmo](https://forums.percona.com/u/tarmo)\
**Post date:** [November 23, 2022, 11:54am UTC](https://forums.percona.com/t/cannot-auto-discover-databases-and-collections-pmm-client-container/18735/1 "2022-11-23T11:54:43Z")

</div>

Hi!

After enabling --enable-all-collectors option for pmm-client we started to notice errors like:

ERRO[2022-11-23T11:31:15.784+00:00] time=“2022-11-23T11:31:15Z” level=error msg="c  
annot auto discover databases and collections: cannot list the collections for "xxxx": cannot get t  
he list of collections for discovery: (Unauthorized) not authorized on xxxx to execute command { listCollections: 1, filter: {}, nameOnly: true, cursor: …

ERRO[2022-11-23T11:31:15.784+00:00] time=“2022-11-23T11:31:15Z” level=error msg=“c  
annot auto discover databases and collections” agentID=/agent\_id/0a9ebd20-8ef4-4da1-b4ce-4e4d82b4db4b component=  
agent-process type=mongodb\_exporter

Seems that clusterMonitor user needs some extra roles to list collections and databases.  
Tried to add { role: ‘readAnyDatabase’, db: ‘admin’ } to clusterMonitor user, but operator removes that extra role from the user.

Any ideas how to add extra roles to clusterMonitor user ?

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [November 29, 2022, 1:49pm UTC](https://forums.percona.com/t/cannot-auto-discover-databases-and-collections-pmm-client-container/18735/2 "2022-11-29T13:49:39Z")

</div>

Hey @tarmo ,

looking into it. Just to be clear, you set it through `mongodParams`, right?

```auto
  pmm:
    enabled: enable
    image: percona/pmm-client:2.30.0
    serverHost: monitoring-service
    mongodParams: --enable-all-collectors

```

---

<div class="post-metadata">

**Author:** ![tarmo](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@tarmo](https://forums.percona.com/u/tarmo)\
**Post date:** [November 29, 2022, 8:56pm UTC](https://forums.percona.com/t/cannot-auto-discover-databases-and-collections-pmm-client-container/18735/3 "2022-11-29T20:56:57Z")

</div>

Yes, I set it through `mongodParams`

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [December 2, 2022, 12:02pm UTC](https://forums.percona.com/t/cannot-auto-discover-databases-and-collections-pmm-client-container/18735/4 "2022-12-02T12:02:44Z")

</div>

We are going to address it in the following tickets:  
[https://jira.percona.com/browse/PMM-11184](https://jira.percona.com/browse/PMM-11184)  
[https://jira.percona.com/browse/K8SPSMDB-818](https://jira.percona.com/browse/K8SPSMDB-818)

Unfortunately, I cannot think of any workaround for now.

---

<div class="post-metadata">

**Author:** ![adelmo](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@adelmo](https://forums.percona.com/u/adelmo)\
**Post date:** [January 27, 2023, 10:33am UTC](https://forums.percona.com/t/cannot-auto-discover-databases-and-collections-pmm-client-container/18735/5 "2023-01-27T10:33:48Z")

</div>

Hello there! I’m having the exact same issue in 1.13.  
Our problem with this is that we cannot see any sharding related information in the MongoDb Cluster Summary dashboard, nor in the MongoDb Collection Details (experimental) dashboard.  
Is there any way to get these dashboards working without the enable-all-collectors parameter?
