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

Empty "raw" error from mongos when a shard has no primary or is down

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.9, 2.6.4
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL

      Start a sharded cluster of two-member replica sets and kill a primary, so one of the shards has only a secondary. Run 'dbstats' on a database, mongos responds:

      {
      	"raw" : {
      		"shard0/localhost:4000,localhost:4001" : {
      
      		}
      	},
      	"ok" : 0,
      	"errmsg" : "{ shard0/localhost:4000,localhost:4001: \"result without error message returned : {}\" }"
      }
      

      This seems like an unclear error message, and the "raw" error document is empty, which is unlike most other error structures from mongos.

      Tested with 2.4.9 and 2.6.4. Same behavior if all members of the shard are down, not just the primary.

      Drivers may need to be updated now if they don't expect an empty error document in "raw" (see PYTHON-766, PyMongo throws an exception trying to parse this error), and they may need validation that they can parse the corrected error message if mongos is updated to return a different error in this scenario.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: