netmap L3 crash in urlresolvers.py

Bug #1444416 reported by Peter Gervai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
Medium
Morten Brekkevold

Bug Description

 Internal Server Error: /netmap/graph/layer3/1/

...

 File "/usr/lib/python2.7/dist-packages/nav/web/netmap/graph.py", line 91, in _json_layer3
    node_a, node_b, nx_metadata in graph.edges_iter(data=True)]

  File "/usr/lib/python2.7/dist-packages/nav/netmap/metadata.py", line 409, in edge_to_json_layer3
    metadata_collection[vlan_id].append(edge.to_json())

  File "/usr/lib/python2.7/dist-packages/nav/netmap/metadata.py", line 313, in to_json
    'target': self.target.to_json() or 'null',

  File "/usr/lib/python2.7/dist-packages/nav/netmap/metadata.py", line 148, in to_json
    self.interface.ifname)})

  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 502, in reverse
    return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))

  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 422, in _reverse_with_prefix
    "arguments '%s' not found." % (lookup_view_s, args, kwargs))

NoReverseMatch: Reverse for 'ipdevinfo-interface-details-by-name' with arguments '()' and keyword arguments '{'port_name': u'N/A (peer of 666.666.107.214)', 'netbox_sysname': u'//-> Whatever Trunk'}' not found.

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

If u'//-> Whatever Trunk' is the actual 'netbox_sysname' value as indicated above, I understand why this fails. The URL config will not accept sysnames with slashes in them, since they are path separators in the URI.

Any link produced by this would also not be a valid one, since this looks like a link to an external peer, so NAV cannot show that in ipdevpoll anyway.

Given that my assumptions are correct, I would suggest fixing it by having the code ignore the NoReverseMatch error and not produce a link at all in this case (I think we've fixed this particular code multiple times already, for similar problems :P )

Changed in nav:
status: New → Confirmed
assignee: nobody → Morten Brekkevold (mbrekkevold)
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
status: Confirmed → Fix Committed
milestone: none → 4.2.6
importance: Undecided → Medium
summary: - netmon L3 crash in urlresolvers.py
+ netmap L3 crash in urlresolvers.py
Revision history for this message
Peter Gervai (grin) wrote :

Yes it does, yes they are, but the fix doesn't seem to.
...
 File "/usr/lib/python2.7/dist-packages/nav/netmap/metadata.py", line 313, in to_json
    """json presentation of Edge"""

  File "/usr/lib/python2.7/dist-packages/nav/netmap/metadata.py", line 148, in to_json
    kwargs=kwargs)

  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 502, in reverse
    return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))

  File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 422, in _reverse_with_prefix
    "arguments '%s' not found." % (lookup_view_s, args, kwargs))

NoReverseMatch: Reverse for 'ipdevinfo-interface-details-by-name' with arguments '()' and keyword arguments '{'port_name': u'N/A (peer of 195.111.107.214)', 'netbox_sysname': u'//-> Whatever Trunk'}' not found.

Revision history for this message
Peter Gervai (grin) wrote :

Sorry it seems lame person forgot to restart the indian. I mean the apache.

Changed in nav:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.