← All tasks
javaapache/flink-cdc #1934Not a task: not reproduced

[Bug][mongodb] Attempt to switch database target during SASL authentication error when using a non admin auth source and duplicated usernames.

envgap__apache__flink-cdc-1934

01 / FAILURE SIGNATURE

As reported upstream

Command failed with error 17 (ProtocolError): 'Attempt to switch database target during SASL authentication.
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
e1ee3724810942a390fb7de8a3da9da85361af60
Manifest
flink-connector-mongodb-cdc/pom.xml
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

apache/flink-cdc #1934 · read the original issue
### Search before asking



- [X] I searched in the [issues](https://github.com/ververica/flink-cdc-connectors/issues) and found nothing similar.





### Flink version



Flink 1.13.6



### Flink CDC version



2.3.0



### Database and its version



MongoDB 4.4.1



### Minimal reproduce step



1. Have multiple similar accounts (with same credentials), one in "admin" and the other in another database.

2. Intend to log in with the other account not in the "admin" database.

3. Have SASL enabled.



### What did you expect to see?



Correctly connected mongodb.



### What did you see instead?



Command failed with error 17 (ProtocolError): 'Attempt to switch database target during SASL authentication.



### Anything else?



https://jira.mongodb.org/browse/JAVA-4290



> Speculative authentication always uses "admin" as the source.

>

> In certain circumstances this can lead to a Attempt to switch database target during SASL authentication error when using > a non admin auth source and duplicated usernames.



We may upgrade the mongo driver version greater or equals than 4.3.2 to solve this problem.



### Are you willing to submit a PR?



- [X] I'm willing to submit a PR!
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]