Debezium MongoDB Connector shows the error: Command failed with error 13 (Unauthorized): 'not authorized on admin to execute command
Issue
- 
The Debezium MongoDB Connector encounters an error with the following exception:
org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped. io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:50) io.debezium.connector.mongodb.MongoDbStreamingChangeEventSource.execute(MongoDbStreamingChangeEventSource.java:103) io.debezium.connector.mongodb.MongoDbStreamingChangeEventSource.execute(MongoDbStreamingChangeEventSource.java:59) .... java.base/java.lang.Thread.run(Thread.java:829)\nCaused by: org.apache.kafka.connect.errors.ConnectException: Error while attempting to read from oplog on 'PD/localhost:27017' .... Caused by: com.mongodb.MongoCommandException: Command failed with error 13 (Unauthorized): 'not authorized on admin to execute command. 
Environment
- Debezium 1.9.5.Final
 - Red Hat OpenShift Container (Openshift) 4
 
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.