Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #http --verify=no --print=HhBb --json -a div:****** POST https://noc.****/ip/prefix/ prefix=10.248.32.4/30
- {
- "prefix": "10.248.32.4/30"
- }
- HTTP/1.1 500 Internal Server Error
- Cache-Control: no-cache
- Connection: keep-alive
- Content-Length: 6953
- Content-Type: text/plain; charset=utf-8
- Date: Fri, 27 Nov 2020 08:25:26 GMT
- Expires: 0
- Pragma: no-cache
- Server: nginx/1.18.0
- X-Backend-Server: 172.16.10.157:38621
- X-Front-Server: noc.maria-ra.ru
- X-Noc-Backend: fc673f20-e0b8-4f72-a913-48e4737cadc6 (172.16.10.157:38621)
- UNHANDLED EXCEPTION (2020-11-27 11:25:26.036635)
- PROCESS: ./services/web/service.py
- VERSION: latest-20.3
- BRANCH: HEAD CHANGESET: 0d9729ba
- ERROR FINGERPRINT: 2243e8b1-52ba-5c1a-9510-e05d7abd52af
- WORKING DIRECTORY: /opt/noc
- EXCEPTION: <class 'noc.ip.models.prefixprofile.DoesNotExist'>
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: core/model/fields.py (Line: 244)
- Function: __get__
- 237 return getattr(instance, self.cache_name)
- 238 except AttributeError:
- 239 val = instance.__dict__.get(self.name) or None
- 240 if val is None:
- 241 # If NULL is an allowed value, return it.
- 242 if self.field.null:
- 243 return None
- 244 ==> raise self.document.DoesNotExist()
- 245 if not self.dereference:
- 246 self.set_dereference()
- 247 rel_obj = self.dereference(val)
- 248 setattr(instance, self.cache_name, rel_obj)
- 249 return rel_obj
- 250
- Variables:
- self =
- <noc.core.model.fields.DocumentReferenceDescriptor object at 0x7fa34fd1bd90>
- instance = <Prefix: default(): 10.248.32.4/30>
- instance_type = <class 'noc.ip.models.prefix.Prefix'>
- val = None
- ------------------------------------------------------------------------
- File: lib/python3.8/site-packages/django/db/models/base.py (Line: 1238)
- Function: clean_fields
- 1231
- 1232 errors = {}
- 1233 for f in self._meta.fields:
- 1234 if f.name in exclude:
- 1235 continue
- 1236 # Skip validation for empty fields with blank=True. The developer
- 1237 # is responsible for making sure they have a valid value.
- 1238 ==> raw_value = getattr(self, f.attname)
- 1239 if f.blank and raw_value in f.empty_values:
- 1240 continue
- 1241 try:
- 1242 setattr(self, f.attname, f.clean(raw_value, self))
- 1243 except ValidationError as e:
- 1244 errors[f.name] = e.error_list
- Variables:
- self = <Prefix: default(): 10.248.32.4/30>
- exclude = ['id', 'bi_id']
- errors = {'afi': [ValidationError(['Это поле не может быть пустым.'])]}
- f = <noc.core.model.fields.DocumentReferenceField: profile>
- raw_value = None
- ------------------------------------------------------------------------
- File: lib/python3.8/site-packages/django/db/models/base.py (Line: 1200)
- Function: full_clean
- 1193 errors = {}
- 1194 if exclude is None:
- 1195 exclude = []
- 1196 else:
- 1197 exclude = list(exclude)
- 1198
- 1199 try:
- 1200 ==> self.clean_fields(exclude=exclude)
- 1201 except ValidationError as e:
- 1202 errors = e.update_error_dict(errors)
- 1203
- 1204 # Form.clean() is run even if other validation fails, so do the
- 1205 # same with Model.clean() for consistency.
- 1206 try:
- Variables:
- self = <Prefix: default(): 10.248.32.4/30>
- exclude = ['id', 'bi_id']
- validate_unique = True
- errors = {}
- ------------------------------------------------------------------------
- File: lib/app/extmodelapplication.py (Line: 587)
- Function: api_create
- 580 return self.render_json(
- 581 {"status": False, "message": "Duplicated record"}, status=self.CONFLICT
- 582 )
- 583 except self.model.DoesNotExist:
- 584 o = self.model(**attrs)
- 585 # Run models validators
- 586 try:
- 587 ==> o.full_clean(exclude=list(self.ignored_fields))
- 588 except ValidationError as e:
- 589 e_msg = []
- 590 for f in e.message_dict:
- 591 e_msg += ["%s: %s" % (f, "; ".join(e.message_dict[f]))]
- 592 return self.render_json(
- 593 {"status": False, "message": "Validation error: %s" % " | ".join(e_msg)},
- Variables:
- self =
- <noc.services.web.apps.ip.prefix.views.PrefixApplication object at 0x7fa34d8ca550>
- request = <WSGIRequest: POST '/ip/prefix/'>
- m2m_attrs = {}
- file_attrs = {}
- qattrs = {'prefix': '10.248.32.4/30'}
- o = <Prefix: default(): 10.248.32.4/30>
- attrs = {'prefix': '10.248.32.4/30'}
- ------------------------------------------------------------------------
- File: lib/app/site.py (Line: 197)
- Function: inner
- 190 a = ujson.loads(request.body)
- 191 else:
- 192 a = {k: v[0] if len(v) == 1 else v for k, v in request.POST.lists()}
- 193 elif request.method == "GET":
- 194 a = {k: v[0] if len(v) == 1 else v for k, v in request.GET.lists()}
- 195 app_logger.debug("API %s %s %s", request.method, request.path, a)
- 196 # Call handler
- 197 ==> r = v(request, *args, **kwargs)
- 198 # Dump SQL statements
- 199 if self.log_sql_statements:
- 200 from django.db import connections
- 201
- 202 tsc = 0
- 203 sc = defaultdict(int)
- Variables:
- request = <WSGIRequest: POST '/ip/prefix/'>
- args = ()
- kwargs = {}
- v =
- <bound method ExtModelApplication.api_create of <noc.services.web.apps.ip.prefix.views.PrefixApplication object at 0x7fa34d8ca550>>
- to_log_api_call = False
- app_logger = <Logger ip.prefix (INFO)>
- nq = <function Site.site_view.<locals>.inner.<locals>.nq at 0x7fa34aadcc10>
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- InterfaceTypeError = <class 'ValueError'>
- PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
- app =
- <noc.services.web.apps.ip.prefix.views.PrefixApplication object at 0x7fa34d8ca550>
- self = <noc.lib.app.site.Site object at 0x7fa364bc69a0>
- view_map =
- {'GET': <bound method ExtModelApplication.api_list of <noc.services.web.apps.ip.prefix.views.PrefixApplication object at 0x7fa34d8ca550>>,
- 'POST': <bound method ExtModelApplication.api_create of <noc.services.web.apps.ip.prefix.views.PrefixApplication object at 0x7fa34d8ca550>>}
- ------------------------------------------------------------------------
- END OF TRACEBACK
RAW Paste Data