Advertisement
Guest User

Untitled

a guest
Jan 28th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.58 KB | None | 0 0
  1. UNHANDLED EXCEPTION (2019-01-28 14:37:57.606293)
  2. PROCESS: ./services/web/service.py
  3. VERSION: 19.1
  4.  
  5. BRANCH: HEAD CHANGESET: e8d18ab3
  6. ERROR FINGERPRINT: 4f3799f5-b745-5af8-9971-76eafd5fc182
  7. WORKING DIRECTORY: /opt/noc
  8. EXCEPTION: <type 'exceptions.UnboundLocalError'> local variable 'c' referenced before assignment
  9. START OF TRACEBACK
  10. ------------------------------------------------------------------------
  11. File: services/web/apps/inv/inv/views.py (Line: 157)
  12. Function: api_add_group
  13. 150 return self.response_not_found()
  14. 151 c = c.id
  15. 152 elif container:
  16. 153 return self.response_bad_request()
  17. 154 m = ObjectModel.get_by_id(type)
  18. 155 if not m:
  19. 156 return self.response_not_found()
  20. 157 ==> o = Object(name=name, model=m, container=c)
  21. 158 if serial and m.get_data("asset", "part_no0"):
  22. 159 o.set_data("asset", "serial", serial)
  23. 160 o.save()
  24. 161 o.log("Created", user=request.user.username,
  25. 162 system="WEB", op="CREATE")
  26. 163 return str(o.id)
  27. Variables:
  28. container = None
  29. name = u'Office'
  30. m = <ObjectModel: PoP | Access>
  31. self =
  32. <noc.services.web.apps.inv.inv.views.InvApplication object at 0x7fcff7cbd4d0>
  33. request =
  34. <WSGIRequest
  35. path:/inv/inv/add_group/,
  36. GET:<QueryDict: {}>,
  37. POST:<QueryDict: {u'{"name":"Office","type":"5c48310eb19531a79f19ffd9","serial":"","container":null}': [u'']}>,
  38. COOKIES:{'csrftoken': 'VcphIiG1vjbGolQ5szzsQj2PEsQM63Xc',
  39. 'noc_user': '2|1:0|10:1548235463|8:noc_user|8:YWRtaW4=|8500770cf9ca7b43eb957b28c6c66bd952b5f7ff9f2d38cc633c7ea468238935',
  40. 'user': '2|1:0|10:1548233403|4:user|8:YWRtaW4=|0c22cd08d5ad9e9f91691ce69ef6e34744add8f30a7769e32bf0afa609c692ac'},
  41. META:{'CONTENT_LENGTH': '80',
  42. 'CONTENT_TYPE': 'application/json',
  43. 'HTTP_ACCEPT': '*/*',
  44. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br',
  45. 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
  46. 'HTTP_CONNECTION': 'close',
  47. 'HTTP_COOKIE': 'user="2|1:0|10:1548233403|4:user|8:YWRtaW4=|0c22cd08d5ad9e9f91691ce69ef6e34744add8f30a7769e32bf0afa609c692ac"; noc_user="2|1:0|10:1548235463|8:noc_user|8:YWRtaW4=|8500770cf9ca7b43eb957b28c6c66bd952b5f7ff9f2d38cc633c7ea468238935"; csrftoken=VcphIiG1vjbGolQ5szzsQj2PEsQM63Xc',
  48. 'HTTP_HOST': '10.200.82.62',
  49. 'HTTP_ORIGIN': 'https://10.200.82.62',
  50. 'HTTP_REFERER': 'https://10.200.82.62/',
  51. 'HTTP_REMOTE_USER': 'admin',
  52. 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
  53. 'HTTP_X_FORWARDED_FOR': '10.200.82.167',
  54. 'HTTP_X_FORWARDED_PROTO': 'https',
  55. 'HTTP_X_REAL_IP': '10.200.82.167',
  56. 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
  57. 'HTTP_X_SCHEME': 'https',
  58. 'PATH_INFO': u'/inv/inv/add_group/',
  59. 'QUERY_STRING': '',
  60. 'REMOTE_ADDR': '10.200.82.167',
  61. 'REQUEST_METHOD': 'POST',
  62. 'SCRIPT_NAME': u'',
  63. 'SERVER_NAME': '10.200.82.62',
  64. 'SERVER_PORT': '443',
  65. 'SERVER_PROTOCOL': 'HTTP/1.0',
  66. 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7fd016fd01e0>,
  67. 'wsgi.input': <_io.BytesIO object at 0x7fcff5d24c50>,
  68. 'wsgi.multiprocess': True,
  69. 'wsgi.multithread': False,
  70. 'wsgi.run_once': False,
  71. 'wsgi.url_scheme': 'https',
  72. 'wsgi.version': (1, 0)}>
  73. serial = u''
  74. type = '5c48310eb19531a79f19ffd9'
  75. ------------------------------------------------------------------------
  76. File: lib/app/site.py (Line: 229)
  77. Function: inner
  78. 222 for k, v in request.POST.lists())
  79. 223 elif request.method == "GET":
  80. 224 a = dict((k, v[0] if len(v) == 1 else v)
  81. 225 for k, v in request.GET.lists())
  82. 226 app_logger.debug("API %s %s %s",
  83. 227 request.method, request.path, a)
  84. 228 # Call handler
  85. 229 ==> r = v(request, *args, **kwargs)
  86. 230 # Dump SQL statements
  87. 231 if self.log_sql_statements:
  88. 232 from django.db import connections
  89. 233 tsc = 0
  90. 234 sc = defaultdict(int)
  91. 235 for conn in connections.all():
  92. Variables:
  93. errors = None
  94. view_map =
  95. {'POST': <bound method InvApplication.api_add_group of <noc.services.web.apps.inv.inv.views.InvApplication object at 0x7fcff7cbd4d0>>}
  96. g =
  97. {u'container': None,
  98. u'name': u'Office',
  99. u'serial': u'',
  100. u'type': u'5c48310eb19531a79f19ffd9'}
  101. DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
  102. kwargs =
  103. {u'name': u'Office', u'serial': u'', u'type': '5c48310eb19531a79f19ffd9'}
  104. self = <noc.lib.app.site.Site object at 0x7fd000c46a90>
  105. to_log_api_call = False
  106. args = ()
  107. request =
  108. <WSGIRequest
  109. path:/inv/inv/add_group/,
  110. GET:<QueryDict: {}>,
  111. POST:<QueryDict: {u'{"name":"Office","type":"5c48310eb19531a79f19ffd9","serial":"","container":null}': [u'']}>,
  112. COOKIES:{'csrftoken': 'VcphIiG1vjbGolQ5szzsQj2PEsQM63Xc',
  113. 'noc_user': '2|1:0|10:1548235463|8:noc_user|8:YWRtaW4=|8500770cf9ca7b43eb957b28c6c66bd952b5f7ff9f2d38cc633c7ea468238935',
  114. 'user': '2|1:0|10:1548233403|4:user|8:YWRtaW4=|0c22cd08d5ad9e9f91691ce69ef6e34744add8f30a7769e32bf0afa609c692ac'},
  115. META:{'CONTENT_LENGTH': '80',
  116. 'CONTENT_TYPE': 'application/json',
  117. 'HTTP_ACCEPT': '*/*',
  118. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br',
  119. 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
  120. 'HTTP_CONNECTION': 'close',
  121. 'HTTP_COOKIE': 'user="2|1:0|10:1548233403|4:user|8:YWRtaW4=|0c22cd08d5ad9e9f91691ce69ef6e34744add8f30a7769e32bf0afa609c692ac"; noc_user="2|1:0|10:1548235463|8:noc_user|8:YWRtaW4=|8500770cf9ca7b43eb957b28c6c66bd952b5f7ff9f2d38cc633c7ea468238935"; csrftoken=VcphIiG1vjbGolQ5szzsQj2PEsQM63Xc',
  122. 'HTTP_HOST': '10.200.82.62',
  123. 'HTTP_ORIGIN': 'https://10.200.82.62',
  124. 'HTTP_REFERER': 'https://10.200.82.62/',
  125. 'HTTP_REMOTE_USER': 'admin',
  126. 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
  127. 'HTTP_X_FORWARDED_FOR': '10.200.82.167',
  128. 'HTTP_X_FORWARDED_PROTO': 'https',
  129. 'HTTP_X_REAL_IP': '10.200.82.167',
  130. 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
  131. 'HTTP_X_SCHEME': 'https',
  132. 'PATH_INFO': u'/inv/inv/add_group/',
  133. 'QUERY_STRING': '',
  134. 'REMOTE_ADDR': '10.200.82.167',
  135. 'REQUEST_METHOD': 'POST',
  136. 'SCRIPT_NAME': u'',
  137. 'SERVER_NAME': '10.200.82.62',
  138. 'SERVER_PORT': '443',
  139. 'SERVER_PROTOCOL': 'HTTP/1.0',
  140. 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7fd016fd01e0>,
  141. 'wsgi.input': <_io.BytesIO object at 0x7fcff5d24c50>,
  142. 'wsgi.multiprocess': True,
  143. 'wsgi.multithread': False,
  144. 'wsgi.run_once': False,
  145. 'wsgi.url_scheme': 'https',
  146. 'wsgi.version': (1, 0)}>
  147. app_logger = <logging.Logger object at 0x7fcff7cbd650>
  148. InterfaceTypeError = <type 'exceptions.ValueError'>
  149. PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
  150. v =
  151. <bound method InvApplication.api_add_group of <noc.services.web.apps.inv.inv.views.InvApplication object at 0x7fcff7cbd4d0>>
  152. nq = <function nq at 0x7fd000c2fde8>
  153. app =
  154. <noc.services.web.apps.inv.inv.views.InvApplication object at 0x7fcff7cbd4d0>
  155. ct = 'application/json'
  156. ------------------------------------------------------------------------
  157. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement