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

Improvement of error message with --oplog in mongodump for a standalone node

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None

      When running mongodump with --oplog on a standalone mongod :

      mongodump --out /data/dump.27017 --oplog  --port 27017
      

      the error returned is:

      Failed: error getting oplog start: not found
      

      which comes from this section of the code.

      However, I believe the error in this line would have been more informative as in:

      return fmt.Errorf("error finding oplog: %v", err)
      

      Furthermore, looking at the verbose output of this command, I see that when it doesn't find a replica set, it assumes master/slave configuration and further assuming that it has the local.oplog.$main collection which should not have been the case with a standalone node.

      $ mongodump -vvvvvv --out /data/dump.27017 --oplog  --port 27017
      2016-09-26T13:11:22.323+0530	found databases: local, test
      2016-09-26T13:11:22.324+0530	enqueued collection 'test.coll'
      2016-09-26T13:11:22.324+0530	not connected to a replica set, assuming master/slave
      2016-09-26T13:11:22.324+0530	oplog located in local.oplog.$main
      2016-09-26T13:11:22.324+0530	dump phase I: metadata, indexes, users, roles, version
      2016-09-26T13:11:22.324+0530		reading indexes for `test.coll`
      2016-09-26T13:11:22.324+0530	not connected to a replica set, assuming master/slave
      2016-09-26T13:11:22.324+0530	oplog located in local.oplog.$main
      2016-09-26T13:11:22.324+0530	getting most recent oplog timestamp
      2016-09-26T13:11:22.324+0530	Failed: error getting oplog start: not found
      

      PS: This doesn't create any problem except users not being referred to the exact error.

            Assignee:
            Unassigned Unassigned
            Reporter:
            ankur.raina@mongodb.com Ankur Raina (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: