Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [13:38:43][root@noc][noc]# ./noc fix
- Checking collections UUID
- ... done
- Checking inventory Root
- Checking inventory Lost&Found
- Checking pm.MetricSettings
- ... done
- Checking fm.Outages
- Restarting wipe process: wiping-743
- [13:38:53][root@noc][noc]# ./noc fix
- Checking collections UUID
- ... done
- Checking inventory Root
- Checking inventory Lost&Found
- Checking pm.MetricSettings
- ... done
- Checking fm.Outages
- Restarting wipe process: wiping-743
- [13:39:01][root@noc][noc]# ./noc wipe managed-object wiping-743
- Wiping 'wiping-743':
- ERROR:noc.lib.debug:UNHANDLED EXCEPTION (2015-05-18 13:39:36.699625)
- BRANCH: develop TIP: af259abf39e3
- PROCESS: manage.py
- ERROR FINGERPRINT: 8b56f608-33d7-5776-8016-24cba149d407
- WORKING DIRECTORY: /usr/local/noc
- EXCEPTION: <type 'exceptions.AttributeError'> type object 'ObjectItem' has no attribute 'objects'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: lib/nosql.py (Line: 249)
- Function: on_ref_delete
- 242 :param instance:
- 243 :param using:
- 244 :return:
- 245 """
- 246 if not self.name:
- 247 return
- 248 doc = self.owner_document
- 249 ==> if doc.objects.filter(**{self.name: instance.id}).first() is not None:
- 250 raise IntegrityError("%r object is referenced from %r" % (instance,
- 251 doc))
- 252
- 253 def __get__(self, instance, owner):
- 254 """Descriptor to allow lazy dereferencing."""
- 255 if instance is None:
- Variables:
- doc = <class 'noc.cm.models.validationrule.ObjectItem'>
- self = <noc.lib.nosql.ForeignKeyField object at 0x80f33d090>
- instance = <ManagedObject: wiping-743>
- sender = <class 'noc.sa.models.managedobject.ManagedObject'>
- kwargs =
- {'signal': <django.dispatch.dispatcher.Signal object at 0x8079712d0>,
- 'using': 'default'}
- ------------------------------------------------------------------------
- File: lib/python2.7/site-packages/django/dispatch/dispatcher.py (Line: 172)
- Function: send
- 165 Returns a list of tuple pairs [(receiver, response), ... ].
- 166 """
- 167 responses = []
- 168 if not self.receivers:
- 169 return responses
- 170
- 171 for receiver in self._live_receivers(_make_id(sender)):
- 172 ==> response = receiver(signal=self, sender=sender, **named)
- 173 responses.append((receiver, response))
- 174 return responses
- 175
- 176 def send_robust(self, sender, **named):
- 177 """
- 178 Send signal from sender to all connected receivers catching errors.
- Variables:
- named = {'instance': <ManagedObject: wiping-743>, 'using': 'default'}
- responses =
- [(<bound method ?.on_delete_model of <class 'noc.pm.models.probeconfig.ProbeConfig'>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80c784c10>>,
- None),
- (<function mo_delete_update_selector_cache at 0x80c796d70>, None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80c798fd0>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80c7992d0>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80c799cd0>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80c7aead0>>,
- None),
- (<bound method ?.on_managed_object_delete of <class 'noc.inv.models.discoveryjob.DiscoveryJob'>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80c685350>>,
- None),
- (<function mo_delete_update_selector_cache at 0x80cc650c8>, None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80cc8fd10>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80cc92390>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80cc92890>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80cc98490>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80cc98cd0>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80cc9ca50>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80f053290>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80f053390>>,
- None),
- (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80f053a10>>,
- None)]
- self = <django.dispatch.dispatcher.Signal object at 0x8079712d0>
- receiver =
- <bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80f33d090>>
- response = None
- sender = <class 'noc.sa.models.managedobject.ManagedObject'>
- ------------------------------------------------------------------------
- File: lib/python2.7/site-packages/django/db/models/deletion.py (Line: 239)
- Function: delete
- 232 # end of a transaction.
- 233 self.sort()
- 234
- 235 # send pre_delete signals
- 236 for model, obj in self.instances_with_model():
- 237 if not model._meta.auto_created:
- 238 signals.pre_delete.send(
- 239 ==> sender=model, instance=obj, using=self.using
- 240 )
- 241
- 242 # update fields
- 243 for model, instances_for_fieldvalues in self.field_updates.iteritems():
- 244 query = sql.UpdateQuery(model)
- 245 for (field, value), instances in instances_for_fieldvalues.iteritems():
- Variables:
- instances = set([<ManagedObject: wiping-743>])
- model = <class 'noc.sa.models.managedobject.ManagedObject'>
- obj = <ManagedObject: wiping-743>
- self = <django.db.models.deletion.Collector object at 0x810379990>
- ------------------------------------------------------------------------
- File: lib/python2.7/site-packages/django/db/models/deletion.py (Line: 61)
- Function: decorated
- 54 def decorated(self, *args, **kwargs):
- 55 if not transaction.is_managed(using=self.using):
- 56 transaction.enter_transaction_management(using=self.using)
- 57 forced_managed = True
- 58 else:
- 59 forced_managed = False
- 60 try:
- 61 ==> func(self, *args, **kwargs)
- 62 if forced_managed:
- 63 transaction.commit(using=self.using)
- 64 else:
- 65 transaction.commit_unless_managed(using=self.using)
- 66 finally:
- 67 if forced_managed:
- Variables:
- self = <django.db.models.deletion.Collector object at 0x810379990>
- kwargs = {}
- func = <function delete at 0x8079f5de8>
- args = ()
- forced_managed = True
- ------------------------------------------------------------------------
- File: lib/python2.7/site-packages/django/db/models/base.py (Line: 576)
- Function: delete
- 569
- 570 def delete(self, using=None):
- 571 using = using or router.db_for_write(self.__class__, instance=self)
- 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)
- 573
- 574 collector = Collector(using=using)
- 575 collector.collect([self])
- 576 ==> collector.delete()
- 577
- 578 delete.alters_data = True
- 579
- 580 def _get_FIELD_display(self, field):
- 581 value = getattr(self, field.attname)
- 582 return force_unicode(dict(field.flatchoices).get(value, value), strings_only=True)
- Variables:
- using = 'default'
- self = <ManagedObject: wiping-743>
- collector = <django.db.models.deletion.Collector object at 0x810379990>
- ------------------------------------------------------------------------
- File: sa/models/managedobject.py (Line: 330)
- Function: delete
- 323 ObjectMap.update_map(
- 324 self, self.collector, self.trap_source_ip)
- 325
- 326 def delete(self, *args, **kwargs):
- 327 # Deny to delete "SAE" object
- 328 if self.name == "SAE":
- 329 raise IntegrityError("Cannot delete SAE object")
- 330 ==> super(ManagedObject, self).delete(*args, **kwargs)
- 331
- 332 def sync_ipam(self):
- 333 """
- 334 Synchronize FQDN and address with IPAM
- 335 """
- 336 from noc.ip.models.address import Address
- Variables:
- self = <ManagedObject: wiping-743>
- args = ()
- kwargs = {}
- ------------------------------------------------------------------------
- File: sa/wipe/managedobject.py (Line: 128)
- Function: wipe
- 121 for vr in ValidationRule.objects.filter(objects_list__object=o.id):
- 122 vr.objects_list = [x for x in vr.objects_list if x.object.id != o.id]
- 123 if not vr.objects_list and not vr.selectors_list:
- 124 vr.is_active = False
- 125 vr.save()
- 126 # Finally delete object and config
- 127 log.debug("Finally wiping object")
- 128 ==> o.delete()
- 129 log.debug("Done")
- 130
- Variables:
- ac = <class 'noc.fm.models.archivedalarm.ArchivedAlarm'>
- db = Database(MongoClient('localhost', 27017), u'noc')
- log = <noc.lib.log.PrefixLoggerAdapter object at 0x810379090>
- o = <ManagedObject: wiping-743>
- ------------------------------------------------------------------------
- File: main/management/commands/wipe.py (Line: 103)
- Function: wipe_managed_object
- 96 """
- 97 Wipe Managed Object
- 98 :param o: Managed Object
- 99 :type o: Managed Object
- 100 :return: None
- 101 """
- 102 from noc.sa.wipe.managedobject import wipe
- 103 ==> wipe(o)
- 104
- 105 def get_user(self, u_id):
- 106 """
- 107 Get User by id or name
- 108 :param o_id: Object's id or name
- 109 :return: ManagedObject
- Variables:
- self = <noc.main.management.commands.wipe.Command object at 0x810288c10>
- wipe = <function wipe at 0x81028fe60>
- o = <ManagedObject: wiping-743>
- ------------------------------------------------------------------------
- File: main/management/commands/wipe.py (Line: 47)
- Function: handle
- 40 raise CommandError("Object '%s' is not found" % o_id)
- 41 objects += [o]
- 42 # Wipe objects
- 43 from noc.lib.debug import error_report
- 44 for o in objects:
- 45 with self.log("Wiping '%s':" % unicode(o), True):
- 46 try:
- 47 ==> wiper(o)
- 48 except KeyboardInterrupt:
- 49 raise CommandError("Interrupted. Wiping is not complete")
- 50 except:
- 51 error_report()
- 52
- 53 @contextmanager
- Variables:
- self = <noc.main.management.commands.wipe.Command object at 0x810288c10>
- args = ('managed-object', 'wiping-743')
- m = 'managed_object'
- o = <ManagedObject: wiping-743>
- options =
- {'pythonpath': None, 'settings': None, 'traceback': None, 'verbosity': '1'}
- objects = [<ManagedObject: wiping-743>]
- getter =
- <bound method Command.get_managed_object of <noc.main.management.commands.wipe.Command object at 0x810288c10>>
- error_report = <function error_report at 0x806623410>
- wiper =
- <bound method Command.wipe_managed_object of <noc.main.management.commands.wipe.Command object at 0x810288c10>>
- o_id = 'wiping-743'
- ------------------------------------------------------------------------
- END OF TRACEBACK
- ERROR:noc.lib.debug:Writing CP report to local/cp/crashinfo/new/8b56f608-33d7-5776-8016-24cba149d407.json
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement