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

balancerCollectionStatus command fails with Unauthorized when using db.adminCommand

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.0-rc0, 4.7.0
    • Affects Version/s: 4.3.3
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Hide
      • Set up a sharded cluster
      • Enable auth
      • Try the balancerCollectionStatus using db.adminCommand as an administrator

       

      Show
      Set up a sharded cluster Enable auth Try the balancerCollectionStatus using db.adminCommand as an administrator  

      When using db.adminCommand the balancerCollectionStatus command fails:

       

      mongos> db.adminCommand({balancerCollectionStatus:'test.foo'})
      {
              "ok" : 0,
              "errmsg" : "not authorized on admin to execute command { balancerCollectionStatus: \"test.foo\", lsid: { id: UUID(\"eb2eddd6-a9fc-4a8a-8c55-3d05daac22cb\") }, $clusterTime: { clusterTime: Timestamp(1583272313, 6) }, $db: \"admin\" }",
              "code" : 13,
              "codeName" : "Unauthorized",
              "operationTime" : Timestamp(1583272354, 1),
              "$clusterTime" : {
                      "clusterTime" : Timestamp(1583272354, 1)
              }
      }
      

      The API should work similarly to shardCollection and with the same roles as shardCollection would.

            Assignee:
            marcos.grillo@mongodb.com Marcos José Grillo Ramirez
            Reporter:
            marcos.grillo@mongodb.com Marcos José Grillo Ramirez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: