Mongosh can connect to my Enterprise Instance Mongodump cannot

If I attempt to log on to my instance with mongosh, e.g.
mongosh --username manager --password $MONGO_SERVER_PWD mongodb://XXXX:27017
Everything works fine.
But when I attempt to access with mongodump with
mongodump --username manager --password $MONGO_SERVER_PWD mongodb:/XXXX:27017 --db boatnet_sandbox --archive=boatnet_sandbox.20220824.archive

I get ailed: can’t create session: could not connect to server: connection() error occurred during connection handshake: auth error: sasl conversation error: unable to authenticate using mechanism “SCRAM-SHA-1”: (AuthenticationFailed) Authentication failed.

Why aren’t these behaving the same.

It looks like with mongodump your are missing one forward slash. Maybe it is simply a redaction typo. That is the major problem when things that do not work are redacted for publishing. It is a real error or a redaction error.

Authentication failed error is one of 3 things
1 - wrong username
2 - wrong password
3 - wrong authentication database/mechanism

Yes the missing slash was a cut and paste error. At the bottom is the full correct command.

I am using the same password and same username for mongosh. (Just to belay a possible distracting question, the tests were repeatedly scripted using the actual strings, so we could verify that they were the same values used.)

It would follow from the suggestion, that mongodump uses a different authentication mechanism.

Is this likely to be the case and if it is, how is this configured.

mongodump --username smontsaroff --password $MONGO_SERVER_PWD mongodb://nwcdbd26.nwfsc2.noaa.gov:27017 --db boatnet_sandbox --archive=boatnet_sandbox.20220824.archiv
2022-08-24T17:58:22.041-0700    Failed: can't create session: could not connect to server: connection() error occurred during connection handshake: auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AuthenticationFailed) Authentication failed.

Try to specify the authentication database with

2 Likes