Virtual chassis members cables not showing up consistently #4109

Closed
opened 2025-12-29 18:33:10 +01:00 by adam · 5 comments
Owner

Originally created by @XioNoX on GitHub (Sep 17, 2020).

Environment

  • Python version: 3.7.3
  • NetBox version: 2.8.9

Steps to Reproduce

  1. Create a virtual chassis
  2. Add cables to virtual chassis members
  3. List all cables connected to the VC master

Expected Behavior

All the cables connected to all the virtual chassis members to be listed. The same way listing interfaces on the VC master shows VC members interfaces.

Observed Behavior

Only some cables attached to the non master members are showing up.

The 3 virtual chassis members:
Screenshot_2020-09-17 asw2-oe16-esams - NetBox

The cables showing up when filtering for the VC master, see that it lists cable 1132 on asw2-oe14 only.
Screenshot_2020-09-17 Cables - NetBox

But for example this one cable is not showing up:
Screenshot_2020-09-17 Cable SMF00297 - NetBox

I already tried to delete/re-create the cable with no success. The same issue is happening on the API. I'm wondering if it's related to issue #4812.

Originally created by @XioNoX on GitHub (Sep 17, 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.7.3 * NetBox version: 2.8.9 <!-- 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. Create a virtual chassis 2. Add cables to virtual chassis members 3. List all cables connected to the VC master <!-- What did you expect to happen? --> ### Expected Behavior All the cables connected to all the virtual chassis members to be listed. The same way listing interfaces on the VC master shows VC members interfaces. <!-- What happened instead? --> ### Observed Behavior Only some cables attached to the non master members are showing up. The 3 virtual chassis members: ![Screenshot_2020-09-17 asw2-oe16-esams - NetBox](https://user-images.githubusercontent.com/688817/93440458-b9f54880-f8cf-11ea-8d23-3e51d39595bb.png) The cables showing up when filtering for the VC master, see that it lists cable 1132 on asw2-oe14 only. ![Screenshot_2020-09-17 Cables - NetBox](https://user-images.githubusercontent.com/688817/93440894-e8732380-f8cf-11ea-8e1e-58ef85da12f5.png) But for example this one cable is not showing up: ![Screenshot_2020-09-17 Cable SMF00297 - NetBox](https://user-images.githubusercontent.com/688817/93441693-1c4e4900-f8d0-11ea-85d9-1628d08fa51b.png) I already tried to delete/re-create the cable with no success. The same issue is happening on the API. I'm wondering if it's related to issue #4812.
adam added the type: bug label 2025-12-29 18:33:10 +01:00
adam closed this issue 2025-12-29 18:33:10 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 21, 2020):

  1. Create a virtual chassis
  2. Add cables to virtual chassis members
  3. List all cables connected to the VC master

You're going to need to provide more detail than that. Please specify a list of specific, discrete actions that someone else can take to reproduce the reported behavior, beginning with the creation of the virtual chassis and including each cable that you create. This doesn't need to replicate your entire installation, but it does need to be sufficient to reliably reproduce the behavior on a clean installation of the latest stable release. Additionally, be sure to specify exactly what you expect to see and what is happening instead.

@jeremystretch commented on GitHub (Sep 21, 2020): > 1. Create a virtual chassis > 2. Add cables to virtual chassis members > 3. List all cables connected to the VC master You're going to need to provide more detail than that. Please specify a list of specific, discrete actions that someone else can take to reproduce the reported behavior, beginning with the creation of the virtual chassis and including each cable that you create. This doesn't need to replicate your entire installation, but it does need to be sufficient to reliably reproduce the behavior on a clean installation of the latest stable release. Additionally, be sure to specify exactly what you expect to see and what is happening instead.
Author
Owner

@paravoid commented on GitHub (Sep 25, 2020):

Colleague of @XioNoX's here. I think I made some progress here :)

First of all, unless I missed something from the code (CableListView, CableFilterSet etc.), the cable view is not supposed to show all the interfaces of all members of a virtual chassis, when one is filtering with just the master. So, for example, for a virtual chassis that includes asw2-oe14-esams, asw2-oe15-esams, asw2-oe16-esams, with oe16 being the master, when one is filtering cables for "device = asw2-oe16-esams" (/dcim/cables/?device=asw2-oe16-esams) no interfaces attached to oe14/oe15 should show up. The issue mentioned above is that some interfaces of oe14 show up, and others (e.g. of oe15) do not. But the bug is the former behavior, not the latter.

So, why interfaces that are not oe16's show up when filtering with device=oe16? It seems like the issue here is that the cable model has a couple of caching fields (used for filtering among other things), and their values are stale:

>>> smf297._termination_a_device; smf297.termination_a.device
<Device: asw2-oe16-esams>
<Device: asw2-oe14-esams>

This shouldn't happen, and it's unclear why this happened in the first place.

The cable's last changed shows as Oct 31, 2019. The introduction of these caching fields, the code to set them on Cable's save(), as well as the respective migration (0075_cable_devices.py) seem to all have been added with v2.6.6, released on Oct 10th, 2019 (d2ab41abfb). In our environment, we went directly from v2.6.3 to v2.7.4 in February 2020 (and later to subsequent versions), so either something went with the migration, or the information became stale sometime after February 2020, but without the cable's changelog/last update having been modified, which is... puzzling. Any ideas here?

Obviously the short-term "fix" for our environment is to re-run the cache_cable_devices() code from 0075_cable_devices.py to bring back cache coherence in our database. It'd be nice if the root cause was less of a mystery, to feel a bit more assured that this won't happen again though!

@paravoid commented on GitHub (Sep 25, 2020): Colleague of @XioNoX's here. I think I made some progress here :) First of all, unless I missed something from the code (`CableListView`, `CableFilterSet` etc.), the cable view is **not** supposed to show all the interfaces of **all** members of a virtual chassis, when one is filtering with just the master. So, for example, for a virtual chassis that includes asw2-oe14-esams, asw2-oe15-esams, asw2-oe16-esams, with oe16 being the master, when one is filtering cables for "device = asw2-oe16-esams" (`/dcim/cables/?device=asw2-oe16-esams`) no interfaces attached to oe14/oe15 should show up. The issue mentioned above is that _some_ interfaces of oe14 show up, and others (e.g. of oe15) do not. But the bug is the former behavior, not the latter. So, why interfaces that are not oe16's show up when filtering with device=oe16? It seems like the issue here is that the cable model has a couple of caching fields (used for filtering among other things), and their values are stale: ```python >>> smf297._termination_a_device; smf297.termination_a.device <Device: asw2-oe16-esams> <Device: asw2-oe14-esams> ``` This shouldn't happen, and it's unclear why this happened in the first place. The cable's last changed shows as Oct 31, 2019. The introduction of these caching fields, the code to set them on Cable's `save()`, as well as the respective migration (`0075_cable_devices.py`) seem to all have been added with v2.6.6, released on Oct 10th, 2019 (d2ab41abfba04036603c3958226e23e992d38dcd). In our environment, we went directly from v2.6.3 to v2.7.4 in February 2020 (and later to subsequent versions), so either something went with the migration, or the information became stale sometime after February 2020, but without the cable's changelog/last update having been modified, which is... puzzling. Any ideas here? Obviously the short-term "fix" for our environment is to re-run the `cache_cable_devices()` code from `0075_cable_devices.py` to bring back cache coherence in our database. It'd be nice if the root cause was less of a mystery, to feel a bit more assured that this won't happen again though!
Author
Owner

@jeremystretch commented on GitHub (Oct 14, 2020):

As this appears to relate to the caching of cable terminations, I'm marking it as blocked by #4900, which is a v2.10 initiative. When the first beta for v2.10 is released, please see if you're able to reproduce the reported issue on it and share your findings here.

@jeremystretch commented on GitHub (Oct 14, 2020): As this appears to relate to the caching of cable terminations, I'm marking it as blocked by #4900, which is a v2.10 initiative. When the first beta for v2.10 is released, please see if you're able to reproduce the reported issue on it and share your findings here.
Author
Owner

@jeremystretch commented on GitHub (Nov 17, 2020):

@XioNoX @paravoid Please see if you're able to recreate the reported problem on the v2.10 beta release.

@jeremystretch commented on GitHub (Nov 17, 2020): @XioNoX @paravoid Please see if you're able to recreate the reported problem on the v2.10 beta release.
Author
Owner

@jeremystretch commented on GitHub (Dec 16, 2020):

This is likely resolved in the v2.10 release, so I'm going to close the issue. However, if anyone can provide detailed steps to reproduce the reported problem, please comment here and I'll re-open the issue.

@jeremystretch commented on GitHub (Dec 16, 2020): This is likely resolved in the v2.10 release, so I'm going to close the issue. However, if anyone can provide detailed steps to reproduce the reported problem, please comment here and I'll re-open the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4109