You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using the netbox terraform plugin to try to add an IP address to a newly created device. It seemed to work but caused a Server Error when viewing the ipaddresses page.
Looking at the logs I found the error to be here:
File "/opt/netbox/netbox/ipam/tables/ip.py", line 383, in <lambda>
linkify=lambda record: record.assigned_object.get_absolute_url(),
AttributeError: 'NoneType' object has no attribute 'get_absolute_url'
Digging further, what I found was that the API request was specifying the assigned_object_type_id to 8 (which is virtualization / vminterface). Even though I was linking to a device id. Because of this the GUI was unable to find the associated interface and was dying. Changing the assigned_object_type_id to equal 5 ( dcim / interface ) corrects the problem.
The problem is going to be in the terraform module, or in how I'm using it, so I'm not opening a bug to netbox, but I'm wondering if this is something that should be guarded against in the API?
"When inserting IP addresses verify that the linked device exists"
Alternatively, if the missing data should be considered a valid condition, then it might make sense to warn on the page that it's linked to a non-existent device or virtual machine instead of throwing the exception.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I was using the netbox terraform plugin to try to add an IP address to a newly created device. It seemed to work but caused a Server Error when viewing the ipaddresses page.
Looking at the logs I found the error to be here:
Digging further, what I found was that the API request was specifying the assigned_object_type_id to 8 (which is virtualization / vminterface). Even though I was linking to a device id. Because of this the GUI was unable to find the associated interface and was dying. Changing the assigned_object_type_id to equal 5 ( dcim / interface ) corrects the problem.
The problem is going to be in the terraform module, or in how I'm using it, so I'm not opening a bug to netbox, but I'm wondering if this is something that should be guarded against in the API?
"When inserting IP addresses verify that the linked device exists"
Alternatively, if the missing data should be considered a valid condition, then it might make sense to warn on the page that it's linked to a non-existent device or virtual machine instead of throwing the exception.
Beta Was this translation helpful? Give feedback.
All reactions