Problem connecting to a MongoDB Atlas cluster

Feature(s) impacted

MongoDB Atlas connection

Observed behavior

I’m attempting to set up a MongoDB Atlas connection as part of my first project. I’ve set up a user, whitelisted IPs and looks to be connecting to the cluster and db, but then reports an error about access to “system.views”.

The user connecting has read/write access to all databases. I’ve even tried giving the user DB admin privileges, but nothing works.

Expected behavior

Connect to the cluster.

Failure Logs

Agent failed to extract the list of tables, columns, and relations: not authorized on local to execute command { listCollections: 1, filter: {}, cursor: {}, nameOnly: true, authorizedCollections: false, lsid: { id: UUID("7e80af7f-da99-42dc-8ea1-2770f2cade41") }, $clusterTime: { clusterTime: Timestamp(1721312684, 1), signature: { hash: BinData(0, 346E50250B0FB614AA72F1850C6CF57C9C87A722), keyId: 7346620789069709314 } }, $db: "my_db" }

Context

I can’t really provide any of these, because this is blocking me from setting up a project.

  • Project name: …
  • Team name: …
  • Environment name: …
  • Agent technology: (nodejs, php, rails, python)
  • Agent (forest package) name & version: …
  • Database type: …
  • Recent changes made on your end if any: …

Hello @philp, and welcome to our community.

I have tried reproducing your issue but did not manage.
I used the mongo db atlas free tier with sample_mflix database as sample data and was able to connect the agent successfully.

where did you get the system.views error ? I cannot find it in the provided failure logs.
Does your mongo database contain any views ?

I get the error when trying to connect.

The only different I’ve noticed is that if I try to connect to a new database, I don’t receive the error. However, I need to connect to an existing database, so don’t have the option of starting fresh.

Indeed, I understand.
It seems like the problem is coming from a particular feature of your database schema/config which causes an issue with the agent connectivity.

The end of error that you are mentionning seems to be coming from mongo directly.

The agent uses the mongo command collections to find the list of collections of your database, which triggers a listCollections command.
Can you ensure that the user input in the form has the right to perform this command, for instance by using a simple mongodb client ?

I get the error when trying to connect.

What did you put in the failure log section then ? Did you get 2 different errors ?