title: Upgrade to PyMongo 3.0 Resulting in ServerSelectionTimeoutError
body: <p>I recently upgraded a Bottle + uWSGI + Nginx application to MongoDB 3.0.2. It was working fine with PyMongo 2.8, but today I upgraded to PyMongo 3.0 by running following command:</p>
  
  <pre><code>pip install --upgrade pymongo
  </code></pre>
  
  <p>I haven't done any other changes to the code, but now I keep getting the following error.</p>
  
  <pre><code>File "/pymongo/cursor.py", line 968, in __next__ if len(self.__data) or self._refresh():
  File "/pymongo/cursor.py", line 905, in _refresh self.__read_preference))
  File "/pymongo/cursor.py", line 812, in __send_message **kwargs)
  File "/pymongo/mongo_client.py", line 716, in _send_message_with_response server = topology.select_server(selector)
  File "/pymongo/topology.py", line 113, in select_server server_selection_timeout))
  File "/pymongo/topology.py", line 93, in select_servers self._error_message(selector))
  ServerSelectionTimeoutError: No servers found yet
  </code></pre>
  
  <p>The function I use to connect to the database is the following:</p>
  
  <pre><code>def connect_db(db_name):
      global db
      host = "localhost"
      port = 27017
      connection = pymongo.MongoClient(host=host, port=port)
      db = connection[db_name]
  </code></pre>
  
  <p>I have restarted all the servers. The static pages work fine, but any page that tries to reach the database hangs and throws the error above. However, if I go to a <code>mongo</code> shell or a Python shell and query the MongoDB server, it works fine.</p>
  
  <pre><code>&gt;&gt;&gt; import pymongo
  &gt;&gt;&gt; host = "localhost"
  &gt;&gt;&gt; port = 27017
  &gt;&gt;&gt; connection = pymongo.MongoClient(host=host, port=port)
  &gt;&gt;&gt; db = connection[test]
  &gt;&gt;&gt; db.test.insert_one({"test": True});
  &lt;pymongo.results.InsertOneResult object at 0x7fc43b8efc80&gt;
  </code></pre>
  
  <p>It seems like only my application cannot find the MongoDB server. Note that I am using a Virtual Environment in case that would affect the situation in any way. Also, if I downgrade back to PyMongo 2.8, everything works fine.</p>