-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Unknown
-
Affects Version/s: None
-
Component/s: LangChain
-
None
-
🔵 Done
-
Python Drivers
-
Not Needed
-
-
None
-
None
-
None
-
None
-
None
-
None
As reported in https://github.com/langchain-ai/langchain-mongodb/issues/225.
If the user does not have permissions to list all collections, the server can raise an Unauthorized Error, for example:
pymongo.errors.OperationFailure: not authorized on spd_api to execute command { listCollections: 1, cursor: {}, nameOnly: true, lsid: { id: UUID("00081a67-4074-403c-95f4-be38f0c2f566") }, $db: "spd_api" }, full error: {'ok': 0.0, 'errmsg': 'not authorized on spd_api to execute command { listCollections: 1, cursor: {}, nameOnly: true, lsid: { id: UUID("00081a67-4074-403c-95f4-be38f0c2f566") }, $db: "spd_api" }', 'code': 13, 'codeName': 'Unauthorized'}
The reporter, GitHub user rafaelodon, has created a fix.