Exception raised when importing prefix against duplicate vlan_vid #1036

Closed
opened 2025-12-29 16:28:10 +01:00 by adam · 0 comments
Owner

Originally created by @candlerb on GitHub (Jun 15, 2017).

Issue type: bug report

Python version: 3.5.2
NetBox version: 2.0.6

To reproduce:

Import two VLANs with same vid:

vid,name,status
301,test1,Reserved
301,test2,Reserved

Import a prefix which references this vid

prefix,status,vlan_vid
192.0.2.0/24,Active,301

This causes a Server Error:

<class 'ipam.models.MultipleObjectsReturned'>

get() returned more than one VLAN -- it returned 2!

I think in this case Netbox is correct - it should either reject the upload, or import the prefix with a NULL vlan association and generate a warning. But it would be better to report this properly rather than throw an exception (which mails a backtrace to the administrator)

Originally created by @candlerb on GitHub (Jun 15, 2017). ### Issue type: bug report **Python version:** 3.5.2 **NetBox version:** 2.0.6 To reproduce: Import two VLANs with same vid: ~~~ vid,name,status 301,test1,Reserved 301,test2,Reserved ~~~ Import a prefix which references this vid ~~~ prefix,status,vlan_vid 192.0.2.0/24,Active,301 ~~~ This causes a Server Error: ~~~ <class 'ipam.models.MultipleObjectsReturned'> get() returned more than one VLAN -- it returned 2! ~~~ I think in this case Netbox is correct - it should either reject the upload, or import the prefix with a NULL vlan association and generate a warning. But it would be better to report this properly rather than throw an exception (which mails a backtrace to the administrator)
adam added the type: bug label 2025-12-29 16:28:10 +01:00
adam closed this issue 2025-12-29 16:28:10 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1036