Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-3541

mongodump should generate an error when connecting to Atlas using a non-existent DB name

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Tools and Replicator
    • 114

      Problem Statement/Rationale

      When using mongodump to connect to an Atlas cluster, and using a non-existent DB for the --db parameter, mongodump does not generate any export files or error message, but appears to simply run silently and do nothing.

      Steps to Reproduce

      I reproduced this with a command of the below format:

      mongodump --uri="CONNECTIONSTRING" --db DB NAME --out ./ --username USERNAME

      Running this against my local mongod install:

      mongodump --uri="mongodb://localhost:27017/db2" --db db2 --out ./ --username mongodump

      I get errors if I use a non-exists DB name:

      Failed: can't create session: failed to connect to mongodb://localhost:27017/db2: connection() error occurred during connection handshake: auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AuthenticationFailed) Authentication failed.

      I believe this is because the DB name (in this case db2, which does not exist) must be included in the connection string, whereas the connection string does not contain the DB name when connecting to Atlas.

      If I run a similar command against my Atlas cluster (note that the DB sample_nflix does not exist. The correct DB name is sample_mflix):

      mongodump --uri="mongodb+srv://cluster0.cnbzdp5.mongodb.net/" --db sample_nflix --out ./ --username mongodump

      mongodump simply runs and generates no files or errors:

       

      josh.mcshane@M-HJQ7TV6FRV Desktop % mongodump --uri="mongodb+srv://cluster0.cnbzdp5.mongodb.net/" --db sample_nflix --out ./ --username mongodump
      Enter password for mongo user:
      josh.mcshane@M-HJQ7TV6FRV Desktop %
      

       

      Expected Results

      mongodump should generate an error when connecting to Atlas using a non-existent DB name.

      Actual Results

      mongodump appears to fail silently when connecting to Atlas using a non-existent DB name.

      Additional Notes

      This was identified based on a customer encountering this issue: https://support.mongodb.com/case/01310377 They opened a support request as they could not identify the source of the silent failure (incorrect DB name).

      Adding an error message or other alert would deflect new cases for this issue.

      Creating TOOLS ticket based on recommendation here: https://jira.mongodb.org/plugins/servlet/desk/portal/13/HELP-59265

            Assignee:
            Unassigned Unassigned
            Reporter:
            josh.mcshane@mongodb.com Josh McShane
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: