I've hit an error when trying to add new interfaces to devices in netbox-next. I stumbled on it when testing a script I was prepping to do some of the cloudsw host moves in codfw, but I also get the same thing using the GUI.
Steps to replicate:
- Open a device's page
- Click 'Add Components... Interface'
- Enter a name for the interface, and select a type
- Click 'Create'
You will hit the following error:
Testing with the API this was how I could trigger it:
device = nb.dcim.devices.get(name='cloudsw1-b1-codfw') new_sw_int = nb.dcim.interfaces.create(name='ge-0/0/17', device=device.id, type='1000base-t')
With same response:
pynetbox.core.query.RequestError: The request failed with code 500 Internal Server Error: {'error': 'Interface objects need to have a primary key value before you can access their tags.', 'exception': 'ValueError', 'netbox_version': '3.2.9', 'python_version': '3.9.2'}
Looks to be a bug in v3.2.9? I can open an issue upstream but wanted to double-check with the rest of the team that there may not be a cause specific to our deployment first. I had a search on the netbox Github and couldn't see an existing open issue on it.