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

db.killOp() validates input parameter too strictly

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.10.2
    • Affects Version/s: None
    • Component/s: Shell API
    • None
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • 1
    • Not Needed
    • Iteration Edmontonia

      From Slack:

      db.currentOp() returns opid values as strings instead of integers to be able to kill ops on a given shard without a session (docs here). When attempting to run db.killOp() with the most recent version of mongosh (v1.10.0), the following error is received:
      Atlas [mongos] dbname> db.killOp("<shardname>:<opid>")
      MongoshInvalidInputError: [COMMON-10001] Argument at position 0 must be of type number, got string instead (Database.killOp)
      I was able to reproduce this error message. I was also able to verify that the same command works as expected in the legacy mongo shell bundled with MongoDB 5.0. The workaround to run db.adminCommand({ killOp: 1, op: "<opid>" }) works correctly with mongosh. Is this a known issue?

      We should remove the validation here.

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: