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
Open the netbox portal at https://netbox_server/ipam/ip-addresses/ and get the error:
Server Error
There was a problem with your request. Please contact an administrator.
The complete exception is provided below:
<class 'AttributeError'>
'NoneType' object has no attribute 'get_absolute_url'
Python version: 3.8.10
NetBox version: 3.4.4
If further assistance is required, please post to the [NetBox discussion forum](https://github.com/netbox-community/netbox/discussions) on GitHub.
Check the API reply results at https://netbox_server/api/ipam/ip-addresses/ to review the assigned values.
Comment interface_id = netbox_device_interface.pyshical_server_nic.id in the code and apply the code again. The issue is gone.
Analysys
The issue is in missing attribute assigned_object_type": "dcim.interface when the terraform plugin applies the code. By default the attribute equals "virtualization.vminterface".
These are fragments of API replies of implemeting physical interface assigment via the plugin and via the web-interface:
A refactoring for IP addresses is underway in #422 . Then you will be able to use virtual_machine_interface_id or device_interface_id.
As for the current versions:
netbox_ip_address command should be able to detect or manually set type of assinned resources
You should already be able to set the object_type attribute to dcim.interface. It merely defaults to virtualization.vminterface.
Detecting the type automatically will not work, because if you have a vm interface with id 1 and a device interface with id 1, how would the provider find out what type you want to link if you set interface_id = 1?
System spec
NetBox version: 3.4.4
Python version: 3.8
Terrafrom version: 1.3.6
Netbox Terrafrom plugin version: 3.0.13
Steps to Reproduce
Check the API reply results at https://netbox_server/api/ipam/ip-addresses/ to review the assigned values.
Comment
interface_id = netbox_device_interface.pyshical_server_nic.id
in the code and apply the code again. The issue is gone.Analysys
The issue is in missing
attribute assigned_object_type": "dcim.interface
when the terraform plugin applies the code. By default the attribute equals"virtualization.vminterface"
.These are fragments of API replies of implemeting physical interface assigment via the plugin and via the web-interface:
not assigned:
wrong:
correct:
Expected Behavior
netbox_ip_address
command should be able to detect or manually set type of assinned resourcesObserved Behavior
netbox_ip_address
command always set"assigned_object_type": "virtualization.vminterface"
valueThe text was updated successfully, but these errors were encountered: