Import Prefixes with VLAN ID fails with "Row 1 vlan: Object not found." #3894

Closed
opened 2025-12-29 18:31:50 +01:00 by adam · 8 comments
Owner

Originally created by @matthiaslink77 on GitHub (Jul 24, 2020).

Environment

  • Python version: 3.6.8-2.el7.ius
  • NetBox version: 2.8.8

Steps to Reproduce

  1. Export a prefix with an already existing VLAN ID.
  2. Try to re-import the created file
  3. Error will be "Row 1 vlan: Object not found."

Expected Behavior

Import works properly.

Observed Behavior

Message:
"Enter the list of column headers followed by one line per record to be imported, using commas to separate values. Multi-line data and values containing commas may be wrapped in double quotes.
Row 1 vlan: Object not found."

Workaround:
Remove VLAN ID from Import file and manually assign it afterwards (not practical for a huge number of VLANs)

Originally created by @matthiaslink77 on GitHub (Jul 24, 2020). ### Environment * Python version: 3.6.8-2.el7.ius * NetBox version: 2.8.8 ### Steps to Reproduce 1. Export a prefix with an already existing VLAN ID. 2. Try to re-import the created file 3. Error will be "Row 1 vlan: Object not found." ### Expected Behavior Import works properly. ### Observed Behavior Message: "Enter the list of column headers followed by one line per record to be imported, using commas to separate values. Multi-line data and values containing commas may be wrapped in double quotes. Row 1 vlan: Object not found." Workaround: Remove VLAN ID from Import file and manually assign it afterwards (not practical for a huge number of VLANs)
adam added the type: bugstatus: revisions needed labels 2025-12-29 18:31:50 +01:00
adam closed this issue 2025-12-29 18:31:50 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 24, 2020):

Please specify the data you're attempting to send. Note that the format in which VLANs are exported is not necessarily the same as the format expected by the input form.

@jeremystretch commented on GitHub (Jul 24, 2020): Please specify the data you're attempting to send. Note that the format in which VLANs are exported is _not_ necessarily the same as the format expected by the input form.
Author
Owner

@matthiaslink77 commented on GitHub (Jul 24, 2020):

Dear Jeremy,

thanks a lot for your reply. So can you please let me know why it would be exported in a different format than import could work with in the first place?

Anyhow. This is the format I tried:

prefix,vrf,tenant,site,vlan_group,vlan,status,role,is_pool,description
192.168.1.0/24,,private,Site00,,100,Active,,,

If I omit vlan it works:

prefix,vrf,tenant,site,vlan_group,status,role,is_pool,description
192.168.1.0/24,,private,Site00,,Active,,,

Best regards, Matthias.

@matthiaslink77 commented on GitHub (Jul 24, 2020): Dear Jeremy, thanks a lot for your reply. So can you please let me know why it would be exported in a different format than import could work with in the first place? Anyhow. This is the format I tried: ``` prefix,vrf,tenant,site,vlan_group,vlan,status,role,is_pool,description 192.168.1.0/24,,private,Site00,,100,Active,,, ``` If I omit vlan it works: ``` prefix,vrf,tenant,site,vlan_group,status,role,is_pool,description 192.168.1.0/24,,private,Site00,,Active,,, ``` Best regards, Matthias.
Author
Owner

@jeremystretch commented on GitHub (Jul 24, 2020):

So can you please let me know why it would be exported in a different format than import could work with in the first place?

There is additional context needed in some cases to uniquely identify related objects (such as VLANs, which do not have any discrete unique identifier).

You're receiving this error because NetBox does not seem to have a VLAN created in site Site00 with VID 100 and no VLAN group.

@jeremystretch commented on GitHub (Jul 24, 2020): > So can you please let me know why it would be exported in a different format than import could work with in the first place? There is additional context needed in some cases to uniquely identify related objects (such as VLANs, which do not have any discrete unique identifier). You're receiving this error because NetBox does not seem to have a VLAN created in site Site00 with VID 100 and no VLAN group.
Author
Owner

@matthiaslink77 commented on GitHub (Jul 24, 2020):

Dear Jeremy,

thanks for your reply.

I am wondering why a VLAN with a VID would not use that VID as a unique identifier together with the Site Name. But maybe there are other scenarios where this is not sufficient.

So: As explained initially the first set of data has been exported directly the minute before from Netbox, which means the data exists (VLAN 100, no VLAN group).

This is the corresponding line of the export from VLANs:

site,group,vid,name,tenant,status,role,description
Site00,,100,Production,,Active,,

VLAN 100 is only an example. Can you please try it out yourself? For me it is pretty much reproducible.

Thanks a lot and best regards, Matthias.

@matthiaslink77 commented on GitHub (Jul 24, 2020): Dear Jeremy, thanks for your reply. I am wondering why a VLAN with a VID would not use that VID as a unique identifier together with the Site Name. But maybe there are other scenarios where this is not sufficient. So: As explained initially the first set of data has been exported directly the minute before from Netbox, which means the data exists (VLAN 100, no VLAN group). This is the corresponding line of the export from VLANs: site,group,vid,name,tenant,status,role,description Site00,,100,Production,,Active,, VLAN 100 is only an example. Can you please try it out yourself? For me it is pretty much reproducible. Thanks a lot and best regards, Matthias.
Author
Owner

@jeremystretch commented on GitHub (Jul 24, 2020):

I am wondering why a VLAN with a VID would not use that VID as a unique identifier together with the Site Name.

Having multiple VLANs with the same VID in the same site is a perfectly valid use case. Thus, we can't assume the tuple of (site, VID) is unique.

Can you please try it out yourself? For me it is pretty much reproducible.

Please list the exact steps you're taking, beginning with the creation of the site and VLAN.

@jeremystretch commented on GitHub (Jul 24, 2020): > I am wondering why a VLAN with a VID would not use that VID as a unique identifier together with the Site Name. Having multiple VLANs with the same VID in the same site is a perfectly valid use case. Thus, we can't assume the tuple of (site, VID) is unique. > Can you please try it out yourself? For me it is pretty much reproducible. Please list the exact steps you're taking, beginning with the creation of the site and VLAN.
Author
Owner

@czarnian commented on GitHub (Jul 29, 2020):

I had the same issue when I tried to import prefixes with assigned VLANs. When I removed the (empty) column vlan_group, the import worked, with correct vlan assignment (I do not use duplicate VIDs on sites).

@czarnian commented on GitHub (Jul 29, 2020): I had the same issue when I tried to import prefixes with assigned VLANs. When I removed the (empty) column `vlan_group`, the import worked, with correct vlan assignment (I do not use duplicate VIDs on sites).
Author
Owner

@jeremystretch commented on GitHub (Aug 10, 2020):

Closing this as detailed steps to reproduce the reported bug have not been provided.

@jeremystretch commented on GitHub (Aug 10, 2020): Closing this as detailed steps to reproduce the reported bug have not been provided.
Author
Owner

@marc-rose commented on GitHub (Oct 7, 2020):

I had been having this issue while working on writing an import tutorial and was able to use the workaround proposed by @czarnian (removing the vlan_group field during import).
I plan on importing many prefixes, many of which will could be in a vlan_group and some that aren't. If we want to re-open the issue I can provide the steps to reproduce on the latest version, starting with the site > vlan > prefix.

I was struggling with some concepts and thought I needed it to be in a vlan_group but I think it's just not finding the vlan at the site when the vlan_group header is present in the csv import

@marc-rose commented on GitHub (Oct 7, 2020): I had been having this issue while working on writing an import tutorial and was able to use the workaround proposed by @czarnian (removing the vlan_group field during import). I plan on importing many prefixes, many of which will could be in a vlan_group and some that aren't. If we want to re-open the issue I can provide the steps to reproduce on the latest version, starting with the site > vlan > prefix. I was struggling with some concepts and thought I needed it to be in a vlan_group but I think it's just not finding the vlan at the site when the vlan_group header is present in the csv import
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3894