Advertisement
Guest User

Untitled

a guest
Jul 31st, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.10 KB | None | 0 0
  1. (dp1
  2. S'component'
  3. p2
  4. S'noc-discovery'
  5. p3
  6. sS'source'
  7. p4
  8. S'system'
  9. p5
  10. sS'traceback'
  11. p6
  12. VUNHANDLED EXCEPTION (2012-07-31 10:23:08.327593)\u000aWorking directory: /opt/noc\u000a<class 'django.db.utils.DatabaseError'>\u000acan't adapt type 'MAC'\u000aSTART OF TRACEBACK\u000a------------------------------------------------------------------------\u000aFile: /opt/noc/contrib/lib/django/db/backends/postgresql_psycopg2/base.py (Line: 44)\u000aFunction: execute\u000a 37 """\u000a 38 \u000a 39 def __init__(self, cursor):\u000a 40 self.cursor = cursor\u000a 41 \u000a 42 def execute(self, query, args=None):\u000a 43 try:\u000a 44 ==> return self.cursor.execute(query, args)\u000a 45 except Database.IntegrityError, e:\u000a 46 raise utils.IntegrityError, utils.IntegrityError(*tuple(e)), sys.exc_info()[2]\u000a 47 except Database.DatabaseError, e:\u000a 48 raise utils.DatabaseError, utils.DatabaseError(*tuple(e)), sys.exc_info()[2]\u000a 49 \u000a 50 def executemany(self, query, args):\u000aVariables:\u000a query = 'INSERT INTO "ip_address" ("prefix_id", "vrf_id", "afi", "address", "fqdn", "mac", "auto_update_mac", "managed_object_id", "description", "tags", "tt", "style_id", "state_id", "allocated_till", "ipv6_transition_id") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)'\u000a self = <django.db.backends.postgresql_psycopg2.base.CursorWrapper object at 0x32c57d0>\u000a args = (2, 1, '4', '172.25.21.1', u'GigabitEthernet0/0/1-kie-kie-f3-r6-t3-asw0.comstar-ua.net', '00:00:0C:07:AC:00', False, None, 'Seen at kie-kie-f3-r6-t3-asw0:GigabitEthernet0/0/1', '', None, None, 1, None, None)\u000a e = ProgrammingError("can't adapt type 'MAC'",)\u000a------------------------------------------------------------------------\u000aFile: /opt/noc/contrib/lib/django/db/backends/util.py (Line: 34)\u000aFunction: execute\u000a 27 \u000a 28 \u000a 29 class CursorDebugWrapper(CursorWrapper):\u000a 30 \u000a 31 def execute(self, sql, params=()):\u000a 32 start = time()\u000a 33 try:\u000a 34 ==> return self.cursor.execute(sql, params)\u000a 35 finally:\u000a 36 stop = time()\u000a 37 duration = stop - start\u000a 38 sql = self.db.ops.last_executed_query(self.cursor, sql, params)\u000a 39 self.db.queries.append({\u000a 40 'sql': sql,\u000aVariables:\u000a self = <django.db.backends.util.CursorDebugWrapper object at 0x32c50d0>\u000a stop = 1343719388.3274341\u000a start = 1343719388.3272991\u000a params = (2, 1, '4', '172.25.21.1', u'GigabitEthernet0/0/1-kie-kie-f3-r6-t3-asw0.comstar-ua.net', '00:00:0C:07:AC:00', False, None, 'Seen at kie-kie-f3-r6-t3-asw0:GigabitEthernet0/0/1', '', None, None, 1, None, None)\u000a sql = None\u000a duration = 0.00013494491577148438\u000a------------------------------------------------------------------------\u000aFile: /opt/noc/contrib/lib/django/db/models/sql/compiler.py (Line: 735)\u000aFunction: execute_sql\u000a 728 except EmptyResultSet:\u000a 729 if result_type == MULTI:\u000a 730 return empty_iter()\u000a 731 else:\u000a 732 return\u000a 733 \u000a 734 cursor = self.connection.cursor()\u000a 735 ==> cursor.execute(sql, params)\u000a 736 \u000a 737 if not result_type:\u000a 738 return cursor\u000a 739 if result_type == SINGLE:\u000a 740 if self.query.ordering_aliases:\u000a 741 return cursor.fetchone()[:-len(self.query.ordering_aliases)]\u000aVariables:\u000a cursor = <django.db.backends.util.CursorDebugWrapper object at 0x32c50d0>\u000a self = <django.db.models.sql.compiler.SQLInsertCompiler object at 0x32c5610>\u000a params = (2, 1, '4', '172.25.21.1', u'GigabitEthernet0/0/1-kie-kie-f3-r6-t3-asw0.comstar-ua.net', '00:00:0C:07:AC:00', False, None, 'Seen at kie-kie-f3-r6-t3-asw0:GigabitEthernet0/0/1', '', None, None, 1, None, None)\u000a result_type = None\u000a sql = 'INSERT INTO "ip_address" ("prefix_id", "vrf_id", "afi", "address", "fqdn", "mac", "auto_update_mac", "managed_object_id", "description", "tags", "tt", "style_id", "state_id", "allocated_till", "ipv6_transition_id") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)'\u000a------------------------------------------------------------------------\u000aFile: /opt/noc/contrib/lib/django/db/models/sql/compiler.py (Line: 791)\u000aFunction: execute_sql\u000a 784 r_fmt, r_params = self.connection.ops.return_insert_id()\u000a 785 result.append(r_fmt % col)\u000a 786 params = params + r_params\u000a 787 return ' '.join(result), params\u000a 788 \u000a 789 def execute_sql(self, return_id=False):\u000a 790 self.return_id = return_id\u000a 791 ==> cursor = super(SQLInsertCompiler, self).execute_sql(None)\u000a 792 if not (return_id and cursor):\u000a 793 return\u000a 794 if self.connection.features.can_return_id_from_insert:\u000a 795 return self.connection.ops.fetch_returned_insert_id(cursor)\u000a 796 return self.connection.ops.last_insert_id(cursor,\u000a 797 self.query.model._meta.db_table, self.query.model._meta.pk.column)\u000aVariables:\u000a self = <django.db.models.sql.compiler.SQLInsertCompiler object at 0x32c5610>\u000a return_id = True\u000a------------------------------------------------------------------------\u000aFile: /opt/noc/contrib/lib/django/db/models/query.py (Line: 1436)\u000aFunction: insert_query\u000a 1429 """\u000a 1430 Inserts a new record for the given model. This provides an interface to\u000a 1431 the InsertQuery class and is how Model.save() is implemented. It is not\u000a 1432 part of the public API.\u000a 1433 """\u000a 1434 query = sql.InsertQuery(model)\u000a 1435 query.insert_values(values, raw_values)\u000a 1436 ==> return query.get_compiler(using=using).execute_sql(return_id)\u000a\u000aVariables:\u000a raw_values = False\u000a return_id = True\u000a values = [(<django.db.models.fields.related.ForeignKey object at 0x174e650>, 2), (<django.db.models.fields.related.ForeignKey object at 0x174e7d0>, 1), (<django.db.models.fields.CharField object at 0x174e8d0>, '4'), (<noc.lib.fields.INETField object at 0x174e9d0>, '172.25.21.1'), (<django.db.models.fields.CharField object at 0x174ea90>, u'GigabitEthernet0/0/1-kie-kie-f3-r6-t3-asw0.comstar-ua.net'), (<noc.lib.fields.MACField object at 0x174ec10>, '00:00:0C:07:AC:00'), (<django.db.models.fields.BooleanField object at 0x174ec90>, False), (<django.db.models.fields.related.ForeignKey object at 0x174edd0>, None), (<django.db.models.fields.TextField object at 0x174ef10>, 'Seen at kie-kie-f3-r6-t3-asw0:GigabitEthernet0/0/1'), (<noc.lib.fields.AutoCompleteTagsField object at 0x174ef90>, ''), (<django.db.models.fields.IntegerField object at 0x1750190>, None), (<django.db.models.fields.related.ForeignKey object at 0x1750210>, None), (<django.db.models.fields.related.ForeignKey object at 0x1750350>, 1), (<django.db.models.fields.DateField object at 0x1750490>, None), (<django.db.models.fields.related.OneToOneField object at 0x1750510>, None)]\u000a using = 'default'\u000a query = <django.db.models.sql.subqueries.InsertQuery object at 0x32c58d0>\u000a model = <class 'noc.ip.models.Address'>\u000a------------------------------------------------------------------------\u000aFile: /opt/noc/contrib/lib/django/db/models/manager.py (Line: 195)\u000aFunction: _insert\u000a 188 def using(self, *args, **kwargs):\u000a 189 return self.get_query_set().using(*args, **kwargs)\u000a 190 \u000a 191 def exists(self, *args, **kwargs):\u000a 192 return self.get_query_set().exists(*args, **kwargs)\u000a 193 \u000a 194 def _insert(self, values, **kwargs):\u000a 195 ==> return insert_query(self.model, values, **kwargs)\u000a 196 \u000a 197 def _update(self, values, **kwargs):\u000a 198 return self.get_query_set()._update(values, **kwargs)\u000a 199 \u000a 200 def raw(self, raw_query, params=None, *args, **kwargs):\u000a 201 return RawQuerySet(raw_query=raw_query, model=self.model, params=params, using=self._db, *args, **kwargs)\u000aVariables:\u000a self = <django.db.models.manager.Manager object at 0x1750c50>\u000a values = [(<django.db.models.fields.related.ForeignKey object at 0x174e650>, 2), (<django.db.models.fields.related.ForeignKey object at 0x174e7d0>, 1), (<django.db.models.fields.CharField object at 0x174e8d0>, '4'), (<noc.lib.fields.INETField object at 0x174e9d0>, '172.25.21.1'), (<django.db.models.fields.CharField object at 0x174ea90>, u'GigabitEthernet0/0/1-kie-kie-f3-r6-t3-asw0.comstar-ua.net'), (<noc.lib.fields.MACField object at 0x174ec10>, '00:00:0C:07:AC:00'), (<django.db.models.fields.BooleanField object at 0x174ec90>, False), (<django.db.models.fields.related.ForeignKey object at 0x174edd0>, None), (<django.db.models.fields.TextField object at 0x174ef10>, 'Seen at kie-kie-f3-r6-t3-asw0:GigabitEthernet0/0/1'), (<noc.lib.fields.AutoCompleteTagsField object at 0x174ef90>, ''), (<django.db.models.fields.IntegerField object at 0x1750190>, None), (<django.db.models.fields.related.ForeignKey object at 0x1750210>, None), (<django.db.models.fields.related.ForeignKey object at 0x1750350>, 1), (<django.db.models.fields.DateField object at 0x1750490>, None), (<django.db.models.fields.related.OneToOneField object at 0x1750510>, None)]\u000a kwargs = {'using': 'default', 'return_id': True}\u000a------------------------------------------------------------------------\u000aFile: /opt/noc/contrib/lib/django/db/models/base.py (Line: 553)\u000aFunction: save_base\u000a 546 for f in meta.local_fields]\u000a 547 \u000a 548 record_exists = False\u000a 549 \u000a 550 update_pk = bool(meta.has_auto_field and not pk_set)\u000a 551 if values:\u000a 552 # Create a new record.\u000a 553 ==> result = manager._insert(values, return_id=update_pk, using=using)\u000a 554 else:\u000a 555 # Create a new record with defaults for everything.\u000a 556 result = manager._insert([(meta.pk, connection.ops.pk_default_value())], return_id=update_pk, raw_values=True, using=using)\u000a 557 \u000a 558 if update_pk:\u000a 559 setattr(self, meta.pk.attname, result)\u000aVariables:\u000a origin = <class 'noc.ip.models.Address'>\u000a non_pks = [<django.db.models.fields.related.ForeignKey object at 0x174e650>, <django.db.models.fields.related.ForeignKey object at 0x174e7d0>, <django.db.models.fields.CharField object at 0x174e8d0>, <noc.lib.fields.INETField object at 0x174e9d0>, <django.db.models.fields.CharField object at 0x174ea90>, <noc.lib.fields.MACField object at 0x174ec10>, <django.db.models.fields.BooleanField object at 0x174ec90>, <django.db.models.fields.related.ForeignKey object at 0x174edd0>, <django.db.models.fields.TextField object at 0x174ef10>, <noc.lib.fields.AutoCompleteTagsField object at 0x174ef90>, <django.db.models.fields.IntegerField object at 0x1750190>, <django.db.models.fields.related.ForeignKey object at 0x1750210>, <django.db.models.fields.related.ForeignKey object at 0x1750350>, <django.db.models.fields.DateField object at 0x1750490>, <django.db.models.fields.related.OneToOneField object at 0x1750510>]\u000a f = <django.db.models.fields.related.OneToOneField object at 0x1750510>\u000a self = <Address: default(4): 172.25.21.1>\u000a force_update = False\u000a connection = <django.db.backends.postgresql_psycopg2.base.DatabaseWrapper object at 0x14bd680>\u000a force_insert = False\u000a raw = False\u000a manager = <django.db.models.manager.Manager object at 0x1750c50>\u000a meta = <Options for Address>\u000a values = [(<django.db.models.fields.related.ForeignKey object at 0x174e650>, 2), (<django.db.models.fields.related.ForeignKey object at 0x174e7d0>, 1), (<django.db.models.fields.CharField object at 0x174e8d0>, '4'), (<noc.lib.fields.INETField object at 0x174e9d0>, '172.25.21.1'), (<django.db.models.fields.CharField object at 0x174ea90>, u'GigabitEthernet0/0/1-kie-kie-f3-r6-t3-asw0.comstar-ua.net'), (<noc.lib.fields.MACField object at 0x174ec10>, '00:00:0C:07:AC:00'), (<django.db.models.fields.BooleanField object at 0x174ec90>, False), (<django.db.models.fields.related.ForeignKey object at 0x174edd0>, None), (<django.db.models.fields.TextField object at 0x174ef10>, 'Seen at kie-kie-f3-r6-t3-asw0:GigabitEthernet0/0/1'), (<noc.lib.fields.AutoCompleteTagsField object at 0x174ef90>, ''), (<django.db.models.fields.IntegerField object at 0x1750190>, None), (<django.db.models.fields.related.ForeignKey object at 0x1750210>, None), (<django.db.models.fields.related.ForeignKey object at 0x1750350>, 1), (<django.db.models.fields.DateField object at 0x1750490>, None), (<django.db.models.fields.related.OneToOneField object at 0x1750510>, None)]\u000a pk_val = None\u000a using = 'default'\u000a pk_set = False\u000a org = None\u000a cls = <class 'noc.ip.models.Address'>\u000a update_pk = True\u000a record_exists = False\u000a------------------------------------------------------------------------\u000aFile: /opt/noc/contrib/lib/django/db/models/base.py (Line: 460)\u000aFunction: save\u000a 453 \u000a 454 The 'force_insert' and 'force_update' parameters can be used to insist\u000a 455 that the "save" must be an SQL insert or update (or equivalent for\u000a 456 non-SQL backends), respectively. Normally, they should not be set.\u000a 457 """\u000a 458 if force_insert and force_update:\u000a 459 raise ValueError("Cannot force both insert and updating in model saving.")\u000a 460 ==> self.save_base(using=using, force_insert=force_insert, force_update=force_update)\u000a 461 \u000a 462 save.alters_data = True\u000a 463 \u000a 464 def save_base(self, raw=False, cls=None, origin=None, force_insert=False,\u000a 465 force_update=False, using=None):\u000a 466 """\u000aVariables:\u000a using = None\u000a self = <Address: default(4): 172.25.21.1>\u000a force_update = False\u000a force_insert = False\u000a------------------------------------------------------------------------\u000aFile: /opt/noc/ip/models.py (Line: 681)\u000aFunction: save\u000a 674 if cv:\u000a 675 # Collision detected\u000a 676 raise ValidationError("Address already exists in VRF %s" % cv)\u000a 677 # Detect AFI\u000a 678 self.afi = self.get_afi(self.address)\u000a 679 # Set proper prefix\u000a 680 self.prefix = Prefix.get_parent(self.vrf, self.afi, self.address)\u000a 681 ==> super(Address, self).save(**kwargs)\u000a 682 \u000a 683 ##\u000a 684 ## Field validation\u000a 685 ##\u000a 686 def clean(self):\u000a 687 self.prefix = Prefix.get_parent(self.vrf, self.afi, self.address)\u000aVariables:\u000a self = <Address: default(4): 172.25.21.1>\u000a cv = None\u000a kwargs = {}\u000a------------------------------------------------------------------------\u000aFile: /opt/noc/inv/discovery/daemon.py (Line: 580)\u000aFunction: import_ip\u000a 573 vrf.save()\u000a 574 # Check constraints and save address\u000a 575 if self.check_address_constraint(vrf, a["afi"],\u000a 576 a["ip"], o, a["interface"]):\u000a 577 Address(vrf=vrf, afi=a["afi"],\u000a 578 fqdn=self.get_fqdn(octx, a["interface"], a["ip"]),\u000a 579 mac=a["mac"], address=a["ip"],\u000a 580 ==> description="Seen at %s:%s" % (o, a["interface"])\u000a 581 ).save()\u000a 582 \u000a 583 def schedule_interface_discovery(self):\u000a 584 logging.info("Rescheduling interface discovery")\u000a 585 for o in ManagedObject.objects.filter(is_managed=True,\u000a 586 profile_name__in=self.pmap_interfaces):\u000aVariables:\u000a a = {'interface': 'GigabitEthernet0/0/1', 'ip': '172.25.21.1', 'mac': '00:00:0C:07:AC:00', 'afi': '4'}\u000a octx = {'host': u'kie-kie-f3-r6-t3-asw0', 'object': <ManagedObject: kie-kie-f3-r6-t3-asw0>, 'name': u'kie-kie-f3-r6-t3-asw0', 'domain': None, 'vrf': <VRF: global>}\u000a self = <noc.inv.discovery.daemon.DiscoveryDaemon object at 0x2d47550>\u000a address = None\u000a o = <ManagedObject: kie-kie-f3-r6-t3-asw0>\u000a result = [{'name': 'default', 'addresses': [{'interface': 'Vlanif2700', 'ip': '172.25.21.60', 'mac': '4C:B1:6C:01:46:A6', 'afi': '4'}, {'interface': 'GigabitEthernet0/0/1', 'ip': '172.25.21.1', 'mac': '00:00:0C:07:AC:00', 'afi': '4'}, {'interface': 'GigabitEthernet0/0/1', 'ip': '172.25.21.3', 'mac': 'D4:D7:48:BC:76:C0', 'afi': '4'}]}]\u000a v = {'name': 'default', 'addresses': [{'interface': 'Vlanif2700', 'ip': '172.25.21.60', 'mac': '4C:B1:6C:01:46:A6', 'afi': '4'}, {'interface': 'GigabitEthernet0/0/1', 'ip': '172.25.21.1', 'mac': '00:00:0C:07:AC:00', 'afi': '4'}, {'interface': 'GigabitEthernet0/0/1', 'ip': '172.25.21.3', 'mac': 'D4:D7:48:BC:76:C0', 'afi': '4'}]}\u000a vrf = <VRF: global>\u000a------------------------------------------------------------------------\u000aFile: /opt/noc/inv/discovery/daemon.py (Line: 292)\u000aFunction: process_ip_discovery\u000a 285 def process_ip_discovery(self, r):\u000a 286 """\u000a 287 Process IP discovery results\u000a 288 """\u000a 289 for o, status, result in r:\u000a 290 if status == "C":\u000a 291 try:\u000a 292 ==> self.import_ip(o, result)\u000a 293 except:\u000a 294 error_report()\u000a 295 DiscoveryStatusIP.reschedule(o,\u000a 296 random.randint(*self.ip_success_retry_range), True)\u000a 297 else:\u000a 298 self.o_info(o, "get_interfaces failed: %s" % result)\u000aVariables:\u000a status = u'C'\u000a self = <noc.inv.discovery.daemon.DiscoveryDaemon object at 0x2d47550>\u000a r = [(<ManagedObject: od-acc-sps-6-genuezskaya22a>, u'F', {'text': u'******\u005cn\u005cn', 'code': 19}), (<ManagedObject: kiev-ats250-dslam1>, u'F', {'text': u'Timed out', 'code': 17}), (<ManagedObject: od-acc-sps-7-genuezskaya22a>, u'F', {'text': u'******\u005cn\u005cn', 'code': 19}), (<ManagedObject: od-acc-sps2-suhport>, u'F', {'text': 'Host is down', 'code': 16}), (<ManagedObject: od-acc-sps-1-pushkinskaya12>, u'F', {'text': u'******\u005cn\u005cn', 'code': 19}), (<ManagedObject: kiev-novozab-sw1>, u'F', {'text': 'Host is down', 'code': 16}), (<ManagedObject: kie-kie-f3-r6-t3-asw0>, u'C', [{'name': 'default', 'addresses': [{'interface': 'Vlanif2700', 'ip': '172.25.21.60', 'mac': '4C:B1:6C:01:46:A6', 'afi': '4'}, {'interface': 'GigabitEthernet0/0/1', 'ip': '172.25.21.1', 'mac': '00:00:0C:07:AC:00', 'afi': '4'}, {'interface': 'GigabitEthernet0/0/1', 'ip': '172.25.21.3', 'mac': 'D4:D7:48:BC:76:C0', 'afi': '4'}]}]), (<ManagedObject: od-agg-bunina24-sw1>, u'F', {'text': u'Cancelled', 'code': 20})]\u000a result = [{'name': 'default', 'addresses': [{'interface': 'Vlanif2700', 'ip': '172.25.21.60', 'mac': '4C:B1:6C:01:46:A6', 'afi': '4'}, {'interface': 'GigabitEthernet0/0/1', 'ip': '172.25.21.1', 'mac': '00:00:0C:07:AC:00', 'afi': '4'}, {'interface': 'GigabitEthernet0/0/1', 'ip': '172.25.21.3', 'mac': 'D4:D7:48:BC:76:C0', 'afi': '4'}]}]\u000a o = <ManagedObject: kie-kie-f3-r6-t3-asw0>\u000a------------------------------------------------------------------------\u000aEND OF TRACEBACK
  13. p7
  14. sS'type'
  15. p8
  16. S'Unhandled Exception'
  17. p9
  18. sS'ts'
  19. p10
  20. I1343719388
  21. s.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement