...
Problem Statement/Rationale running follow command ``` mongoexport --host dbhost --port 27017 --db=mms-service --collection=document --type=csv --fields=_id --query='{}' --limit 10 --out exported.csv -u=user.name --authenticationDatabase admin ``` but i get an error ``` could not connect to server: connection() error occured during connection handshake: handshake failure: username must contain a '.' separated database.user pair ``` what is the meaning of the error, it is the issue of the username, a dot in the username? i also try to add quote to the username: "user.name", 'user.name', same error Steps to Reproduce use mongo/mongoexport to connect to the db Expected Results login the db successfully Actual Results login failed Additional Notes 1, also try mongo command, same error ``` mongo "mongodb://user.name:password@db-host:27017/?authSource=admin" mongo --host dbhost --port 27017 -u user.name -p password --authenticationDatabase admin ``` error message: ``` MongoDB shell version v4.4.13 connecting to: mongodb://dbhost:27017/authSource=admin&compressors=disabled&gssapiServiceName=mongodb Error: username must contain a '.' separated database.user pair : connect@src/mongo/shell/mongo.js:374:17 @(connect):2:6 exception: connect failed exiting with code 1 ``` 2, connect the db without auth, then auth by db.auth(), in this way, i can login into the db ``` mongo --host dbhost -p 27017 db.auth("user.name", "password") – the quote required user dbname show collections ``` it show the collections.
JIRAUSER1265262 commented on Tue, 17 May 2022 18:33:03 +0000: Hello Huang, We haven’t heard back from you for some time, so I’m going to close this ticket. If this is still an issue for you, please provide additional information and we will reopen the ticket. Regards, Christopher JIRAUSER1265262 commented on Mon, 9 May 2022 19:01:19 +0000: Hello Huang, We still need additional information to diagnose the problem. If this is still an issue for you, would you please: Upload your mongo.log file covering the time period in which you attempt to log in from the command line and receive this error Point out the timestamp around when you get the error Your secure upload portal link is accessible here. Regards, Christopher JIRAUSER1265262 commented on Thu, 7 Apr 2022 17:30:12 +0000: Hello huang.teng@gloritysolutions.com, I attempted to replicate your issue on MongoDB v4.4.13 (running shell version v.4.4.13) by creating a user called “test.user” on the “admin” db. I was able to connect successfully via the command line using all of the methods you proposed (creating a db/collection to mimic your case): mongo "mongodb://user.name:password@db-host:27017/?authSource=admin" mongo --host dbhost --port 27017 -u user.name -p password --authenticationDatabase admin mongoexport --host dbhost --port 27017 --db=mms-service --collection=document --type=csv --fields=_id --query='{}' --limit 10 --out exported.csv -u=user.name --authenticationDatabase admin Because I don’t see this issue on my end when using “.” in the username, both with and without quotes, I’m not certain that’s what the problem is. If there are steps in your reproduction that I may be missing, please let me know. Otherwise, in order to look into this further, please help me with the following: Upload your mongo.log file covering the time period in which you attempt to log in from the command line and receive this error Point out the timestamp around when you get the error I've created a secure upload portal for you. Files uploaded to this portal are visible only to MongoDB employees and are routinely deleted after some time. Regards, Christopher