ntc-netbox-plugin-onboarding version: 2.1.0 ( both pip, and built from master and develop )
Also this was tested under docker via image netboxcommunity/netbox:v2.10.8-ldap.
Steps to Reproduce
Create device Test_01
Create test-interface and binding to to Test_01
Create IPaddress 1.1.1.1/24 and binding to test-interface
Set primary IP of Test_01 to 1.1.1.1/24
Delete IPaddress 1.1.1.1/24
View Device Test_01 and it'll get an error of IPaddressDoesNotExist
Confirmed also that this only happens when having netbox_onboarding plugin enabled in netbox.
This was also reported on https://github.com/netbox-community/netbox/issues/6069 before we found out this is only happening when netbox_onboarding is enabled.
Expected Behavior
After removing primary IP address of device, the device details should show up correctly without a restart of netbox.
Observed Behavior
Gettting an exception <class 'ipam.models.IPAddress.DoesNotExist'> as can be seen in the attached pictures.
Restarting Netbox fixes the problem, so it seems it may be related to a cache issue
Tested fix
As a quick fix, I tried to catch the exception by:
try:
ip = self.device.primary_ip4
except IPAddress.DoesNotExist:
return "unknown"
in functions last_check_attempt_date(self), last_check_successful_date(self), status(self) and last_ot(self) and device was able to be displayed correctly.
Environment
netboxcommunity/netbox:v2.10.8-ldap
.Steps to Reproduce
Confirmed also that this only happens when having
netbox_onboarding
plugin enabled in netbox. This was also reported on https://github.com/netbox-community/netbox/issues/6069 before we found out this is only happening when netbox_onboarding is enabled.Expected Behavior
After removing primary IP address of device, the device details should show up correctly without a restart of netbox.
Observed Behavior
Gettting an exception <class 'ipam.models.IPAddress.DoesNotExist'> as can be seen in the attached pictures.
Restarting Netbox fixes the problem, so it seems it may be related to a cache issue
Tested fix
As a quick fix, I tried to catch the exception by:
in functions
last_check_attempt_date(self)
,last_check_successful_date(self)
,status(self)
andlast_ot(self)
and device was able to be displayed correctly.