[LangChain] MongoDBDatabase init permissions error

XMLWordPrintableJSON

    • 🔵 Done
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • 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.

            Assignee:
            Casey Clements
            Reporter:
            Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: