Error when bulk importing IP-addresses linked to device-interfaces #3705

Closed
opened 2025-12-29 18:30:41 +01:00 by adam · 2 comments
Owner

Originally created by @etoosamoe on GitHub (May 19, 2020).

Environment

  • Python version: 3.6.9
  • NetBox version: 2.8.3

Steps to Reproduce

  1. Disable any installed plugins by commenting out the PLUGINS setting in
    configuration.py.
  2. Make interfaces in device mow-101-rt-vpn-ospf-hub, e.g.: ipip-tunnel7
  3. Create IP address bulk import file, e.g.:
address,status,device,interface,description
172.16.203.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel7,IPIP-VOLG-ISP1
172.16.205.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel29,CDROC-DC
172.16.199.1/24,Active,mow-101-rt-vpn-ospf-hub,ether7,Connection L2VPN-MTS
172.16.206.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel1,Khabarovsk-ISP1
172.16.207.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel3,Khabarovsk over Internet MTS 
  1. Get error

P.S. If you delete interface from import text, the error is the same:

address,status,device,description
172.16.203.1/30,Active,mow-101-rt-vpn-ospf-hub,IPIP-VOLG-ISP1

It works when you importing address,status,description.

Expected Behavior

Get list of created IP addresses linked to device-interface

Observed Behavior

 There was a problem with your request. Please contact an administrator.
The complete exception is provided below:
<class 'KeyError'>
'interface_name'
If further assistance is required, please post to the NetBox mailing list. 

image

What am I doing wrong?

Originally created by @etoosamoe on GitHub (May 19, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report, and that any plugins have been disabled. --> ### Environment * Python version: 3.6.9 * NetBox version: 2.8.3 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox. Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a client library such as pynetbox. --> ### Steps to Reproduce 1. Disable any installed plugins by commenting out the `PLUGINS` setting in `configuration.py`. 2. Make interfaces in device ``mow-101-rt-vpn-ospf-hub``, e.g.: ipip-tunnel7 3. Create IP address bulk import file, e.g.: ``` address,status,device,interface,description 172.16.203.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel7,IPIP-VOLG-ISP1 172.16.205.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel29,CDROC-DC 172.16.199.1/24,Active,mow-101-rt-vpn-ospf-hub,ether7,Connection L2VPN-MTS 172.16.206.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel1,Khabarovsk-ISP1 172.16.207.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel3,Khabarovsk over Internet MTS ``` 3. Get error P.S. If you delete ``interface`` from import text, the error is the same: ``` address,status,device,description 172.16.203.1/30,Active,mow-101-rt-vpn-ospf-hub,IPIP-VOLG-ISP1 ``` It works when you importing ``address,status,description``. <!-- What did you expect to happen? --> ### Expected Behavior Get list of created IP addresses linked to device-interface <!-- What happened instead? --> ### Observed Behavior ``` There was a problem with your request. Please contact an administrator. The complete exception is provided below: <class 'KeyError'> 'interface_name' If further assistance is required, please post to the NetBox mailing list. ``` ![image](https://user-images.githubusercontent.com/38806450/82296952-a1753000-99ba-11ea-8705-15b318f3b63f.png) What am I doing wrong?
adam added the status: duplicate label 2025-12-29 18:30:41 +01:00
adam closed this issue 2025-12-29 18:30:41 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 19, 2020):

Duplicate of #4649

@jeremystretch commented on GitHub (May 19, 2020): Duplicate of #4649
Author
Owner

@etoosamoe commented on GitHub (May 19, 2020):

Thanks for answer. I read #4649 but I am importing with specifying device and interface:

address,status,device,interface,description
172.16.203.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel7,IPIP-VOLG-ISP1
172.16.205.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel29,CDROC-DC
172.16.199.1/24,Active,mow-101-rt-vpn-ospf-hub,ether7,Connection L2VPN-MTS
172.16.206.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel1,Khabarovsk-ISP1
172.16.207.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel3,Khabarovsk over Internet MTS 

in this case mow-101-rt-vpn-ospf-hub is device-name, and ipip-tunnel7 is interface-name

@etoosamoe commented on GitHub (May 19, 2020): Thanks for answer. I read #4649 but I am importing with specifying device and interface: ``` address,status,device,interface,description 172.16.203.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel7,IPIP-VOLG-ISP1 172.16.205.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel29,CDROC-DC 172.16.199.1/24,Active,mow-101-rt-vpn-ospf-hub,ether7,Connection L2VPN-MTS 172.16.206.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel1,Khabarovsk-ISP1 172.16.207.1/30,Active,mow-101-rt-vpn-ospf-hub,ipip-tunnel3,Khabarovsk over Internet MTS ``` in this case **mow-101-rt-vpn-ospf-hub** is device-name, and **ipip-tunnel7** is interface-name
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3705