AssertionError prevents Netmap from loading any graph/map
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Network Administration Visualized |
Fix Released
|
Medium
|
Morten Brekkevold | ||
4.2 |
Fix Released
|
Medium
|
Morten Brekkevold |
Bug Description
A customer installation repeatedly mails a Django traceback from Netmap invocations, with an AssertionError that prevents the map from ever displaying:
> AssertionError: Source and target GwPortPrefix must reside in same VLan for Prefix! Bailing
The end user will only see the non-descript error message "Error loading graph, please try to reload the page". Reloading the page will not help, as the problem occurs while assembling a topology
The full, mailed traceback looks like this:
Traceback (most recent call last):
File "/usr/lib/
response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/
return self.dispatch(
File "/usr/lib/
return view_func(*args, **kwargs)
File "/usr/lib/
response = self.handle_
File "/usr/lib/
response = handler(request, *args, **kwargs)
File "/usr/lib/
return Response(
File "/usr/lib/
return _json_layer3(
File "/usr/lib/
view)
File "/usr/lib/
traffic)
File "/usr/lib/
edge = Edge((nx_edge), source, target, traffic)
File "/usr/lib/
"Source and target GwPortPrefix must reside in same VLan for "
AssertionError: Source and target GwPortPrefix must reside in same VLan for Prefix! Bailing
Changed in nav: | |
status: | Confirmed → In Progress |
Changed in nav: | |
status: | Fix Committed → Fix Released |
The problem appears to be with the backend code that processes ELINK prefixes and inserts these into the topology graph.
An ELINK peer is a node that is not monitored by NAV, so the code will insert a stubbed ELINK node into the graph it is constructing. The stub code, located in nav.netmap.stubs, consists of stub classes representing Netboxes, GwPortPrefixes and Interfaces. However, the __hash__ implementation of the GwPortPrefix and Interface classes do not ensure uniqueness across all nodes. The biggest problem is for the GwPortPrefix stub class, which uses only the gw_ip for hashing. This would be fine if actual IPs were used, but for stub classes, the peer name (derived from the netident) is inserted as the gw_ip. If this peer appears multiple times in the graph, the data will be fudged, since the GwPortPrefix is supposed to represent individual router ports of this peer.
(In effect, all the GwPortPrefixes of this ELINK peer would hash to the same value, and there will be conflicts).