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

pymongo.mongo_replica_set_client in __schedule_refresh AttributeError: 'NoneType' object has no attribute 'schedule_refresh'

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 2.7
    • Affects Version/s: 2.6.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      Python 2.6.8 (unknown, Mar 14 2013, 09:31:22)
      [GCC 4.6.2 20111027 (Red Hat 4.6.2-2)] on linux2
      Mongo 2.4.7

      import pymongo
      from pymongo import MongoReplicaSetClient #, ReadPreference, MongoClient

      This started when we changed over from MongoClient to support read preference in the near future:

      Old:
      #self.connection = MongoClient(MONGO_ALARMS_HOST, MONGO_PORT)

      New:
      self.connection = MongoReplicaSetClient(MONGO_HOST, replicaSet=MONGO_REPLICA_SET)

      Dump:
      AttributeError: 'NoneType' object has no attribute 'schedule_refresh'

      Logger: root Level: error
      Server: ip-10-2-53-250 First Seen: Oct. 31, 2013
      Stacktrace (most recent call last):

      (4 additional frame(s) were not displayed)
      ...
      File "locations/views.py", line 928, in chart_png
      x, y = statistics_dao.get_x_y_stats(location_id, key, start, end) # list objects have order, ok
      File "statistics/statsDAO.py", line 154, in get_x_y_stats
      for stat_datum in stats_data:

      Exception (most recent call last)
      AttributeError Root Cause
      'NoneType' object has no attribute 'schedule_refresh'

      locations/views.py ? in chart_png (application)

      x, y = statistics_dao.get_x_y_stats(location_id, key, start, end) # list objects have order, ok
      statistics/statsDAO.py ? in get_x_y_stats (application)

      for stat_datum in stats_data:

      We also always had a close:

          def __exit__(self, type, value, traceback):
              """needed for with"""
              #self.connection.end_request()
              self.connection.close()
      

      I saw this issue being resolved in 2.5.1 I'll post a link to that issue

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            webalert@cldssinc.com webalert admin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: