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

dropRole fails when requireApiVersion=1

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Security 2021-01-11, Security 2021-01-25

      Python test suite fails while executing this dropRole command against a standalone mongod with requireApiVersion=1:

      {'dropRole': 'noremove', 'apiVersion': '1'}
      

      The error:

      ERROR: test_no_remove (test.test_bulk.TestBulkAuthorization)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/Users/shane/git/mongo-python-driver/test/test_bulk.py", line 385, in tearDown
          self.db.command('dropRole', 'noremove')
        File "/Users/shane/git/mongo-python-driver/pymongo/database.py", line 741, in command
          return self._command(sock_info, command, slave_ok, value,
        File "/Users/shane/git/mongo-python-driver/pymongo/database.py", line 629, in _command
          return sock_info.command(
        File "/Users/shane/git/mongo-python-driver/pymongo/pool.py", line 718, in command
          return command(self, dbname, spec, slave_ok,
        File "/Users/shane/git/mongo-python-driver/pymongo/network.py", line 160, in command
          helpers._check_command_response(
        File "/Users/shane/git/mongo-python-driver/pymongo/helpers.py", line 164, in _check_command_response
          raise OperationFailure(errmsg, code, response, max_wire_version)
      pymongo.errors.OperationFailure: Failed to remove role noremove@pymongo_test from all users :: caused by :: The apiVersion parameter is required, please configure your MongoClient's API version, full error: {'ok': 0.0, 'errmsg': "Failed to remove role noremove@pymongo_test from all users :: caused by :: The apiVersion parameter is required, please configure your MongoClient's API version", 'code': 498870, 'codeName': 'Location498870'}
      

      This error is unexpected because apiVersion was included in the dropRole command. The server version is:

      v4.9.0-alpha-1082-g399f119
      

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: