Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UNHANDLED EXCEPTION (2019-01-28 14:37:57.606293)
- PROCESS: ./services/web/service.py
- VERSION: 19.1
- BRANCH: HEAD CHANGESET: e8d18ab3
- ERROR FINGERPRINT: 4f3799f5-b745-5af8-9971-76eafd5fc182
- WORKING DIRECTORY: /opt/noc
- EXCEPTION: <type 'exceptions.UnboundLocalError'> local variable 'c' referenced before assignment
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: services/web/apps/inv/inv/views.py (Line: 157)
- Function: api_add_group
- 150 return self.response_not_found()
- 151 c = c.id
- 152 elif container:
- 153 return self.response_bad_request()
- 154 m = ObjectModel.get_by_id(type)
- 155 if not m:
- 156 return self.response_not_found()
- 157 ==> o = Object(name=name, model=m, container=c)
- 158 if serial and m.get_data("asset", "part_no0"):
- 159 o.set_data("asset", "serial", serial)
- 160 o.save()
- 161 o.log("Created", user=request.user.username,
- 162 system="WEB", op="CREATE")
- 163 return str(o.id)
- Variables:
- container = None
- name = u'Office'
- m = <ObjectModel: PoP | Access>
- self =
- <noc.services.web.apps.inv.inv.views.InvApplication object at 0x7fcff7cbd4d0>
- request =
- <WSGIRequest
- path:/inv/inv/add_group/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {u'{"name":"Office","type":"5c48310eb19531a79f19ffd9","serial":"","container":null}': [u'']}>,
- COOKIES:{'csrftoken': 'VcphIiG1vjbGolQ5szzsQj2PEsQM63Xc',
- 'noc_user': '2|1:0|10:1548235463|8:noc_user|8:YWRtaW4=|8500770cf9ca7b43eb957b28c6c66bd952b5f7ff9f2d38cc633c7ea468238935',
- 'user': '2|1:0|10:1548233403|4:user|8:YWRtaW4=|0c22cd08d5ad9e9f91691ce69ef6e34744add8f30a7769e32bf0afa609c692ac'},
- META:{'CONTENT_LENGTH': '80',
- 'CONTENT_TYPE': 'application/json',
- 'HTTP_ACCEPT': '*/*',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br',
- 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
- 'HTTP_CONNECTION': 'close',
- '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',
- 'HTTP_HOST': '10.200.82.62',
- 'HTTP_ORIGIN': 'https://10.200.82.62',
- 'HTTP_REFERER': 'https://10.200.82.62/',
- 'HTTP_REMOTE_USER': 'admin',
- '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',
- 'HTTP_X_FORWARDED_FOR': '10.200.82.167',
- 'HTTP_X_FORWARDED_PROTO': 'https',
- 'HTTP_X_REAL_IP': '10.200.82.167',
- 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
- 'HTTP_X_SCHEME': 'https',
- 'PATH_INFO': u'/inv/inv/add_group/',
- 'QUERY_STRING': '',
- 'REMOTE_ADDR': '10.200.82.167',
- 'REQUEST_METHOD': 'POST',
- 'SCRIPT_NAME': u'',
- 'SERVER_NAME': '10.200.82.62',
- 'SERVER_PORT': '443',
- 'SERVER_PROTOCOL': 'HTTP/1.0',
- 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7fd016fd01e0>,
- 'wsgi.input': <_io.BytesIO object at 0x7fcff5d24c50>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'https',
- 'wsgi.version': (1, 0)}>
- serial = u''
- type = '5c48310eb19531a79f19ffd9'
- ------------------------------------------------------------------------
- File: lib/app/site.py (Line: 229)
- Function: inner
- 222 for k, v in request.POST.lists())
- 223 elif request.method == "GET":
- 224 a = dict((k, v[0] if len(v) == 1 else v)
- 225 for k, v in request.GET.lists())
- 226 app_logger.debug("API %s %s %s",
- 227 request.method, request.path, a)
- 228 # Call handler
- 229 ==> r = v(request, *args, **kwargs)
- 230 # Dump SQL statements
- 231 if self.log_sql_statements:
- 232 from django.db import connections
- 233 tsc = 0
- 234 sc = defaultdict(int)
- 235 for conn in connections.all():
- Variables:
- errors = None
- view_map =
- {'POST': <bound method InvApplication.api_add_group of <noc.services.web.apps.inv.inv.views.InvApplication object at 0x7fcff7cbd4d0>>}
- g =
- {u'container': None,
- u'name': u'Office',
- u'serial': u'',
- u'type': u'5c48310eb19531a79f19ffd9'}
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- kwargs =
- {u'name': u'Office', u'serial': u'', u'type': '5c48310eb19531a79f19ffd9'}
- self = <noc.lib.app.site.Site object at 0x7fd000c46a90>
- to_log_api_call = False
- args = ()
- request =
- <WSGIRequest
- path:/inv/inv/add_group/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {u'{"name":"Office","type":"5c48310eb19531a79f19ffd9","serial":"","container":null}': [u'']}>,
- COOKIES:{'csrftoken': 'VcphIiG1vjbGolQ5szzsQj2PEsQM63Xc',
- 'noc_user': '2|1:0|10:1548235463|8:noc_user|8:YWRtaW4=|8500770cf9ca7b43eb957b28c6c66bd952b5f7ff9f2d38cc633c7ea468238935',
- 'user': '2|1:0|10:1548233403|4:user|8:YWRtaW4=|0c22cd08d5ad9e9f91691ce69ef6e34744add8f30a7769e32bf0afa609c692ac'},
- META:{'CONTENT_LENGTH': '80',
- 'CONTENT_TYPE': 'application/json',
- 'HTTP_ACCEPT': '*/*',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br',
- 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
- 'HTTP_CONNECTION': 'close',
- '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',
- 'HTTP_HOST': '10.200.82.62',
- 'HTTP_ORIGIN': 'https://10.200.82.62',
- 'HTTP_REFERER': 'https://10.200.82.62/',
- 'HTTP_REMOTE_USER': 'admin',
- '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',
- 'HTTP_X_FORWARDED_FOR': '10.200.82.167',
- 'HTTP_X_FORWARDED_PROTO': 'https',
- 'HTTP_X_REAL_IP': '10.200.82.167',
- 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
- 'HTTP_X_SCHEME': 'https',
- 'PATH_INFO': u'/inv/inv/add_group/',
- 'QUERY_STRING': '',
- 'REMOTE_ADDR': '10.200.82.167',
- 'REQUEST_METHOD': 'POST',
- 'SCRIPT_NAME': u'',
- 'SERVER_NAME': '10.200.82.62',
- 'SERVER_PORT': '443',
- 'SERVER_PROTOCOL': 'HTTP/1.0',
- 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7fd016fd01e0>,
- 'wsgi.input': <_io.BytesIO object at 0x7fcff5d24c50>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'https',
- 'wsgi.version': (1, 0)}>
- app_logger = <logging.Logger object at 0x7fcff7cbd650>
- InterfaceTypeError = <type 'exceptions.ValueError'>
- PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
- v =
- <bound method InvApplication.api_add_group of <noc.services.web.apps.inv.inv.views.InvApplication object at 0x7fcff7cbd4d0>>
- nq = <function nq at 0x7fd000c2fde8>
- app =
- <noc.services.web.apps.inv.inv.views.InvApplication object at 0x7fcff7cbd4d0>
- ct = 'application/json'
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement