Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1301

Update sh.getShardedDataDistribution() error message

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.6.2
    • Affects Version/s: 1.6.0
    • Component/s: Shell API
    • None
    • Environment:
      Windows
    • Not Needed

      When I call new function sh.getShardedDataDistribution() then it returns an error, despite I run mongos

       

      Connecting to:          mongodb://<credentials>@d-mipmdb-as-01:27017,d-mipmdb-as-02:27017/admin?authSource=admin&appName=mongosh+1.6.0
      Using MongoDB:          5.0.3
      Using Mongosh:          1.6.0
      
      [mongos] admin> db.runCommand({isdbgrid: 1})
      {
        isdbgrid: 1,
        hostname: 'd-mipmdb-as-01.swi.srse.net',
        ok: 1
      }
      
      [mongos] admin> sh.getShardedDataDistribution()
      Uncaught:
      MongoshRuntimeError: [COMMON-10004] sh.getShardedDataDistribution only works on mongos
          at Shard.getShardedDataDistribution (C:\Programs\MongoDB\Server\bin\mongosh.exe:390900:15)
          at async Shard.getShardedDataDistribution (C:\Programs\MongoDB\Server\bin\mongosh.exe:371185:14)
          at async Shard.<anonymous> (C:\Programs\MongoDB\Server\bin\mongosh.exe:370917:16)
          at async REPL3:34:162
          at async ShellEvaluator.innerEval (C:\Programs\MongoDB\Server\bin\mongosh.exe:475887:14)
          at async ShellEvaluator.customEval (C:\Programs\MongoDB\Server\bin\mongosh.exe:475894:30)
          at async MongoshNodeRepl.eval (C:\Programs\MongoDB\Server\bin\mongosh.exe:550660:24)
          at async PrettyREPLServer.repl.eval (C:\Programs\MongoDB\Server\bin\mongosh.exe:503953:18)
      [mongos] admin>

       

            Assignee:
            rhys.howell@mongodb.com Rhys Howell
            Reporter:
            wernfried.domscheit@sunrise.net Wernfried Domscheit
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: