NAV v5.0.5 appears to have a problem in the topology/LLDP portion. The switch referenced below is a Cisco WS-3750X stack, running 15.2(4)E10. Referenced devices are [Ubiquiti] APs. FWIW – the switch does have such things as ARP inspection, DHCP snooping, etc. – enabled.
2020-04-13 06:23:35,227 [INFO plugins.lldp.lldpneighbor] [topo switch0.<obscured>] found multiple interface matches for <LLDPNeighbor identified=True netbox=Netbox(id=27, sysname='wifi-b.<obscured>') interfaces=[Interface(id=607, netbox=Netbox(id=27, sysname='wifi-b.<obscured>'), ifname='br0', ifdescr='br0', iftype=6), Interface(id=609, netbox=Netbox(id=27, sysname='wifi-b.<obscured>'), ifname='br0.20', ifdescr='br0.20', iftype=6), Interface(id=589, netbox=Netbox(id=27, sysname='wifi-b.<obscured>'), ifname='eth0', ifdescr='eth0', iftype=6), Interface(id=605, netbox=Netbox(id=27, sysname='wifi-b.<obscured>'), ifname='eth0.20', ifdescr='eth0.20', iftype=6)]>
2020-04-13 06:23:35,229 [INFO plugins.lldp.lldpneighbor] [topo switch0.<obscured>] found multiple interface matches for <LLDPNeighbor identified=True netbox=Netbox(id=28, sysname='wifi-g.<obscured>') interfaces=[Interface(id=610, netbox=Netbox(id=28, sysname='wifi-g.<obscured>'), ifname='br0', ifdescr='br0', iftype=6), Interface(id=611, netbox=Netbox(id=28, sysname='wifi-g.<obscured>'), ifname='br0.20', ifdescr='br0.20', iftype=6), Interface(id=612, netbox=Netbox(id=28, sysname='wifi-g.<obscured>'), ifname='br-trunk', ifdescr='br-trunk', iftype=6), Interface(id=590, netbox=Netbox(id=28, sysname='wifi-g.<obscured>'), ifname='eth0', ifdescr='eth0', iftype=6), Interface(id=608, netbox=Netbox(id=28, sysname='wifi-g.<obscured>'), ifname='eth0.10', ifdescr='eth0.10', iftype=6), Interface(id=606, netbox=Netbox(id=28, sysname='wifi-g.<obscured>'), ifname='eth0.20', ifdescr='eth0.20', iftype=6)]>
2020-04-13 06:23:35,241 [ERROR jobs.jobhandler] [topo switch0.<obscured>] Plugin nav.ipdevpoll.plugins.lldp.LLDP('switch0.<obscured>') reported an unhandled failure
Traceback (most recent call last):
File "/opt/venvs/nav/lib/python3.7/site-packages/twisted/internet/defer.py", line 500, in errback
self._startRunCallbacks(fail)
File "/opt/venvs/nav/lib/python3.7/site-packages/twisted/internet/defer.py", line 567, in _startRunCallbacks
self._runCallbacks()
File "/opt/venvs/nav/lib/python3.7/site-packages/twisted/internet/defer.py", line 653, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/opt/venvs/nav/lib/python3.7/site-packages/twisted/internet/defer.py", line 1442, in gotResult
_inlineCallbacks(r, g, deferred)
--- <exception caught here> ---
File "/opt/venvs/nav/lib/python3.7/site-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/opt/venvs/nav/lib/python3.7/site-packages/twisted/python/failure.py", line 408, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/ipdevpoll/plugins/lldp.py", line 71, in handle
yield run_in_thread(self._process_remote)
File "/opt/venvs/nav/lib/python3.7/site-packages/twisted/python/threadpool.py", line 250, in inContext
result = inContext.theWork()
File "/opt/venvs/nav/lib/python3.7/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
File "/opt/venvs/nav/lib/python3.7/site-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/opt/venvs/nav/lib/python3.7/site-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/ipdevpoll/db.py", line 100, in _reset
return func(*args, **kwargs)
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/ipdevpoll/plugins/lldp.py", line 116, in _process_remote
neighbors = [LLDPNeighbor(lldp) for lldp in self.remote]
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/ipdevpoll/plugins/lldp.py", line 116, in <listcomp>
neighbors = [LLDPNeighbor(lldp) for lldp in self.remote]
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/ipdevpoll/neighbor.py", line 117, in __init__
self.identify()
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/ipdevpoll/neighbor.py", line 121, in identify
self.interfaces = self._identify_interfaces()
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/ipdevpoll/plugins/lldp.py", line 222, in _identify_interfaces
result = lookup(str(portid))
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/ipdevpoll/plugins/lldp.py", line 248, in _interfaces_from_mac
return self._interface_query(Q(ifphysaddress=mac))
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/ipdevpoll/neighbor.py", line 234, in _interface_query
'id', 'ifname', 'ifdescr', 'iftype').filter(netbox & query):
File "/opt/venvs/nav/lib/python3.7/site-packages/django/db/models/query.py", line 250, in __iter__
self._fetch_all()
File "/opt/venvs/nav/lib/python3.7/site-packages/django/db/models/query.py", line 1121, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/opt/venvs/nav/lib/python3.7/site-packages/django/db/models/query.py", line 106, in __iter__
for row in compiler.results_iter(chunked_fetch=self.chunked_fetch):
File "/opt/venvs/nav/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 841, in results_iter
results = self.execute_sql(MULTI, chunked_fetch=chunked_fetch)
File "/opt/venvs/nav/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 899, in execute_sql
raise original_exception
File "/opt/venvs/nav/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 889, in execute_sql
cursor.execute(sql, params)
File "/opt/venvs/nav/lib/python3.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/opt/venvs/nav/lib/python3.7/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/opt/venvs/nav/lib/python3.7/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/opt/venvs/nav/lib/python3.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
django.db.utils.DataError: invalid input syntax for type macaddr: "None"
LINE 1: ..."netboxid" = 26 AND "interface"."ifphysaddress" = 'None') OR...
^
2020-04-13 06:23:35,242 [ERROR jobs.jobhandler] [topo switch0.<obscured>] Job 'topo' for switch0.<obscured> aborted: Job aborted due to plugin failure (cause=DataError('invalid input syntax for type macaddr: "None"\nLINE 1: ..."netboxid" = 26 AND "interface"."ifphysaddress" = 'None') OR...\n ^\n'))
Related: Was running an older version of NAV which appeared (at least via GUI) to have no issue this equipment combination of Cisco and Ubiquiti. Due to an odd issue, did end up dropping the VM and simply created a new one with latest Debian and latest NAV version, re-populating the equipment and configuration. Which may have been why certain things came to light? The Netmap doesn’t appear to be fully populated – suspect that it’s a cascading result of the above error?
On Mon, 20 Apr 2020 11:46:06 -0400 scorpion7 scorpion7@iqonline.net wrote:
NAV v5.0.5 appears to have a problem in the topology/LLDP portion. The switch referenced below is a Cisco WS-3750X stack, running 15.2(4)E10. Referenced devices are [Ubiquiti] APs. FWIW – the switch does have such things as ARP inspection, DHCP snooping, etc. – enabled.
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/ipdevpoll/plugins/lldp.py", line 222, in _identify_interfaces result = lookup(str(portid)) File "/opt/venvs/nav/lib/python3.7/site-packages/nav/ipdevpoll/plugins/lldp.py", line 248, in _interfaces_from_mac return self._interface_query(Q(ifphysaddress=mac))
[snip]
django.db.utils.DataError: invalid input syntax for type macaddr: "None"
LINE 1: ..."netboxid" = 26 AND "interface"."ifphysaddress" = 'None') OR...
It looks to me like the LLDP record in question was incomplete, something the code doesn't seem prepared to handle.
You could either do a manual snmpwalk against the device, querying `LLDP-MIB::lldpRemTable`, or you could enable debug logging for the LLDP subsystems of ipdevpoll in NAV and dump the relevant log parts here.
For the latter, add `nav.ipdevpoll.plugins.lldp = DEBUG` to the `[levels]` section of `/etc/nav/logging.conf`, then invoke a manual topo job against the affected device:
ipdevpolld -J topo -n AFFECTED-DEVICE
Related: Was running an older version of NAV which appeared (at least via GUI) to have no issue this equipment combination of Cisco and Ubiquiti. Due to an odd issue, did end up dropping the VM and simply created a new one with latest Debian and latest NAV version, re-populating the equipment and configuration. Which may have been why certain things came to light?
You may simply have been hit by a known bug with caching of LLDP identification. Reinstalling things meant starting without cached data. We should really get on that soon :-) See [1] for details.
The Netmap doesn’t appear to be fully populated – suspect that it’s a cascading result of the above error?
That is likely, yes.
[1] https://github.com/Uninett/nav/issues/2106
-- sincerely, Morten Brekkevold Uninett