[BUG] Some Netmap layer 3 views will generate an AttributeError
e-mail and a "Error loading graph" error message to the user
#3225
Labels
AttributeError
e-mail and a "Error loading graph" error message to the user
#3225
Describe the bug
While selecting a saved Netmap view from the dropdown list and then switching the view options from a layer 2 to a layer 3 view, the underlying XHR request will fail with a 500 error. An e-mail with a full traceback is sent to the site admin, while the end user will receive a java script alert dialog with this text:
The e-mail sent to the site admin will reference this errors:
To Reproduce
This isn't easy to reproduce without very specific data from a production NAV install.
Expected behavior
The map should load without error in the UI and without causing a 500-error e-mail being sent to the site admin.
Screenshots
Tracebacks
Environment (please complete the following information):
The error message was first observed at least three years back, but the problem has likely been in NAV since Netmap was first written.
Additional context
The issue is located in this
__eq__
implementation in aNetbox
"stub" class:nav/python/nav/netmap/stubs/__init__.py
Lines 41 to 42 in e6634e5
When Netmap builds a layer 3 topology graph, it will in some cases insert "stub" netboxes into the graph. These are objects that I believe usually represent a peering device that doesn't exist in NAV itself, a sort of pseudo-node to represent something outside the site's own network.
However, this stub class presents with the above faulty implementation of the
__eq__
method. Working with aGraph
object, sometimes, the nodes need to be compared for equality. However, this implementation only ever expects to be compared to another stub Netbox instance, not, for example, tonav.models.manage.Netbox
objects - yet, it will of course be compared with these, since these are everywhere in theGraph
. In reality, the stub class should just be comparing its ownsysname
attribute to that of the other object.The text was updated successfully, but these errors were encountered: