Some interfaces are missing in device view #1913

Closed
opened 2025-12-29 17:20:20 +01:00 by adam · 5 comments
Owner

Originally created by @danshipt on GitHub (Aug 8, 2018).

Environment

  • Python version: 3.4.8
  • NetBox version: 2.4.1

Steps to Reproduce

  1. Create device with number of interfaces
  2. Add connections to this interfaces

Expected Behavior

ALL created interfaces are shown with or without connection info.

Observed Behavior

Some interfaces are missing.

Here is what i found.

  1. DeviceView got all available interfaces and put it into template - OK
  2. In device.html i've put line DBG1 - {{ iface }} before {% include 'dcim/inc/interface.html' %}
  3. In inc/interface.html i've put DBG - {{ iface }} in the very beginning of the file.

Here is the results:

DBG1 - Bridge-Aggregation1 DBG - Bridge-Aggregation1 DBG1 - GE1/0/1 DBG - GE1/0/1 DBG1 - GE1/0/2 DBG - GE1/0/2 DBG1 - GE1/0/3 DBG - GE1/0/3 DBG1 - GE1/0/4 DBG - GE1/0/4 DBG1 - GE1/0/5 DBG - GE1/0/5 DBG1 - GE1/0/6 DBG - GE1/0/6 DBG1 - GE1/0/7 DBG - GE1/0/7 DBG1 - GE1/0/8 DBG - GE1/0/8 DBG1 - GE1/0/9 DBG - GE1/0/9 DBG1 - GE1/0/10 DBG - GE1/0/10 DBG1 - GE1/0/11 DBG - GE1/0/11 DBG1 - GE1/0/12 DBG - GE1/0/12 DBG1 - GE1/0/13 DBG - GE1/0/13 DBG1 - GE1/0/14 DBG - GE1/0/14 DBG1 - GE1/0/15 DBG - GE1/0/15 DBG1 - GE1/0/16 DBG - GE1/0/16 DBG1 - GE1/0/17 DBG - GE1/0/17 DBG1 - GE1/0/18 DBG - GE1/0/18 DBG1 - GE1/0/19 DBG1 - GE1/0/20 DBG - GE1/0/20 DBG1 - GE1/0/21 DBG - GE1/0/21 DBG1 - GE1/0/22 DBG - GE1/0/22 DBG1 - GE1/0/23 DBG - GE1/0/23 DBG1 - GE1/0/24 DBG - GE1/0/24 DBG1 - GE1/0/25 DBG1 - GE1/0/26 DBG - GE1/0/26 DBG1 - GE1/0/27 DBG - GE1/0/27 DBG1 - GE1/0/28 DBG - GE1/0/28 DBG1 - GE1/0/29 DBG - GE1/0/29 DBG1 - GE1/0/30 DBG - GE1/0/30 DBG1 - GE1/0/31 DBG - GE1/0/31 DBG1 - GE1/0/32 DBG1 - GE1/0/33 DBG1 - GE1/0/34 DBG - GE1/0/34 DBG1 - GE1/0/35 DBG - GE1/0/35 DBG1 - GE1/0/36 DBG - GE1/0/36 DBG1 - GE1/0/37 DBG - GE1/0/37 DBG1 - GE1/0/38 DBG1 - GE1/0/39 DBG - GE1/0/39 DBG1 - GE1/0/40 DBG1 - GE1/0/41 DBG - GE1/0/41 DBG1 - GE1/0/42 DBG - GE1/0/42 DBG1 - GE1/0/43 DBG - GE1/0/43 DBG1 - GE1/0/44 DBG - GE1/0/44 DBG1 - GE1/0/45 DBG - GE1/0/45 DBG1 - GE1/0/46 DBG - GE1/0/46 DBG1 - GE1/0/47 DBG - GE1/0/47 DBG1 - GE1/0/48 DBG - GE1/0/48 DBG1 - GE1/0/49 DBG - GE1/0/49 DBG1 - GE1/0/50 DBG - GE1/0/50 DBG1 - GE1/0/51 DBG - GE1/0/51 DBG1 - GE1/0/52 DBG - GE1/0/52

Note that for example interface GE1/0/19 have only DBG1 - GE1/0/19 record. It means that {% include 'dcim/inc/interface.html' %} is not working for some reason.

Originally created by @danshipt on GitHub (Aug 8, 2018). ### Environment * Python version: 3.4.8 * NetBox version: 2.4.1 ### Steps to Reproduce 1. Create device with number of interfaces 2. Add connections to this interfaces ### Expected Behavior ALL created interfaces are shown with or without connection info. ### Observed Behavior Some interfaces are missing. Here is what i found. 1. DeviceView got all available interfaces and put it into template - OK 2. In device.html i've put line ```DBG1 - {{ iface }}``` before ```{% include 'dcim/inc/interface.html' %}``` 3. In inc/interface.html i've put ```DBG - {{ iface }}``` in the very beginning of the file. Here is the results: ``` DBG1 - Bridge-Aggregation1 DBG - Bridge-Aggregation1 DBG1 - GE1/0/1 DBG - GE1/0/1 DBG1 - GE1/0/2 DBG - GE1/0/2 DBG1 - GE1/0/3 DBG - GE1/0/3 DBG1 - GE1/0/4 DBG - GE1/0/4 DBG1 - GE1/0/5 DBG - GE1/0/5 DBG1 - GE1/0/6 DBG - GE1/0/6 DBG1 - GE1/0/7 DBG - GE1/0/7 DBG1 - GE1/0/8 DBG - GE1/0/8 DBG1 - GE1/0/9 DBG - GE1/0/9 DBG1 - GE1/0/10 DBG - GE1/0/10 DBG1 - GE1/0/11 DBG - GE1/0/11 DBG1 - GE1/0/12 DBG - GE1/0/12 DBG1 - GE1/0/13 DBG - GE1/0/13 DBG1 - GE1/0/14 DBG - GE1/0/14 DBG1 - GE1/0/15 DBG - GE1/0/15 DBG1 - GE1/0/16 DBG - GE1/0/16 DBG1 - GE1/0/17 DBG - GE1/0/17 DBG1 - GE1/0/18 DBG - GE1/0/18 DBG1 - GE1/0/19 DBG1 - GE1/0/20 DBG - GE1/0/20 DBG1 - GE1/0/21 DBG - GE1/0/21 DBG1 - GE1/0/22 DBG - GE1/0/22 DBG1 - GE1/0/23 DBG - GE1/0/23 DBG1 - GE1/0/24 DBG - GE1/0/24 DBG1 - GE1/0/25 DBG1 - GE1/0/26 DBG - GE1/0/26 DBG1 - GE1/0/27 DBG - GE1/0/27 DBG1 - GE1/0/28 DBG - GE1/0/28 DBG1 - GE1/0/29 DBG - GE1/0/29 DBG1 - GE1/0/30 DBG - GE1/0/30 DBG1 - GE1/0/31 DBG - GE1/0/31 DBG1 - GE1/0/32 DBG1 - GE1/0/33 DBG1 - GE1/0/34 DBG - GE1/0/34 DBG1 - GE1/0/35 DBG - GE1/0/35 DBG1 - GE1/0/36 DBG - GE1/0/36 DBG1 - GE1/0/37 DBG - GE1/0/37 DBG1 - GE1/0/38 DBG1 - GE1/0/39 DBG - GE1/0/39 DBG1 - GE1/0/40 DBG1 - GE1/0/41 DBG - GE1/0/41 DBG1 - GE1/0/42 DBG - GE1/0/42 DBG1 - GE1/0/43 DBG - GE1/0/43 DBG1 - GE1/0/44 DBG - GE1/0/44 DBG1 - GE1/0/45 DBG - GE1/0/45 DBG1 - GE1/0/46 DBG - GE1/0/46 DBG1 - GE1/0/47 DBG - GE1/0/47 DBG1 - GE1/0/48 DBG - GE1/0/48 DBG1 - GE1/0/49 DBG - GE1/0/49 DBG1 - GE1/0/50 DBG - GE1/0/50 DBG1 - GE1/0/51 DBG - GE1/0/51 DBG1 - GE1/0/52 DBG - GE1/0/52 ``` Note that for example interface GE1/0/19 have only ```DBG1 - GE1/0/19``` record. It means that ```{% include 'dcim/inc/interface.html' %}``` is not working for some reason.
adam closed this issue 2025-12-29 17:20:20 +01:00
Author
Owner

@danshipt commented on GitHub (Aug 8, 2018):

It was Reverse for 'device' with keyword arguments '{'pk': ''}' not found. 1 pattern(s) tried: ['dcim/devices/(?P<pk>\\d+)/$'] error on include in inc/interface.html <a href="{% url 'dcim:device' pk=connected_iface.device.pk %}">{{ connected_iface.device }}</a>

@danshipt commented on GitHub (Aug 8, 2018): It was ```Reverse for 'device' with keyword arguments '{'pk': ''}' not found. 1 pattern(s) tried: ['dcim/devices/(?P<pk>\\d+)/$']``` error on include in inc/interface.html ```<a href="{% url 'dcim:device' pk=connected_iface.device.pk %}">{{ connected_iface.device }}</a>```
Author
Owner

@jeremystretch commented on GitHub (Aug 8, 2018):

Please provide the exact data someone else can use to reproduce this error, starting with creating a new device.

@jeremystretch commented on GitHub (Aug 8, 2018): Please provide the exact data someone else can use to reproduce this error, starting with creating a new device.
Author
Owner

@danshipt commented on GitHub (Aug 8, 2018):

@jeremystretch This behaviour is related to improper (?) use of API and this error appears when Interface.connected_interface.device returns None. This is only happens when Interface objects are created without device (device property is None). In this case template rendering fails.

I think it is a good idea to add additional check to Interface::clean method. This prevents occasional flooding with unrelated Interface objects.

@danshipt commented on GitHub (Aug 8, 2018): @jeremystretch This behaviour is related to improper (?) use of API and this error appears when Interface.connected_interface.device returns None. This is only happens when Interface objects are created without device (device property is None). In this case template rendering fails. I think it is a good idea to add additional check to Interface::clean method. This prevents occasional flooding with unrelated Interface objects.
Author
Owner

@jeremystretch commented on GitHub (Aug 8, 2018):

Again, you'll need to prescribe the exact steps needed to reproduce the bug on a fresh installation. Otherwise no one will be able to address this.

@jeremystretch commented on GitHub (Aug 8, 2018): Again, you'll need to prescribe the exact steps needed to reproduce the bug on a fresh installation. Otherwise no one will be able to address this.
Author
Owner

@jeremystretch commented on GitHub (Aug 16, 2018):

Closing due to lack of activity.

@jeremystretch commented on GitHub (Aug 16, 2018): Closing due to lack of activity.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1913