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

buildInfo fails when no users are authenticated

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.0, 3.6.1, 3.6.2, 3.6.3, 3.6.4, 3.7.9
    • Component/s: Sharding
    • ALL
    • 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+).    
    • Sharding 2018-09-24, Sharding 2018-11-05

      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.

       

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: