Xuzhengz opened a new issue, #5268:
URL: https://github.com/apache/seatunnel/issues/5268

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   MongoDb认证始终使用admin数据库登录导致认证失败,但当前配置的不是admin数据库
   
   ### SeaTunnel Version
   
   2.3.3-dev
   
   ### SeaTunnel Config
   
   ```conf
   env {
     # You can set engine configuration here
     execution.parallelism = 1
     job.mode = "STREAMING"
     execution.checkpoint.interval = 5000
   }
   
   source {
     MongoDB-CDC {
       hosts = "172.16.8.205:37017,172.16.8.205:37018,172.16.8.205:37019"
       database = ["cdc"]
       collection = ["cdc.data3_1min"]
       username = stuser
       password = ******
       startup.mode = initial
       schema = {
         fields {
           "id" : bigint,
           "idStr" : string,
           "name" : string,
           "passwd" : string,
           "sfz" : string,
           "phone" : string,
           "bankCard" : string
         }
       }
     }
   }
   
   # Console printing of the read Mongodb data
   sink {
     Console {
       parallelism = 1
     }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   seatunnel.sh -c job.conf
   ```
   
   
   ### Error Exception
   
   ```log
   Caused by: org.apache.seatunnel.common.utils.SeaTunnelException: 
com.mongodb.MongoSecurityException: Exception authenticating 
MongoCredential{mechanism=SCRAM-SHA-1, userName='stuser', source='admin', 
password=<hidden>, mechanismProperties=<hidden>}
   
   Caused by: com.mongodb.MongoCommandException: Command failed with error 18 
(AuthenticationFailed): 'Authentication failed.' on server 172.16.8.205:37017. 
The full response is {"operationTime": {"$timestamp": {"t": 1691651820, "i": 
1}}, "ok": 0.0, "errmsg": "Authentication failed.", "code": 18, "codeName": 
"AuthenticationFailed", "$clusterTime": {"clusterTime": {"$timestamp": {"t": 
1691651820, "i": 1}}, "signature": {"hash": {"$binary": {"base64": 
"q8d8d7iXechCxLrnjlz5+0Ku1M0=", "subType": "00"}}, "keyId": 
7265571419004600324}}}
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   1.8
   
   ### Screenshots
   
   <img width="1219" alt="image" 
src="https://github.com/apache/seatunnel/assets/90698333/e7fe17c7-b51f-4f17-9cc0-55ff61657daf";>
   
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to