Advertisement
Guest User

Untitled

a guest
Oct 8th, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.46 KB | None | 0 0
  1. 2012-10-08 11:56:42,013 UNHANDLED EXCEPTION (2012-10-08 11:56:41.987546)
  2. Working directory: /opt/noc
  3. <class 'mongoengine.base.ValidationError'>
  4. Unable to dereference <class 'noc.inv.models.interface.Interface'>:4eddc526f3b6825b8c001367
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /opt/noc/lib/nosql.py (Line: 103)
  8. Function: __get__
  9. 96 # Dereference DBRefs
  10. 97 if isinstance(value, ObjectId):
  11. 98 v = self.document_type.objects(id=value).first()
  12. 99 if v is not None:
  13. 100 instance._data[self.name] = v
  14. 101 else:
  15. 102 raise ValidationError("Unable to dereference %s:%s" % (
  16. 103 ==> self.document_type, value))
  17. 104 return super(PlainReferenceField, self).__get__(instance, owner)
  18. 105
  19. 106 def to_mongo(self, document):
  20. 107 if isinstance(document, Document):
  21. 108 # We need the id from the saved object to create the DBRef
  22. 109 id_ = document.id
  23. Variables:
  24. owner = <class 'noc.inv.models.subinterface.SubInterface'>
  25. instance = repr() failed
  26. self = <noc.lib.nosql.PlainReferenceField object at 0x806c70990>
  27. value = ObjectId('4eddc526f3b6825b8c001367')
  28. v = None
  29. ------------------------------------------------------------------------
  30. File: /opt/noc/inv/discovery/jobs/mac_discovery.py (Line: 67)
  31. Function: can_run
  32. 60 if not super(MACDiscoveryJob, self).can_run():
  33. 61 return False
  34. 62 # Check object has bridge interfaces
  35. 63 # with enabled MAC discovery
  36. 64 for si in SubInterface.objects.filter(
  37. 65 managed_object=self.object.id,
  38. 66 enabled_afi="BRIDGE"):
  39. 67 ==> if si.interface.profile.mac_discovery:
  40. 68 return True
  41. 69 # No suitable interfaces
  42. 70 return False
  43. Variables:
  44. si = repr() failed
  45. self = <noc.inv.discovery.jobs.mac_discovery.MACDiscoveryJob object at 0x80721eb10>
  46. ------------------------------------------------------------------------
  47. File: /opt/noc/lib/scheduler/scheduler.py (Line: 193)
  48. Function: run_job
  49. 186 # Dereference job
  50. 187 if not job.dereference():
  51. 188 logging.info("Cannot dereference job %s(%s). Removing" % (
  52. 189 job.name, job.key))
  53. 190 self.remove_job(job.name, job.key)
  54. 191 return
  55. 192 # Check job can be run
  56. 193 ==> if not job.can_run():
  57. 194 return
  58. 195 # Change status
  59. 196 s = "threaded " if job.threaded else ""
  60. 197 self.info("Running %sjob %s(%s)" % (s, job.name, job.get_display_key()))
  61. 198 job.started = time.time()
  62. 199 self.collection.update({
  63. Variables:
  64. job = <noc.inv.discovery.jobs.mac_discovery.MACDiscoveryJob object at 0x80721eb10>
  65. self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x804f74410>
  66. ------------------------------------------------------------------------
  67. File: /opt/noc/lib/scheduler/scheduler.py (Line: 334)
  68. Function: run_pending
  69. 327 self.set_job_status(job_data[self.ATTR_CLASS],
  70. 328 job_data[self.ATTR_KEY], self.S_FAIL)
  71. 329 continue
  72. 330 job = jcls(self,
  73. 331 job_data[self.ATTR_KEY], job_data[self.ATTR_DATA],
  74. 332 job_data[self.ATTR_SCHEDULE]
  75. 333 )
  76. 334 ==> self.run_job(job)
  77. 335 n += 1
  78. 336 return n
  79. 337
  80. 338 def run(self):
  81. 339 if self.reset_running:
  82. 340 # Change running to waiting
  83. Variables:
  84. jcls = <class 'noc.inv.discovery.jobs.mac_discovery.MACDiscoveryJob'>
  85. keys = [...]
  86. throttled = set([])
  87. self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x804f74410>
  88. job_data = {u'runs': 105, u'last': datetime.datetime(2012, 10, 8, 8, 55, 7, 794000), u'log': [], u'jcls': u'mac_discovery', u'schedule': {u'interval': 10800, u'randomize': True, u'failed_interval': 900, u'offset': 0.6395436370508348}, u'ldur': 3.1057279109954834, u'ts': datetime.datetime(2012, 10, 8, 11, 55, 7, 71000), u'tb': None, u's': u'W', u'ls': u'S', u'key': 139, u'_id': ObjectId('506086dcf3b68269cd0000b7'), u'data': {}}
  89. t0 = 1349683001.2837
  90. n = 4
  91. q = {'s': 'W', 'ts': {'$lte': datetime.datetime(2012, 10, 8, 11, 56, 41, 880044)}, 'jcls': {'$nin': ['interface_discovery', 'ip_discovery']}}
  92. job = <noc.inv.discovery.jobs.mac_discovery.MACDiscoveryJob object at 0x80721eb10>
  93. x = {u'_id': ObjectId('506062edf3b6824f3d000094'), u'key': 2255}
  94. ------------------------------------------------------------------------
  95. File: /opt/noc/lib/scheduler/scheduler.py (Line: 349)
  96. Function: run
  97. 342 self.collection.update({
  98. 343 self.ATTR_STATUS: self.S_RUN
  99. 344 }, {
  100. 345 "$set": {self.ATTR_STATUS: self.S_WAIT}
  101. 346 }, multi=True, safe=True)
  102. 347 self.info("Running scheduler")
  103. 348 while True:
  104. 349 ==> if not self.run_pending():
  105. 350 time.sleep(1)
  106. 351 else:
  107. 352 self.cleanup()
  108. 353
  109. 354 def wipe(self):
  110. 355 """
  111. Variables:
  112. self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x804f74410>
  113. ------------------------------------------------------------------------
  114. File: /opt/noc/inv/discovery/daemon.py (Line: 22)
  115. Function: run
  116. 15 daemon_name = "noc-discovery"
  117. 16
  118. 17 def __init__(self, *args, **kwargs):
  119. 18 super(DiscoveryDaemon, self).__init__(*args, **kwargs)
  120. 19 self.scheduler = DiscoveryScheduler(self)
  121. 20
  122. 21 def run(self):
  123. 22 ==> self.scheduler.run()
  124. 23
  125. 24 # def report_address_collisions(self):
  126. 25 # ctx = {
  127. 26 # "count": len(self.address_collisions),
  128. 27 # "collisions": [
  129. 28 # {
  130. Variables:
  131. self = <noc.inv.discovery.daemon.DiscoveryDaemon object at 0x803856150>
  132. ------------------------------------------------------------------------
  133. File: /opt/noc/lib/daemon.py (Line: 364)
  134. Function: guarded_run
  135. 357
  136. 358 def guarded_run(self):
  137. 359 """
  138. 360 Run daemon and catch common exceptions
  139. 361 :return:
  140. 362 """
  141. 363 try:
  142. 364 ==> self.run()
  143. 365 except KeyboardInterrupt:
  144. 366 pass
  145. 367 except MemoryError:
  146. 368 logging.error("Out of memory. Exiting.")
  147. 369 except SystemExit:
  148. 370 logging.info("Exiting")
  149. Variables:
  150. self = <noc.inv.discovery.daemon.DiscoveryDaemon object at 0x803856150>
  151. ------------------------------------------------------------------------
  152. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement