Interface Profile "Interface | Broadcast | In"
Steps to reproduce
-
Interface Profile - добавляем метрику "Interface | Broadcast | In"
-
Не выбирая никаких checkbox'ов (Box, Periodic...), нажимаем Save.
What is the current bug behavior?
Получаем Error saving record и невозможность просмотреть общий список профилей и как следствие исправить/удалить проблемную метрику. Приходится лезть в mongo и удалять руками.
Relevant logs and/or screenshots
2020-11-23 16:03:27,480 [web] ip.ip.ip.ip admin - "PUT /inv/interfaceprofile/5f5886e00f7521e956be0ac6/" HTTP/1.1 500 "https://ip.ip.ip.ip/" Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0 90.62ms
2020-11-23 16:03:37,094 [inv.interfaceprofile] UNHANDLED EXCEPTION (2020-11-23 16:03:37.089630)
PROCESS: ./services/web/service.py
VERSION: 20.4.1+release-20.4.12.cadab770
BRANCH: release-20.4 CHANGESET: cadab770
ERROR FINGERPRINT: 6802b032-883e-5607-9f45-f43c7cc4b74b
WORKING DIRECTORY: /opt/noc
EXCEPTION: <class 'mongoengine.errors.DoesNotExist'> Trying to dereference unknown document DBRef('noc.metrictypes', 'Interface | Errors | In')
START OF TRACEBACK
------------------------------------------------------------------------
File: lib/python3.8/site-packages/mongoengine/fields.py (Line: 1232)
Function: __get__
1225 if hasattr(value, "cls"):
1226 # Dereference using the class type specified in the reference
1227 cls = get_document(value.cls)
1228 else:
1229 cls = self.document_type
1230 dereferenced = cls._get_db().dereference(value)
1231 if dereferenced is None:
1232 ==> raise DoesNotExist("Trying to dereference unknown document %s" % value)
1233 else:
1234 instance._data[self.name] = cls._from_son(dereferenced)
1235
1236 return super().__get__(instance, owner)
1237
1238 def to_mongo(self, document):
Variables:
self = <mongoengine.fields.ReferenceField object at 0x7f38bbf7e430>
instance = <InterfaceProfileMetrics: InterfaceProfileMetrics object>
owner = <class 'noc.inv.models.interfaceprofile.InterfaceProfileMetrics'>
value = DBRef('noc.metrictypes', 'Interface | Errors | In')
auto_dereference = True
cls = <class 'noc.pm.models.metrictype.MetricType'>
dereferenced = None
__class__ = <class 'mongoengine.fields.ReferenceField'>
------------------------------------------------------------------------
020-11-23 16:04:24,571 [web] ip.ip.ip.ip admin - "GET /pm/thresholdprofile/lookup/?_dc=1606136664508&__query=&__format=ext&__page=1&__start=0&__limit=25" HTTP/1.1 200 "https://ip.ip.ip.ip/" Mozilla/5.0 (X11; Ubuntu; Linux x86_64; $
2020-11-23 16:04:37,291 [inv.interfaceprofile] UNHANDLED EXCEPTION (2020-11-23 16:04:37.287753)
PROCESS: ./services/web/service.py
VERSION: 20.4.1+release-20.4.12.cadab770
BRANCH: release-20.4 CHANGESET: cadab770
ERROR FINGERPRINT: 6802b032-883e-5607-9f45-f43c7cc4b74b
WORKING DIRECTORY: /opt/noc
EXCEPTION: <class 'mongoengine.errors.DoesNotExist'> Trying to dereference unknown document DBRef('noc.metrictypes', 'Interface | Broadcast | In')
START OF TRACEBACK
------------------------------------------------------------------------
File: lib/python3.8/site-packages/mongoengine/fields.py (Line: 1232)
Function: __get__
1225 if hasattr(value, "cls"):
1226 # Dereference using the class type specified in the reference
1227 cls = get_document(value.cls)
1228 else:
1229 cls = self.document_type
1230 dereferenced = cls._get_db().dereference(value)
1231 if dereferenced is None:
1232 ==> raise DoesNotExist("Trying to dereference unknown document %s" % value)
1233 else:
1234 instance._data[self.name] = cls._from_son(dereferenced)
1235
1236 return super().__get__(instance, owner)
1237
1238 def to_mongo(self, document):
Variables:
self = <mongoengine.fields.ReferenceField object at 0x7f38bbf7e430>
instance = <InterfaceProfileMetrics: InterfaceProfileMetrics object>
owner = <class 'noc.inv.models.interfaceprofile.InterfaceProfileMetrics'>
value = DBRef('noc.metrictypes', 'Interface | Broadcast | In')
auto_dereference = True
cls = <class 'noc.pm.models.metrictype.MetricType'>
dereferenced = None
__class__ = <class 'mongoengine.fields.ReferenceField'>
------------------------------------------------------------------------
./noc about
)
Paste NOC version (NOC version is: 20.4.1+release-20.4.12.cadab770