Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20463

Error Code for database not found has changed for listIndexes

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.9
    • Affects Version/s: 3.1.7
    • Component/s: Sharding
    • None
    • Minor Change
    • ALL
    • Sharding A (10/09/15)

      When running the listIndexes command on a database that does not exist, the error code has changed in a sharded system. Not only that, the error code is different between a mongos and a mongod. Drivers are relying on this error code to provide an empty list to a user rather than an exception as is specified.

      3.0.5

      mongos> db.runCommand({listIndexes: "foo"})
      { "ok" : 0, "errmsg" : "no database", "code" : 26 }
      

      Latest

      2015-09-17T12:40:46.583-0500 I CONTROL  [initandlisten] db version v3.1.8-pre-
      2015-09-17T12:40:46.583-0500 I CONTROL  [initandlisten] git version: 4dc43cd451f58d59d63e1516f9b0c52f3bb1dd9d
      
      mongos> db.runCommand({listIndexes: "foo"})
      { "ok" : 0, "errmsg" : "database test not found", "code" : 60 }
      
      > db.runCommand({listIndexes: "foo"})
      { "ok" : 0, "errmsg" : "no database", "code" : 26 }
      

            Assignee:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Reporter:
            craig.wilson@mongodb.com Craig Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: