Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1076

MongoClient failures in mod_wsgi embedded mode

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.3
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      Ubuntu 14.04.3 LTS

      Hello, we have problem we are getting error mentioned in stack issue name. We are running Flask application on Ubuntu 14.04 LTS. Webserver is Apache2 with wsgi module. Usually we get this error 1) restart apache - first request 2) randomly

      stacktrace:

      File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 565, in __getitem__
           for doc in clone:
      File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 1097, in next
           if len(self.__data) or self._refresh():
      File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 1019, in _refresh
           self.__read_concern))
      File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 850, in __send_message
           **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 777, in _send_message_with_response
           server = topology.select_server(selector)
      File "/usr/local/lib/python2.7/dist-packages/pymongo/topology.py", line 141, in select_server
           address))
      File "/usr/local/lib/python2.7/dist-packages/pymongo/topology.py", line 117, in select_servers
           self._error_message(selector))
      ServerSelectionTimeoutError: No replica set members found yet
      

      pymongo version

      $ python -c "import pymongo; print(pymongo.__version__)"
      3.2
      

      we are using replicaset on mongolab (mlab.com), in app usage:

      mdb_client = MongoClient(host="mongodb://<user>:<pass>@<host1:port1>,<host2:port2>/<db>?replicaSet=<rs-name>", connect=False)
      mdb = mdb_client["our_db_name"]
      

      maybe one different thing - the construction above is included in almost every file - so its evaluated every time (idk if can be somehow connected)

      in mongolab i found we are using mongod version: 2.6.9

      in case i can add more information, thanks

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            twistacz Michal Haták
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: