Description
The following Error might be observed when using MongoDB Atlas Source Connector on Confluent Cloud
The connector failed with Unauthorized error. Please ensure that the user is authorized to open/resume change streams.
Applies To
MongoDB Atlas Source Connector
Confluent Cloud
Cause
The error message indicates a permission issue with the MongoDB Atlas Source Connector. This error typically occurs when the user account configured for the connector does not have the necessary permissions to open or resume change streams in MongoDB.
Resolution
Here are some steps to troubleshoot and resolve this issue -->
1. Verify User/Role Permissions: Ensure that the MongoDB user/role configured for the connector has the appropriate permissions. To ensure that the user or the role assigned to the user has the appropriate privileges to access the necessary collections and databases, the user/role should have the following privileges ->
- Read: The user needs read access to the collections from which the source connector will read data.
-
Change Stream and find: The user needs the
changeStream
andfind
privileges on the relevant database or collections to listen for changes, see Query and Write Actions.
Here is an example of a role that grants these privileges, which you may work alongside your MongoDB Admin to ensure the right role privileges are assigned to the user.
{ |
Replace yourDatabase
and yourCollection
with the actual database and collection names you are using. Assign this role to the user that your MongoDB Atlas source connector will use to connect to MongoDB.