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

buildInfo fails when no users are authenticated

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 3.6.0, 3.6.1, 3.6.2, 3.6.3, 3.6.4, 3.7.9
    • Fix Version/s: None
    • Component/s: Sharding
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Steps:

      • Start a single mongod
      • Add one user to the admin database
      • Without authenticating first attempt to call buildinfo using a driver that uses implicit sessions (e.g. PyMongo 3.6+).

       

       

      Show
      Steps: Start a single mongod Add one user to the admin database Without authenticating first attempt to call buildinfo using a driver that uses implicit sessions (e.g. PyMongo 3.6+).    
    • Sprint:
      Sharding 2018-09-24, Sharding 2018-11-05

      Description

      This seems similar to SERVER-32063:

      >>> c.admin.add_user('foo', 'bar')
      >>> c.server_info()
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/home/sigstop/work/mongo-python-driver/pymongo/mongo_client.py", line 1464, in server_info
          session=session)
        File "/home/sigstop/work/mongo-python-driver/pymongo/database.py", line 532, in command
          codec_options, session=session, **kwargs)
        File "/home/sigstop/work/mongo-python-driver/pymongo/database.py", line 439, in _command
          client=self.__client)
        File "/home/sigstop/work/mongo-python-driver/pymongo/pool.py", line 515, in command
          collation=collation)
        File "/home/sigstop/work/mongo-python-driver/pymongo/network.py", line 126, in command
          parse_write_concern_error=parse_write_concern_error)
        File "/home/sigstop/work/mongo-python-driver/pymongo/helpers.py", line 145, in _check_command_response
          raise OperationFailure(msg % errmsg, code, response)
      pymongo.errors.OperationFailure: there are no users authenticated
      >>> c.server_info()
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/home/sigstop/work/mongo-python-driver/pymongo/mongo_client.py", line 1464, in server_info
          session=session)
        File "/home/sigstop/work/mongo-python-driver/pymongo/database.py", line 532, in command
          codec_options, session=session, **kwargs)
        File "/home/sigstop/work/mongo-python-driver/pymongo/database.py", line 439, in _command
          client=self.__client)
        File "/home/sigstop/work/mongo-python-driver/pymongo/pool.py", line 515, in command
          collation=collation)
        File "/home/sigstop/work/mongo-python-driver/pymongo/network.py", line 126, in command
          parse_write_concern_error=parse_write_concern_error)
        File "/home/sigstop/work/mongo-python-driver/pymongo/helpers.py", line 145, in _check_command_response
          raise OperationFailure(msg % errmsg, code, response)
      pymongo.errors.OperationFailure: there are no users authenticated
      

      2018-05-03T08:57:22.266-0700 D COMMAND  [conn2] run command admin.$cmd { buildinfo: 1, lsid: { id: UUID("103f4218-e907-476d-b5b4-43be95a8fb89") }, $readPreference: { mode: "secondaryPreferred" }, $db: "admin" }
      2018-05-03T08:57:22.266-0700 D -        [conn2] User Assertion: 13:there are no users authenticated src/mongo/db/auth/authorization_session.cpp 206
      2018-05-03T08:57:22.266-0700 D COMMAND  [conn2] assertion while executing command 'buildinfo' on database 'admin' with arguments '{ buildinfo: 1, lsid: { id: UUID("103f4218-e907-476d-b5b4-43be95a8fb89") }, $readPreference: { mode: "secondaryPreferred" }, $db: "admin" }': Unauthorized: there are no users authenticated
      2018-05-03T08:57:22.266-0700 I COMMAND  [conn2] command admin.$cmd command: buildInfo { buildinfo: 1, lsid: { id: UUID("103f4218-e907-476d-b5b4-43be95a8fb89") }, $readPreference: { mode: "secondaryPreferred" }, $db: "admin" } exception: there are no users authenticated code:Unauthorized numYields:0 reslen:119 locks:{} protocol:op_query 0ms
      

      This only happens when the driver uses implicit sessions (e.g. PyMongo 3.6+). Using an older driver without implicit sessions (e.g. PyMongo 3.5.x) works around the problem.

       

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: