Advertisement
Guest User

Untitled

a guest
May 18th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.70 KB | None | 0 0
  1. [13:38:43][root@noc][noc]# ./noc fix
  2. Checking collections UUID
  3. ... done
  4. Checking inventory Root
  5. Checking inventory Lost&Found
  6. Checking pm.MetricSettings
  7. ... done
  8. Checking fm.Outages
  9. Restarting wipe process: wiping-743
  10. [13:38:53][root@noc][noc]# ./noc fix
  11. Checking collections UUID
  12. ... done
  13. Checking inventory Root
  14. Checking inventory Lost&Found
  15. Checking pm.MetricSettings
  16. ... done
  17. Checking fm.Outages
  18. Restarting wipe process: wiping-743
  19. [13:39:01][root@noc][noc]# ./noc wipe managed-object wiping-743
  20. Wiping 'wiping-743':
  21. ERROR:noc.lib.debug:UNHANDLED EXCEPTION (2015-05-18 13:39:36.699625)
  22. BRANCH: develop TIP: af259abf39e3
  23. PROCESS: manage.py
  24. ERROR FINGERPRINT: 8b56f608-33d7-5776-8016-24cba149d407
  25. WORKING DIRECTORY: /usr/local/noc
  26. EXCEPTION: <type 'exceptions.AttributeError'> type object 'ObjectItem' has no attribute 'objects'
  27. START OF TRACEBACK
  28. ------------------------------------------------------------------------
  29. File: lib/nosql.py (Line: 249)
  30. Function: on_ref_delete
  31. 242 :param instance:
  32. 243 :param using:
  33. 244 :return:
  34. 245 """
  35. 246 if not self.name:
  36. 247 return
  37. 248 doc = self.owner_document
  38. 249 ==> if doc.objects.filter(**{self.name: instance.id}).first() is not None:
  39. 250 raise IntegrityError("%r object is referenced from %r" % (instance,
  40. 251 doc))
  41. 252
  42. 253 def __get__(self, instance, owner):
  43. 254 """Descriptor to allow lazy dereferencing."""
  44. 255 if instance is None:
  45. Variables:
  46. doc = <class 'noc.cm.models.validationrule.ObjectItem'>
  47. self = <noc.lib.nosql.ForeignKeyField object at 0x80f33d090>
  48. instance = <ManagedObject: wiping-743>
  49. sender = <class 'noc.sa.models.managedobject.ManagedObject'>
  50. kwargs =
  51. {'signal': <django.dispatch.dispatcher.Signal object at 0x8079712d0>,
  52. 'using': 'default'}
  53. ------------------------------------------------------------------------
  54. File: lib/python2.7/site-packages/django/dispatch/dispatcher.py (Line: 172)
  55. Function: send
  56. 165 Returns a list of tuple pairs [(receiver, response), ... ].
  57. 166 """
  58. 167 responses = []
  59. 168 if not self.receivers:
  60. 169 return responses
  61. 170
  62. 171 for receiver in self._live_receivers(_make_id(sender)):
  63. 172 ==> response = receiver(signal=self, sender=sender, **named)
  64. 173 responses.append((receiver, response))
  65. 174 return responses
  66. 175
  67. 176 def send_robust(self, sender, **named):
  68. 177 """
  69. 178 Send signal from sender to all connected receivers catching errors.
  70. Variables:
  71. named = {'instance': <ManagedObject: wiping-743>, 'using': 'default'}
  72. responses =
  73. [(<bound method ?.on_delete_model of <class 'noc.pm.models.probeconfig.ProbeConfig'>>,
  74. None),
  75. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80c784c10>>,
  76. None),
  77. (<function mo_delete_update_selector_cache at 0x80c796d70>, None),
  78. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80c798fd0>>,
  79. None),
  80. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80c7992d0>>,
  81. None),
  82. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80c799cd0>>,
  83. None),
  84. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80c7aead0>>,
  85. None),
  86. (<bound method ?.on_managed_object_delete of <class 'noc.inv.models.discoveryjob.DiscoveryJob'>>,
  87. None),
  88. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80c685350>>,
  89. None),
  90. (<function mo_delete_update_selector_cache at 0x80cc650c8>, None),
  91. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80cc8fd10>>,
  92. None),
  93. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80cc92390>>,
  94. None),
  95. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80cc92890>>,
  96. None),
  97. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80cc98490>>,
  98. None),
  99. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80cc98cd0>>,
  100. None),
  101. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80cc9ca50>>,
  102. None),
  103. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80f053290>>,
  104. None),
  105. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80f053390>>,
  106. None),
  107. (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80f053a10>>,
  108. None)]
  109. self = <django.dispatch.dispatcher.Signal object at 0x8079712d0>
  110. receiver =
  111. <bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80f33d090>>
  112. response = None
  113. sender = <class 'noc.sa.models.managedobject.ManagedObject'>
  114. ------------------------------------------------------------------------
  115. File: lib/python2.7/site-packages/django/db/models/deletion.py (Line: 239)
  116. Function: delete
  117. 232 # end of a transaction.
  118. 233 self.sort()
  119. 234
  120. 235 # send pre_delete signals
  121. 236 for model, obj in self.instances_with_model():
  122. 237 if not model._meta.auto_created:
  123. 238 signals.pre_delete.send(
  124. 239 ==> sender=model, instance=obj, using=self.using
  125. 240 )
  126. 241
  127. 242 # update fields
  128. 243 for model, instances_for_fieldvalues in self.field_updates.iteritems():
  129. 244 query = sql.UpdateQuery(model)
  130. 245 for (field, value), instances in instances_for_fieldvalues.iteritems():
  131. Variables:
  132. instances = set([<ManagedObject: wiping-743>])
  133. model = <class 'noc.sa.models.managedobject.ManagedObject'>
  134. obj = <ManagedObject: wiping-743>
  135. self = <django.db.models.deletion.Collector object at 0x810379990>
  136. ------------------------------------------------------------------------
  137. File: lib/python2.7/site-packages/django/db/models/deletion.py (Line: 61)
  138. Function: decorated
  139. 54 def decorated(self, *args, **kwargs):
  140. 55 if not transaction.is_managed(using=self.using):
  141. 56 transaction.enter_transaction_management(using=self.using)
  142. 57 forced_managed = True
  143. 58 else:
  144. 59 forced_managed = False
  145. 60 try:
  146. 61 ==> func(self, *args, **kwargs)
  147. 62 if forced_managed:
  148. 63 transaction.commit(using=self.using)
  149. 64 else:
  150. 65 transaction.commit_unless_managed(using=self.using)
  151. 66 finally:
  152. 67 if forced_managed:
  153. Variables:
  154. self = <django.db.models.deletion.Collector object at 0x810379990>
  155. kwargs = {}
  156. func = <function delete at 0x8079f5de8>
  157. args = ()
  158. forced_managed = True
  159. ------------------------------------------------------------------------
  160. File: lib/python2.7/site-packages/django/db/models/base.py (Line: 576)
  161. Function: delete
  162. 569
  163. 570 def delete(self, using=None):
  164. 571 using = using or router.db_for_write(self.__class__, instance=self)
  165. 572 assert self._get_pk_val() is not None, "%s object can't be deleted because its %s attribute is set to None." % (self._meta.object_name, self._meta.pk.attname)
  166. 573
  167. 574 collector = Collector(using=using)
  168. 575 collector.collect([self])
  169. 576 ==> collector.delete()
  170. 577
  171. 578 delete.alters_data = True
  172. 579
  173. 580 def _get_FIELD_display(self, field):
  174. 581 value = getattr(self, field.attname)
  175. 582 return force_unicode(dict(field.flatchoices).get(value, value), strings_only=True)
  176. Variables:
  177. using = 'default'
  178. self = <ManagedObject: wiping-743>
  179. collector = <django.db.models.deletion.Collector object at 0x810379990>
  180. ------------------------------------------------------------------------
  181. File: sa/models/managedobject.py (Line: 330)
  182. Function: delete
  183. 323 ObjectMap.update_map(
  184. 324 self, self.collector, self.trap_source_ip)
  185. 325
  186. 326 def delete(self, *args, **kwargs):
  187. 327 # Deny to delete "SAE" object
  188. 328 if self.name == "SAE":
  189. 329 raise IntegrityError("Cannot delete SAE object")
  190. 330 ==> super(ManagedObject, self).delete(*args, **kwargs)
  191. 331
  192. 332 def sync_ipam(self):
  193. 333 """
  194. 334 Synchronize FQDN and address with IPAM
  195. 335 """
  196. 336 from noc.ip.models.address import Address
  197. Variables:
  198. self = <ManagedObject: wiping-743>
  199. args = ()
  200. kwargs = {}
  201. ------------------------------------------------------------------------
  202. File: sa/wipe/managedobject.py (Line: 128)
  203. Function: wipe
  204. 121 for vr in ValidationRule.objects.filter(objects_list__object=o.id):
  205. 122 vr.objects_list = [x for x in vr.objects_list if x.object.id != o.id]
  206. 123 if not vr.objects_list and not vr.selectors_list:
  207. 124 vr.is_active = False
  208. 125 vr.save()
  209. 126 # Finally delete object and config
  210. 127 log.debug("Finally wiping object")
  211. 128 ==> o.delete()
  212. 129 log.debug("Done")
  213. 130
  214. Variables:
  215. ac = <class 'noc.fm.models.archivedalarm.ArchivedAlarm'>
  216. db = Database(MongoClient('localhost', 27017), u'noc')
  217. log = <noc.lib.log.PrefixLoggerAdapter object at 0x810379090>
  218. o = <ManagedObject: wiping-743>
  219. ------------------------------------------------------------------------
  220. File: main/management/commands/wipe.py (Line: 103)
  221. Function: wipe_managed_object
  222. 96 """
  223. 97 Wipe Managed Object
  224. 98 :param o: Managed Object
  225. 99 :type o: Managed Object
  226. 100 :return: None
  227. 101 """
  228. 102 from noc.sa.wipe.managedobject import wipe
  229. 103 ==> wipe(o)
  230. 104
  231. 105 def get_user(self, u_id):
  232. 106 """
  233. 107 Get User by id or name
  234. 108 :param o_id: Object's id or name
  235. 109 :return: ManagedObject
  236. Variables:
  237. self = <noc.main.management.commands.wipe.Command object at 0x810288c10>
  238. wipe = <function wipe at 0x81028fe60>
  239. o = <ManagedObject: wiping-743>
  240. ------------------------------------------------------------------------
  241. File: main/management/commands/wipe.py (Line: 47)
  242. Function: handle
  243. 40 raise CommandError("Object '%s' is not found" % o_id)
  244. 41 objects += [o]
  245. 42 # Wipe objects
  246. 43 from noc.lib.debug import error_report
  247. 44 for o in objects:
  248. 45 with self.log("Wiping '%s':" % unicode(o), True):
  249. 46 try:
  250. 47 ==> wiper(o)
  251. 48 except KeyboardInterrupt:
  252. 49 raise CommandError("Interrupted. Wiping is not complete")
  253. 50 except:
  254. 51 error_report()
  255. 52
  256. 53 @contextmanager
  257. Variables:
  258. self = <noc.main.management.commands.wipe.Command object at 0x810288c10>
  259. args = ('managed-object', 'wiping-743')
  260. m = 'managed_object'
  261. o = <ManagedObject: wiping-743>
  262. options =
  263. {'pythonpath': None, 'settings': None, 'traceback': None, 'verbosity': '1'}
  264. objects = [<ManagedObject: wiping-743>]
  265. getter =
  266. <bound method Command.get_managed_object of <noc.main.management.commands.wipe.Command object at 0x810288c10>>
  267. error_report = <function error_report at 0x806623410>
  268. wiper =
  269. <bound method Command.wipe_managed_object of <noc.main.management.commands.wipe.Command object at 0x810288c10>>
  270. o_id = 'wiping-743'
  271. ------------------------------------------------------------------------
  272. END OF TRACEBACK
  273. ERROR:noc.lib.debug:Writing CP report to local/cp/crashinfo/new/8b56f608-33d7-5776-8016-24cba149d407.json
  274. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement