Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UNHANDLED EXCEPTION (2014-09-11 09:58:44.888516)
- Working directory: /opt/noc
- <class 'django.db.utils.DatabaseError'>
- invalid input syntax for type inet: "alic-ct.e"
- LINE 1: ...dress"."vrf_id" = 1 AND "ip_address"."address" = 'alic-ct.e...
- ^
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py (Line: 52)
- Function: execute
- 45 """
- 46
- 47 def __init__(self, cursor):
- 48 self.cursor = cursor
- 49
- 50 def execute(self, query, args=None):
- 51 try:
- 52 ==> return self.cursor.execute(query, args)
- 53 except Database.IntegrityError, e:
- 54 raise utils.IntegrityError, utils.IntegrityError(*tuple(e)), sys.exc_info()[2]
- 55 except Database.DatabaseError, e:
- 56 raise utils.DatabaseError, utils.DatabaseError(*tuple(e)), sys.exc_info()[2]
- 57
- 58 def executemany(self, query, args):
- Variables:
- query =
- 'SELECT "ip_address"."id", "ip_address"."prefix_id", "ip_address"."vrf_id", "ip_address"."afi", "ip_address"."address", "ip_address"."fqdn", "ip_address"."project_id", "ip_address"."mac", "ip_address"."auto_update_mac", "ip_address"."managed_object_id", "ip_address"."description", "ip_address"."tags", "ip_address"."tt", "ip_address"."style_id", "ip_address"."state_id", "ip_address"."allocated_till", "ip_address"."ipv6_transition_id" FROM "ip_address" WHERE ("ip_address"."vrf_id" = %s AND "ip_address"."address" = %s )'
- self =
- <django.db.backends.postgresql_psycopg2.base.CursorWrapper object at 0x7f5044575190>
- args = (1, 'alic-ct.e')
- e =
- DataError('invalid input syntax for type inet: "alic-ct.e"\nLINE 1: ...dress"."vrf_id" = 1 AND "ip_address"."address" = \'alic-ct.e...\n ^\n',)
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/django/db/models/sql/compiler.py (Line: 818)
- Function: execute_sql
- 811 except EmptyResultSet:
- 812 if result_type == MULTI:
- 813 return empty_iter()
- 814 else:
- 815 return
- 816
- 817 cursor = self.connection.cursor()
- 818 ==> cursor.execute(sql, params)
- 819
- 820 if not result_type:
- 821 return cursor
- 822 if result_type == SINGLE:
- 823 if self.query.ordering_aliases:
- 824 return cursor.fetchone()[:-len(self.query.ordering_aliases)]
- Variables:
- cursor = <django.db.backends.util.CursorWrapper object at 0x7f504458bed0>
- self = <django.db.models.sql.compiler.SQLCompiler object at 0x7f5044575150>
- params = (1, 'alic-ct.e')
- result_type = 'multi'
- sql =
- 'SELECT "ip_address"."id", "ip_address"."prefix_id", "ip_address"."vrf_id", "ip_address"."afi", "ip_address"."address", "ip_address"."fqdn", "ip_address"."project_id", "ip_address"."mac", "ip_address"."auto_update_mac", "ip_address"."managed_object_id", "ip_address"."description", "ip_address"."tags", "ip_address"."tt", "ip_address"."style_id", "ip_address"."state_id", "ip_address"."allocated_till", "ip_address"."ipv6_transition_id" FROM "ip_address" WHERE ("ip_address"."vrf_id" = %s AND "ip_address"."address" = %s )'
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/django/db/models/sql/compiler.py (Line: 763)
- Function: results_iter
- 756 fields = None
- 757 has_aggregate_select = bool(self.query.aggregate_select)
- 758 # Set transaction dirty if we're using SELECT FOR UPDATE to ensure
- 759 # a subsequent commit/rollback is executed, so any database locks
- 760 # are released.
- 761 if self.query.select_for_update and transaction.is_managed(self.using):
- 762 transaction.set_dirty(self.using)
- 763 ==> for rows in self.execute_sql(MULTI):
- 764 for row in rows:
- 765 if resolve_columns:
- 766 if fields is None:
- 767 # We only set this up here because
- 768 # related_select_fields isn't populated until
- 769 # execute_sql() has been called.
- Variables:
- fields = None
- self = <django.db.models.sql.compiler.SQLCompiler object at 0x7f5044575150>
- has_aggregate_select = False
- resolve_columns = False
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/django/db/models/query.py (Line: 291)
- Function: iterator
- 284 # Cache db and model outside the loop
- 285 db = self.db
- 286 model = self.model
- 287 compiler = self.query.get_compiler(using=db)
- 288 if fill_cache:
- 289 klass_info = get_klass_info(model, max_depth=max_depth,
- 290 requested=requested, only_load=only_load)
- 291 ==> for row in compiler.results_iter():
- 292 if fill_cache:
- 293 obj, _ = get_cached_row(row, index_start, db, klass_info,
- 294 offset=len(aggregate_select))
- 295 else:
- 296 if skip:
- 297 row_data = row[index_start:aggregate_start]
- Variables:
- requested = None
- fill_cache = False
- aggregate_select = []
- fields =
- [<django.db.models.fields.AutoField: id>,
- <django.db.models.fields.related.ForeignKey: prefix>,
- <django.db.models.fields.related.ForeignKey: vrf>,
- <django.db.models.fields.CharField: afi>,
- <noc.lib.fields.INETField: address>,
- <django.db.models.fields.CharField: fqdn>,
- <django.db.models.fields.related.ForeignKey: project>,
- <noc.lib.fields.MACField: mac>,
- <django.db.models.fields.BooleanField: auto_update_mac>,
- <django.db.models.fields.related.ForeignKey: managed_object>,
- <django.db.models.fields.TextField: description>,
- <noc.lib.fields.TagsField: tags>,
- <django.db.models.fields.IntegerField: tt>,
- <django.db.models.fields.related.ForeignKey: style>,
- <django.db.models.fields.related.ForeignKey: state>,
- <django.db.models.fields.DateField: allocated_till>,
- <django.db.models.fields.related.OneToOneField: ipv6_transition>]
- skip = None
- self = repr() failed
- load_fields = []
- db = 'default'
- index_start = 0
- extra_select = []
- aggregate_start = 17
- model = <class 'noc.ip.models.address.Address'>
- only_load = {}
- max_depth = 5
- compiler = <django.db.models.sql.compiler.SQLCompiler object at 0x7f5044575150>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/django/db/models/query.py (Line: 85)
- Function: __len__
- 78 # Since __len__ is called quite frequently (for example, as part of
- 79 # list(qs), we make some effort here to be as efficient as possible
- 80 # whilst not messing up any existing iterators against the QuerySet.
- 81 if self._result_cache is None:
- 82 if self._iter:
- 83 self._result_cache = list(self._iter)
- 84 else:
- 85 ==> self._result_cache = list(self.iterator())
- 86 elif self._iter:
- 87 self._result_cache.extend(self._iter)
- 88 if self._prefetch_related_lookups and not self._prefetch_done:
- 89 self._prefetch_related_objects()
- 90 return len(self._result_cache)
- 91
- Variables:
- self = repr() failed
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/django/db/models/query.py (Line: 361)
- Function: get
- 354 """
- 355 Performs the query and returns a single object matching the given
- 356 keyword arguments.
- 357 """
- 358 clone = self.filter(*args, **kwargs)
- 359 if self.query.can_filter():
- 360 clone = clone.order_by()
- 361 ==> num = len(clone)
- 362 if num == 1:
- 363 return clone._result_cache[0]
- 364 if not num:
- 365 raise self.model.DoesNotExist("%s matching query does not exist."
- 366 % self.model._meta.object_name)
- 367 raise self.model.MultipleObjectsReturned("get() returned more than one %s -- it returned %s! Lookup parameters were %s"
- Variables:
- clone = repr() failed
- args = ()
- self = repr() failed
- kwargs = {'vrf': <VRF: global>, 'address': 'alic-ct.e'}
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/django/db/models/manager.py (Line: 131)
- Function: get
- 124 def distinct(self, *args, **kwargs):
- 125 return self.get_query_set().distinct(*args, **kwargs)
- 126
- 127 def extra(self, *args, **kwargs):
- 128 return self.get_query_set().extra(*args, **kwargs)
- 129
- 130 def get(self, *args, **kwargs):
- 131 ==> return self.get_query_set().get(*args, **kwargs)
- 132
- 133 def get_or_create(self, **kwargs):
- 134 return self.get_query_set().get_or_create(**kwargs)
- 135
- 136 def create(self, **kwargs):
- 137 return self.get_query_set().create(**kwargs)
- Variables:
- self = <django.db.models.manager.Manager object at 0x7f50458d0190>
- args = ()
- kwargs = {'vrf': <VRF: global>, 'address': 'alic-ct.e'}
- ------------------------------------------------------------------------
- File: /opt/noc/sa/models/managedobject.py (Line: 306)
- Function: sync_ipam
- 299 from noc.ip.models.address import Address
- 300 from noc.ip.models.vrf import VRF
- 301 # Generate FQDN from template
- 302 fqdn = self.object_profile.get_fqdn(self)
- 303 # Get existing IPAM record
- 304 vrf = self.vrf if self.vrf else VRF.get_global()
- 305 try:
- 306 ==> a = Address.objects.get(vrf=vrf, address=self.address)
- 307 except Address.DoesNotExist:
- 308 # Create new address
- 309 Address(
- 310 vrf=vrf,
- 311 address=self.address,
- 312 fqdn=fqdn,
- Variables:
- self = <ManagedObject: alic-ct.e>
- Address = <class 'noc.ip.models.address.Address'>
- VRF = <class 'noc.ip.models.vrf.VRF'>
- vrf = <VRF: global>
- fqdn = 'alic-ct.e'
- ------------------------------------------------------------------------
- File: /opt/noc/sa/models/managedobject.py (Line: 271)
- Function: save
- 264 old = ManagedObject.objects.get(id=self.id)
- 265 else:
- 266 old = None
- 267 # Save
- 268 super(ManagedObject, self).save()
- 269 # IPAM sync
- 270 if self.object_profile.sync_ipam:
- 271 ==> self.sync_ipam()
- 272 # Notify changes
- 273 if ((old is None and self.trap_source_ip) or
- 274 (old and self.trap_source_ip != old.trap_source_ip) or
- 275 (old and self.activator.id != old.activator.id)):
- 276 self.sae_refresh_event_filter()
- 277 # Notify new object
- Variables:
- self = <ManagedObject: alic-ct.e>
- old = <ManagedObject: alic-ct.e>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/extmodelapplication.py (Line: 440)
- Function: api_update
- 433 try:
- 434 o = self.queryset(request).get(**{self.pk: int(id)})
- 435 except self.model.DoesNotExist:
- 436 return HttpResponse("", status=self.NOT_FOUND)
- 437 for k, v in attrs.items():
- 438 setattr(o, k, v)
- 439 try:
- 440 ==> o.save()
- 441 if m2m_attrs:
- 442 self.update_m2ms(o, m2m_attrs)
- 443 except IntegrityError:
- 444 return self.render_json(
- 445 {
- 446 "status": False,
- Variables:
- o = <ManagedObject: alic-ct.e>
- k = 'vrf'
- request =
- <WSGIRequest
- path:/sa/managedobject/32/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {}>,
- COOKIES:{'PPA_ID': 'v5eogt5n2v6oqptu0iohs2m637',
- 'csrftoken': 'opmf3oe8G3imSSsnXynCMkOxLk0le01H',
- 'sessionid': '1840817d2ea0f1d9e0a1ba6ed00d0837',
- 'webfx-tree-cookie-persistence': 'wfxt-20+wfxt-29+wfxt-27+wfxt-25+wfxt-23+wfxt-21+wfxt-19+wfxt-17+wfxt-15+wfxt-10+wfxt-16+wfxt-14+wfxt-292+wfxt-290+wfxt-335+wfxt-333+wfxt-12+wfxt-309+wfxt-311+wfxt-4+wfxt-6+wfxt-339+wfxt-8+wfxt-18+wfxt-34'},
- META:{'CONTENT_LENGTH': '576',
- 'CONTENT_TYPE': 'application/json; charset=UTF-8',
- 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
- 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'sessionid=1840817d2ea0f1d9e0a1ba6ed00d0837; csrftoken=opmf3oe8G3imSSsnXynCMkOxLk0le01H; PPA_ID=v5eogt5n2v6oqptu0iohs2m637; webfx-tree-cookie-persistence=wfxt-20+wfxt-29+wfxt-27+wfxt-25+wfxt-23+wfxt-21+wfxt-19+wfxt-17+wfxt-15+wfxt-10+wfxt-16+wfxt-14+wfxt-292+wfxt-290+wfxt-335+wfxt-333+wfxt-12+wfxt-309+wfxt-311+wfxt-4+wfxt-6+wfxt-339+wfxt-8+wfxt-18+wfxt-34',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_REFERER': 'http://10.58.2.246/main/desktop/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0',
- 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
- 'PATH_INFO': u'/sa/managedobject/32/',
- 'QUERY_STRING': '',
- 'REMOTE_ADDR': '127.0.0.1',
- 'REQUEST_METHOD': 'PUT',
- 'SCRIPT_NAME': u'',
- 'SERVER_NAME': '127.0.0.1',
- 'SERVER_PORT': '8000',
- 'SERVER_PROTOCOL': 'HTTP/1.0',
- 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x7f50571080c0>,
- 'wsgi.input': <_io.BytesIO object at 0x7f504443a050>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- m2m_attrs = {}
- self =
- <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x7f5044b370d0>
- attrs =
- {'activator': <Activator: default>,
- 'address': 'alic-ct.e',
- 'administrative_domain': <AdministrativeDomain: default>,
- 'auth_profile': None,
- 'collector': None,
- 'config_diff_filter_rule': None,
- 'config_filter_rule': None,
- 'config_validation_rule': None,
- 'description': '',
- 'is_managed': True,
- 'max_scripts': 0,
- 'name': 'alic-ct.e',
- 'object_profile': <ManagedObjectProfile: catalist>,
- 'password': '[htydfv',
- 'port': 0,
- 'profile_name': 'NSN.hiX56xx',
- 'remote_path': '',
- 'scheme': 0,
- 'service_terminator': None,
- 'shape': '',
- 'snmp_ro': 'NeTro21',
- 'snmp_rw': '',
- 'super_password': '235cfxrjd',
- 'tags': [u'spd', u'ats62'],
- 'termination_group': None,
- 'trap_community': '',
- 'trap_source_ip': '',
- 'user': 'bee26',
- 'vc_domain': <VCDomain: default>,
- 'vrf': None}
- v = None
- id = u'32'
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/site.py (Line: 233)
- Function: inner
- 226 for k, v in request.POST.lists())
- 227 elif request.method == "GET":
- 228 a = dict((k, v[0] if len(v) == 1 else v)
- 229 for k, v in request.GET.lists())
- 230 logging.debug("API %s %s %s" % (request.method,
- 231 request.path, a))
- 232 # Call handler
- 233 ==> r = v(request, *args, **kwargs)
- 234 # Dump SQL statements
- 235 if self.log_sql_statements:
- 236 from django.db import connections
- 237 tsc = 0
- 238 sc = defaultdict(int)
- 239 for conn in connections.all():
- Variables:
- args = ()
- view_map =
- {'DELETE': <bound method ManagedObjectApplication.api_delete of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x7f5044b370d0>>,
- 'GET': <bound method ManagedObjectApplication.api_read of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x7f5044b370d0>>,
- 'PUT': <bound method ManagedObjectApplication.api_update of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x7f5044b370d0>>}
- Form = <class 'django.forms.forms.Form'>
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- self = <noc.lib.app.site.Site object at 0x7f5058713610>
- v =
- <bound method ManagedObjectApplication.api_update of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x7f5044b370d0>>
- request =
- <WSGIRequest
- path:/sa/managedobject/32/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {}>,
- COOKIES:{'PPA_ID': 'v5eogt5n2v6oqptu0iohs2m637',
- 'csrftoken': 'opmf3oe8G3imSSsnXynCMkOxLk0le01H',
- 'sessionid': '1840817d2ea0f1d9e0a1ba6ed00d0837',
- 'webfx-tree-cookie-persistence': 'wfxt-20+wfxt-29+wfxt-27+wfxt-25+wfxt-23+wfxt-21+wfxt-19+wfxt-17+wfxt-15+wfxt-10+wfxt-16+wfxt-14+wfxt-292+wfxt-290+wfxt-335+wfxt-333+wfxt-12+wfxt-309+wfxt-311+wfxt-4+wfxt-6+wfxt-339+wfxt-8+wfxt-18+wfxt-34'},
- META:{'CONTENT_LENGTH': '576',
- 'CONTENT_TYPE': 'application/json; charset=UTF-8',
- 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
- 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'sessionid=1840817d2ea0f1d9e0a1ba6ed00d0837; csrftoken=opmf3oe8G3imSSsnXynCMkOxLk0le01H; PPA_ID=v5eogt5n2v6oqptu0iohs2m637; webfx-tree-cookie-persistence=wfxt-20+wfxt-29+wfxt-27+wfxt-25+wfxt-23+wfxt-21+wfxt-19+wfxt-17+wfxt-15+wfxt-10+wfxt-16+wfxt-14+wfxt-292+wfxt-290+wfxt-335+wfxt-333+wfxt-12+wfxt-309+wfxt-311+wfxt-4+wfxt-6+wfxt-339+wfxt-8+wfxt-18+wfxt-34',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_REFERER': 'http://10.58.2.246/main/desktop/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0',
- 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
- 'PATH_INFO': u'/sa/managedobject/32/',
- 'QUERY_STRING': '',
- 'REMOTE_ADDR': '127.0.0.1',
- 'REQUEST_METHOD': 'PUT',
- 'SCRIPT_NAME': u'',
- 'SERVER_NAME': '127.0.0.1',
- 'SERVER_PORT': '8000',
- 'SERVER_PROTOCOL': 'HTTP/1.0',
- 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x7f50571080c0>,
- 'wsgi.input': <_io.BytesIO object at 0x7f504443a050>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
- to_log_api_call = False
- kwargs = {'id': u'32'}
- PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
- app =
- <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x7f5044b370d0>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment