Guest User

Untitled

a guest
Sep 11th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.09 KB | None | 0 0
  1. UNHANDLED EXCEPTION (2014-09-11 09:58:44.888516)
  2. Working directory: /opt/noc
  3. <class 'django.db.utils.DatabaseError'>
  4. invalid input syntax for type inet: "alic-ct.e"
  5. LINE 1: ...dress"."vrf_id" = 1 AND "ip_address"."address" = 'alic-ct.e...
  6. ^
  7.  
  8. START OF TRACEBACK
  9. ------------------------------------------------------------------------
  10. File: /opt/noc/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py (Line: 52)
  11. Function: execute
  12. 45 """
  13. 46
  14. 47 def __init__(self, cursor):
  15. 48 self.cursor = cursor
  16. 49
  17. 50 def execute(self, query, args=None):
  18. 51 try:
  19. 52 ==> return self.cursor.execute(query, args)
  20. 53 except Database.IntegrityError, e:
  21. 54 raise utils.IntegrityError, utils.IntegrityError(*tuple(e)), sys.exc_info()[2]
  22. 55 except Database.DatabaseError, e:
  23. 56 raise utils.DatabaseError, utils.DatabaseError(*tuple(e)), sys.exc_info()[2]
  24. 57
  25. 58 def executemany(self, query, args):
  26. Variables:
  27. query =
  28. '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 )'
  29. self =
  30. <django.db.backends.postgresql_psycopg2.base.CursorWrapper object at 0x7f5044575190>
  31. args = (1, 'alic-ct.e')
  32. e =
  33. 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',)
  34. ------------------------------------------------------------------------
  35. File: /opt/noc/lib/python2.7/site-packages/django/db/models/sql/compiler.py (Line: 818)
  36. Function: execute_sql
  37. 811 except EmptyResultSet:
  38. 812 if result_type == MULTI:
  39. 813 return empty_iter()
  40. 814 else:
  41. 815 return
  42. 816
  43. 817 cursor = self.connection.cursor()
  44. 818 ==> cursor.execute(sql, params)
  45. 819
  46. 820 if not result_type:
  47. 821 return cursor
  48. 822 if result_type == SINGLE:
  49. 823 if self.query.ordering_aliases:
  50. 824 return cursor.fetchone()[:-len(self.query.ordering_aliases)]
  51. Variables:
  52. cursor = <django.db.backends.util.CursorWrapper object at 0x7f504458bed0>
  53. self = <django.db.models.sql.compiler.SQLCompiler object at 0x7f5044575150>
  54. params = (1, 'alic-ct.e')
  55. result_type = 'multi'
  56. sql =
  57. '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 )'
  58. ------------------------------------------------------------------------
  59. File: /opt/noc/lib/python2.7/site-packages/django/db/models/sql/compiler.py (Line: 763)
  60. Function: results_iter
  61. 756 fields = None
  62. 757 has_aggregate_select = bool(self.query.aggregate_select)
  63. 758 # Set transaction dirty if we're using SELECT FOR UPDATE to ensure
  64. 759 # a subsequent commit/rollback is executed, so any database locks
  65. 760 # are released.
  66. 761 if self.query.select_for_update and transaction.is_managed(self.using):
  67. 762 transaction.set_dirty(self.using)
  68. 763 ==> for rows in self.execute_sql(MULTI):
  69. 764 for row in rows:
  70. 765 if resolve_columns:
  71. 766 if fields is None:
  72. 767 # We only set this up here because
  73. 768 # related_select_fields isn't populated until
  74. 769 # execute_sql() has been called.
  75. Variables:
  76. fields = None
  77. self = <django.db.models.sql.compiler.SQLCompiler object at 0x7f5044575150>
  78. has_aggregate_select = False
  79. resolve_columns = False
  80. ------------------------------------------------------------------------
  81. File: /opt/noc/lib/python2.7/site-packages/django/db/models/query.py (Line: 291)
  82. Function: iterator
  83. 284 # Cache db and model outside the loop
  84. 285 db = self.db
  85. 286 model = self.model
  86. 287 compiler = self.query.get_compiler(using=db)
  87. 288 if fill_cache:
  88. 289 klass_info = get_klass_info(model, max_depth=max_depth,
  89. 290 requested=requested, only_load=only_load)
  90. 291 ==> for row in compiler.results_iter():
  91. 292 if fill_cache:
  92. 293 obj, _ = get_cached_row(row, index_start, db, klass_info,
  93. 294 offset=len(aggregate_select))
  94. 295 else:
  95. 296 if skip:
  96. 297 row_data = row[index_start:aggregate_start]
  97. Variables:
  98. requested = None
  99. fill_cache = False
  100. aggregate_select = []
  101. fields =
  102. [<django.db.models.fields.AutoField: id>,
  103. <django.db.models.fields.related.ForeignKey: prefix>,
  104. <django.db.models.fields.related.ForeignKey: vrf>,
  105. <django.db.models.fields.CharField: afi>,
  106. <noc.lib.fields.INETField: address>,
  107. <django.db.models.fields.CharField: fqdn>,
  108. <django.db.models.fields.related.ForeignKey: project>,
  109. <noc.lib.fields.MACField: mac>,
  110. <django.db.models.fields.BooleanField: auto_update_mac>,
  111. <django.db.models.fields.related.ForeignKey: managed_object>,
  112. <django.db.models.fields.TextField: description>,
  113. <noc.lib.fields.TagsField: tags>,
  114. <django.db.models.fields.IntegerField: tt>,
  115. <django.db.models.fields.related.ForeignKey: style>,
  116. <django.db.models.fields.related.ForeignKey: state>,
  117. <django.db.models.fields.DateField: allocated_till>,
  118. <django.db.models.fields.related.OneToOneField: ipv6_transition>]
  119. skip = None
  120. self = repr() failed
  121. load_fields = []
  122. db = 'default'
  123. index_start = 0
  124. extra_select = []
  125. aggregate_start = 17
  126. model = <class 'noc.ip.models.address.Address'>
  127. only_load = {}
  128. max_depth = 5
  129. compiler = <django.db.models.sql.compiler.SQLCompiler object at 0x7f5044575150>
  130. ------------------------------------------------------------------------
  131. File: /opt/noc/lib/python2.7/site-packages/django/db/models/query.py (Line: 85)
  132. Function: __len__
  133. 78 # Since __len__ is called quite frequently (for example, as part of
  134. 79 # list(qs), we make some effort here to be as efficient as possible
  135. 80 # whilst not messing up any existing iterators against the QuerySet.
  136. 81 if self._result_cache is None:
  137. 82 if self._iter:
  138. 83 self._result_cache = list(self._iter)
  139. 84 else:
  140. 85 ==> self._result_cache = list(self.iterator())
  141. 86 elif self._iter:
  142. 87 self._result_cache.extend(self._iter)
  143. 88 if self._prefetch_related_lookups and not self._prefetch_done:
  144. 89 self._prefetch_related_objects()
  145. 90 return len(self._result_cache)
  146. 91
  147. Variables:
  148. self = repr() failed
  149. ------------------------------------------------------------------------
  150. File: /opt/noc/lib/python2.7/site-packages/django/db/models/query.py (Line: 361)
  151. Function: get
  152. 354 """
  153. 355 Performs the query and returns a single object matching the given
  154. 356 keyword arguments.
  155. 357 """
  156. 358 clone = self.filter(*args, **kwargs)
  157. 359 if self.query.can_filter():
  158. 360 clone = clone.order_by()
  159. 361 ==> num = len(clone)
  160. 362 if num == 1:
  161. 363 return clone._result_cache[0]
  162. 364 if not num:
  163. 365 raise self.model.DoesNotExist("%s matching query does not exist."
  164. 366 % self.model._meta.object_name)
  165. 367 raise self.model.MultipleObjectsReturned("get() returned more than one %s -- it returned %s! Lookup parameters were %s"
  166. Variables:
  167. clone = repr() failed
  168. args = ()
  169. self = repr() failed
  170. kwargs = {'vrf': <VRF: global>, 'address': 'alic-ct.e'}
  171. ------------------------------------------------------------------------
  172. File: /opt/noc/lib/python2.7/site-packages/django/db/models/manager.py (Line: 131)
  173. Function: get
  174. 124 def distinct(self, *args, **kwargs):
  175. 125 return self.get_query_set().distinct(*args, **kwargs)
  176. 126
  177. 127 def extra(self, *args, **kwargs):
  178. 128 return self.get_query_set().extra(*args, **kwargs)
  179. 129
  180. 130 def get(self, *args, **kwargs):
  181. 131 ==> return self.get_query_set().get(*args, **kwargs)
  182. 132
  183. 133 def get_or_create(self, **kwargs):
  184. 134 return self.get_query_set().get_or_create(**kwargs)
  185. 135
  186. 136 def create(self, **kwargs):
  187. 137 return self.get_query_set().create(**kwargs)
  188. Variables:
  189. self = <django.db.models.manager.Manager object at 0x7f50458d0190>
  190. args = ()
  191. kwargs = {'vrf': <VRF: global>, 'address': 'alic-ct.e'}
  192. ------------------------------------------------------------------------
  193. File: /opt/noc/sa/models/managedobject.py (Line: 306)
  194. Function: sync_ipam
  195. 299 from noc.ip.models.address import Address
  196. 300 from noc.ip.models.vrf import VRF
  197. 301 # Generate FQDN from template
  198. 302 fqdn = self.object_profile.get_fqdn(self)
  199. 303 # Get existing IPAM record
  200. 304 vrf = self.vrf if self.vrf else VRF.get_global()
  201. 305 try:
  202. 306 ==> a = Address.objects.get(vrf=vrf, address=self.address)
  203. 307 except Address.DoesNotExist:
  204. 308 # Create new address
  205. 309 Address(
  206. 310 vrf=vrf,
  207. 311 address=self.address,
  208. 312 fqdn=fqdn,
  209. Variables:
  210. self = <ManagedObject: alic-ct.e>
  211. Address = <class 'noc.ip.models.address.Address'>
  212. VRF = <class 'noc.ip.models.vrf.VRF'>
  213. vrf = <VRF: global>
  214. fqdn = 'alic-ct.e'
  215. ------------------------------------------------------------------------
  216. File: /opt/noc/sa/models/managedobject.py (Line: 271)
  217. Function: save
  218. 264 old = ManagedObject.objects.get(id=self.id)
  219. 265 else:
  220. 266 old = None
  221. 267 # Save
  222. 268 super(ManagedObject, self).save()
  223. 269 # IPAM sync
  224. 270 if self.object_profile.sync_ipam:
  225. 271 ==> self.sync_ipam()
  226. 272 # Notify changes
  227. 273 if ((old is None and self.trap_source_ip) or
  228. 274 (old and self.trap_source_ip != old.trap_source_ip) or
  229. 275 (old and self.activator.id != old.activator.id)):
  230. 276 self.sae_refresh_event_filter()
  231. 277 # Notify new object
  232. Variables:
  233. self = <ManagedObject: alic-ct.e>
  234. old = <ManagedObject: alic-ct.e>
  235. ------------------------------------------------------------------------
  236. File: /opt/noc/lib/app/extmodelapplication.py (Line: 440)
  237. Function: api_update
  238. 433 try:
  239. 434 o = self.queryset(request).get(**{self.pk: int(id)})
  240. 435 except self.model.DoesNotExist:
  241. 436 return HttpResponse("", status=self.NOT_FOUND)
  242. 437 for k, v in attrs.items():
  243. 438 setattr(o, k, v)
  244. 439 try:
  245. 440 ==> o.save()
  246. 441 if m2m_attrs:
  247. 442 self.update_m2ms(o, m2m_attrs)
  248. 443 except IntegrityError:
  249. 444 return self.render_json(
  250. 445 {
  251. 446 "status": False,
  252. Variables:
  253. o = <ManagedObject: alic-ct.e>
  254. k = 'vrf'
  255. request =
  256. <WSGIRequest
  257. path:/sa/managedobject/32/,
  258. GET:<QueryDict: {}>,
  259. POST:<QueryDict: {}>,
  260. COOKIES:{'PPA_ID': 'v5eogt5n2v6oqptu0iohs2m637',
  261. 'csrftoken': 'opmf3oe8G3imSSsnXynCMkOxLk0le01H',
  262. 'sessionid': '1840817d2ea0f1d9e0a1ba6ed00d0837',
  263. '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'},
  264. META:{'CONTENT_LENGTH': '576',
  265. 'CONTENT_TYPE': 'application/json; charset=UTF-8',
  266. 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  267. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  268. 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
  269. 'HTTP_CONNECTION': 'close',
  270. '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',
  271. 'HTTP_HOST': '127.0.0.1:8000',
  272. 'HTTP_REFERER': 'http://10.58.2.246/main/desktop/',
  273. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0',
  274. 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
  275. 'PATH_INFO': u'/sa/managedobject/32/',
  276. 'QUERY_STRING': '',
  277. 'REMOTE_ADDR': '127.0.0.1',
  278. 'REQUEST_METHOD': 'PUT',
  279. 'SCRIPT_NAME': u'',
  280. 'SERVER_NAME': '127.0.0.1',
  281. 'SERVER_PORT': '8000',
  282. 'SERVER_PROTOCOL': 'HTTP/1.0',
  283. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x7f50571080c0>,
  284. 'wsgi.input': <_io.BytesIO object at 0x7f504443a050>,
  285. 'wsgi.multiprocess': True,
  286. 'wsgi.multithread': False,
  287. 'wsgi.run_once': False,
  288. 'wsgi.url_scheme': 'http',
  289. 'wsgi.version': (1, 0)}>
  290. m2m_attrs = {}
  291. self =
  292. <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x7f5044b370d0>
  293. attrs =
  294. {'activator': <Activator: default>,
  295. 'address': 'alic-ct.e',
  296. 'administrative_domain': <AdministrativeDomain: default>,
  297. 'auth_profile': None,
  298. 'collector': None,
  299. 'config_diff_filter_rule': None,
  300. 'config_filter_rule': None,
  301. 'config_validation_rule': None,
  302. 'description': '',
  303. 'is_managed': True,
  304. 'max_scripts': 0,
  305. 'name': 'alic-ct.e',
  306. 'object_profile': <ManagedObjectProfile: catalist>,
  307. 'password': '[htydfv',
  308. 'port': 0,
  309. 'profile_name': 'NSN.hiX56xx',
  310. 'remote_path': '',
  311. 'scheme': 0,
  312. 'service_terminator': None,
  313. 'shape': '',
  314. 'snmp_ro': 'NeTro21',
  315. 'snmp_rw': '',
  316. 'super_password': '235cfxrjd',
  317. 'tags': [u'spd', u'ats62'],
  318. 'termination_group': None,
  319. 'trap_community': '',
  320. 'trap_source_ip': '',
  321. 'user': 'bee26',
  322. 'vc_domain': <VCDomain: default>,
  323. 'vrf': None}
  324. v = None
  325. id = u'32'
  326. ------------------------------------------------------------------------
  327. File: /opt/noc/lib/app/site.py (Line: 233)
  328. Function: inner
  329. 226 for k, v in request.POST.lists())
  330. 227 elif request.method == "GET":
  331. 228 a = dict((k, v[0] if len(v) == 1 else v)
  332. 229 for k, v in request.GET.lists())
  333. 230 logging.debug("API %s %s %s" % (request.method,
  334. 231 request.path, a))
  335. 232 # Call handler
  336. 233 ==> r = v(request, *args, **kwargs)
  337. 234 # Dump SQL statements
  338. 235 if self.log_sql_statements:
  339. 236 from django.db import connections
  340. 237 tsc = 0
  341. 238 sc = defaultdict(int)
  342. 239 for conn in connections.all():
  343. Variables:
  344. args = ()
  345. view_map =
  346. {'DELETE': <bound method ManagedObjectApplication.api_delete of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x7f5044b370d0>>,
  347. 'GET': <bound method ManagedObjectApplication.api_read of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x7f5044b370d0>>,
  348. 'PUT': <bound method ManagedObjectApplication.api_update of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x7f5044b370d0>>}
  349. Form = <class 'django.forms.forms.Form'>
  350. DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
  351. self = <noc.lib.app.site.Site object at 0x7f5058713610>
  352. v =
  353. <bound method ManagedObjectApplication.api_update of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x7f5044b370d0>>
  354. request =
  355. <WSGIRequest
  356. path:/sa/managedobject/32/,
  357. GET:<QueryDict: {}>,
  358. POST:<QueryDict: {}>,
  359. COOKIES:{'PPA_ID': 'v5eogt5n2v6oqptu0iohs2m637',
  360. 'csrftoken': 'opmf3oe8G3imSSsnXynCMkOxLk0le01H',
  361. 'sessionid': '1840817d2ea0f1d9e0a1ba6ed00d0837',
  362. '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'},
  363. META:{'CONTENT_LENGTH': '576',
  364. 'CONTENT_TYPE': 'application/json; charset=UTF-8',
  365. 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  366. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  367. 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
  368. 'HTTP_CONNECTION': 'close',
  369. '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',
  370. 'HTTP_HOST': '127.0.0.1:8000',
  371. 'HTTP_REFERER': 'http://10.58.2.246/main/desktop/',
  372. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0',
  373. 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
  374. 'PATH_INFO': u'/sa/managedobject/32/',
  375. 'QUERY_STRING': '',
  376. 'REMOTE_ADDR': '127.0.0.1',
  377. 'REQUEST_METHOD': 'PUT',
  378. 'SCRIPT_NAME': u'',
  379. 'SERVER_NAME': '127.0.0.1',
  380. 'SERVER_PORT': '8000',
  381. 'SERVER_PROTOCOL': 'HTTP/1.0',
  382. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x7f50571080c0>,
  383. 'wsgi.input': <_io.BytesIO object at 0x7f504443a050>,
  384. 'wsgi.multiprocess': True,
  385. 'wsgi.multithread': False,
  386. 'wsgi.run_once': False,
  387. 'wsgi.url_scheme': 'http',
  388. 'wsgi.version': (1, 0)}>
  389. InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  390. to_log_api_call = False
  391. kwargs = {'id': u'32'}
  392. PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
  393. app =
  394. <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x7f5044b370d0>
  395. ------------------------------------------------------------------------
  396. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment