ipdevpoll inventory job fails when deleting old router addresses
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Network Administration Visualized |
Fix Released
|
High
|
Morten Brekkevold |
Bug Description
In NAV 4.4.1, the ipdevpoll inventory job crashes when attempting to delete router port addresses that have disappeared from the running config.
Traceback looks like this:
2016-01-31 06:39:34,378 [1033] [INFO shadows.
2016-01-31 06:39:34,381 [1033] [ERROR jobs.jobhandler] [inventory big-gsw.
Traceback (most recent call last):
File "/usr/lib/
manager.
File "/usr/lib/
self.
File "/usr/lib/
cls.
File "/usr/lib/
missing_
File "/usr/lib/
collector.
File "/usr/lib/
qs.
File "/usr/lib/
sql.
File "/usr/lib/
self.
File "/usr/lib/
cursor.
File "/usr/lib/
return self.cursor.
File "/usr/lib/
six.
File "/usr/lib/
return self.cursor.
ProgrammingError: operator does not exist: text = inet
LINE 1: ... "gwportprefix" WHERE HOST("gwportpre
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Changed in nav: | |
status: | Fix Committed → Fix Released |
Apparently, this is due to some changes in how Django handles IPAddressFields. It casts the gwportprefix.gwip field (an INET data type) using the HOST() function, which turns the address into a string, and then proceeds to compare it with a list of un-cast INET values. It is very reminiscent of tjhis Django bug, which was supposedly fixed years ago: https:/ /code.djangopro ject.com/ ticket/ 11442
NAV is affected by this due to the transition from Django 1.4 to Django 1.7.
It seems our best option for fixing this is to change the GwPortPrefix.gw_ip attribute from Django's IPAddressField type into NAV's own CIDRField type (which was created explicitly to work around Django's issues with handling IP address fields in PostgreSQL).