Cable traces do not display via anymore #3667

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

Originally created by @hellerve on GitHub (May 11, 2020).

Originally assigned to: @steffann on GitHub.

Environment

  • Python version: 3.7 (should be on any)
  • NetBox version: 2.8

Steps to Reproduce

  1. Disable any installed plugins by commenting out the PLUGINS setting in
    configuration.py.
  2. Add two devices with interfaces, let’s call them A and B.
  3. Create a circuit with two terminations, one on the A side and one on the Z side.
  4. Connect interfaces on device A to the A side of the circuit, and device B on the Z side.

Expected Behavior

Historically, the circuit termination was the connected endpoint, meaning that you were able to see the property via.

Here’s an interface connected before the update:

Bildschirmfoto 2020-05-11 um 12 51 32

This is the trace:

Bildschirmfoto 2020-05-11 um 12 52 02

Observed Behavior

Due to the new tracing logic, circuit terminations gets resolved in there, meaning that the template never ends up in the code path that renders the via, and only interfaces are the connected endpoints.

Here’s an interface connected after the update:

Bildschirmfoto 2020-05-11 um 12 52 11

Here’s the trace:

Bildschirmfoto 2020-05-11 um 12 52 17

This behavior change is a bit tricky to resolve, since it involves two parts of the Netbox code: the signal that handles cables and connected endpoints in netbox.dcim.signals:update_connected_endpoints, which after a bit of indirection calls trace, and the template netbox/templates/dcim/inc/interface, specifically the part that triggers on iface.connected_endpoint.term_side.

I hope that this is understandable. I’d be happy to provide any additional info that you might need.

Cheers

Originally created by @hellerve on GitHub (May 11, 2020). Originally assigned to: @steffann on GitHub. # Environment * Python version: 3.7 (should be on any) * NetBox version: 2.8 ### Steps to Reproduce 1. Disable any installed plugins by commenting out the `PLUGINS` setting in `configuration.py`. 2. Add two devices with interfaces, let’s call them A and B. 3. Create a circuit with two terminations, one on the A side and one on the Z side. 4. Connect interfaces on device A to the A side of the circuit, and device B on the Z side. ### Expected Behavior Historically, the circuit termination was the connected endpoint, meaning that you were able to see the property `via`. Here’s an interface connected before the update: <img width="1408" alt="Bildschirmfoto 2020-05-11 um 12 51 32" src="https://user-images.githubusercontent.com/7725188/81554317-dc59e100-9386-11ea-9f58-46962b196396.png"> This is the trace: <img width="1432" alt="Bildschirmfoto 2020-05-11 um 12 52 02" src="https://user-images.githubusercontent.com/7725188/81554362-f1cf0b00-9386-11ea-964d-dae4569d87ad.png"> ### Observed Behavior Due to the new tracing logic, circuit terminations gets resolved in there, meaning that the template never ends up in the code path that renders the `via`, and only interfaces are the connected endpoints. Here’s an interface connected after the update: <img width="1428" alt="Bildschirmfoto 2020-05-11 um 12 52 11" src="https://user-images.githubusercontent.com/7725188/81554475-25aa3080-9387-11ea-9eeb-5a83d7e5cd3e.png"> Here’s the trace: <img width="1440" alt="Bildschirmfoto 2020-05-11 um 12 52 17" src="https://user-images.githubusercontent.com/7725188/81554486-2c38a800-9387-11ea-89a9-3cff35c252cb.png"> This behavior change is a bit tricky to resolve, since it involves two parts of the Netbox code: the signal that handles cables and connected endpoints in `netbox.dcim.signals:update_connected_endpoints`, which after a bit of indirection calls `trace`, and the template `netbox/templates/dcim/inc/interface`, specifically the part that triggers on `iface.connected_endpoint.term_side`. I hope that this is understandable. I’d be happy to provide any additional info that you might need. Cheers
adam added the type: bugstatus: accepted labels 2025-12-29 18:30:29 +01:00
adam closed this issue 2025-12-29 18:30:29 +01:00
Author
Owner

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

Create a cable from an interface to another, through a circuit.

Please provide the exact steps you are taking to reproduce this issue.

@jeremystretch commented on GitHub (May 11, 2020): > Create a cable from an interface to another, through a circuit. Please provide the exact steps you are taking to reproduce this issue.
Author
Owner

@hellerve commented on GitHub (May 11, 2020):

I’ve updated the description to be a little less terse.

@hellerve commented on GitHub (May 11, 2020): I’ve updated the description to be a little less terse.
Author
Owner

@DanSheps commented on GitHub (May 11, 2020):

Looks like #4622 and #4625 might be related.

@DanSheps commented on GitHub (May 11, 2020): Looks like #4622 and #4625 might be related.
Author
Owner

@DanSheps commented on GitHub (May 11, 2020):

Doing some testing, seems like the problem is straight forward:

When the path is first initialized, the path doesn't have two endpoints. Once the path is fully initialized (two terminations connected), it only cares about the end path.

I think this is going to be a weird corner case where we are going to need to also check along the path and cache the the appropriate sides for a circuit termination in the path the endpoint as well. Not sure how easy the fix will be though, as you also need to take into account circuits that are in-between when deleting or updating the path.

@DanSheps commented on GitHub (May 11, 2020): Doing some testing, seems like the problem is straight forward: When the path is first initialized, the path doesn't have two endpoints. Once the path is fully initialized (two terminations connected), it only cares about the end path. I think this is going to be a weird corner case where we are going to need to also check along the path and cache the the appropriate sides for a circuit termination in the path the endpoint as well. Not sure how easy the fix will be though, as you also need to take into account circuits that are in-between when deleting or updating the path.
Author
Owner

@stale[bot] commented on GitHub (May 28, 2020):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale[bot] commented on GitHub (May 28, 2020): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@steffann commented on GitHub (May 28, 2020):

I'm still working on this, but it's harder than I thought so I need a bit more time.

@steffann commented on GitHub (May 28, 2020): I'm still working on this, but it's harder than I thought so I need a bit more time.
Author
Owner

@stale[bot] commented on GitHub (Jun 11, 2020):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale[bot] commented on GitHub (Jun 11, 2020): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@steffann commented on GitHub (Jun 11, 2020):

Silly stalebot. I'm working on this. Honest!

A little more detail: I am testing with storing trace results so they are easy to display. First results look promising.

@steffann commented on GitHub (Jun 11, 2020): Silly stalebot. I'm working on this. Honest! A little more detail: I am testing with storing trace results so they are easy to display. First results look promising.
Author
Owner

@martink2 commented on GitHub (Jun 11, 2020):

@steffann, Thanks for trying to get this sorted out. We do very much rely on the circuit visibility
on the device interface list. We currently have held off adding a large number of circuits which have been recently installed pending the outcome of this fix. If we would add the circuits now would your fix show them correctly on the interfaces after the update or is this only being evaluated when we disconnect/re-connect the circuits later?

@martink2 commented on GitHub (Jun 11, 2020): @steffann, Thanks for trying to get this sorted out. We do very much rely on the circuit visibility on the device interface list. We currently have held off adding a large number of circuits which have been recently installed pending the outcome of this fix. If we would add the circuits now would your fix show them correctly on the interfaces after the update or is this only being evaluated when we disconnect/re-connect the circuits later?
Author
Owner

@steffann commented on GitHub (Jun 11, 2020):

My intention is to require no manual action

@steffann commented on GitHub (Jun 11, 2020): My intention is to require no manual action
Author
Owner

@stale[bot] commented on GitHub (Jun 25, 2020):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale[bot] commented on GitHub (Jun 25, 2020): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@hellerve commented on GitHub (Jun 25, 2020):

Could you use any help with anything, @steffann? Unfortunately I’ll be on vacation next week, but I can help starting the week after that :)

@hellerve commented on GitHub (Jun 25, 2020): Could you use any help with anything, @steffann? Unfortunately I’ll be on vacation next week, but I can help starting the week after that :)
Author
Owner

@Kircheneer commented on GitHub (Jun 26, 2020):

@hellerve It looks like #4706 should resolve this as @DanSheps mentioned there.

@Kircheneer commented on GitHub (Jun 26, 2020): @hellerve It looks like #4706 should resolve this as @DanSheps mentioned there.
Author
Owner

@hellerve commented on GitHub (Jun 26, 2020):

@Kircheneer Ah, thanks! I seem to have missed that backreference here.

@hellerve commented on GitHub (Jun 26, 2020): @Kircheneer Ah, thanks! I seem to have missed that backreference here.
Author
Owner

@tyler-8 commented on GitHub (Jul 1, 2020):

I did some testing on #4706 (now merged) and it does not appear to fully fix this particular issue.

I first tried editing the cable and the circuit terminations and click the 'Save' button with no change. I also disconnected the cables from either termination and re-created them with no change.

However, when I deleted the circuit terminations and re-created them, as well as recreated the interface connections, I got the termination A on the circuit detail page to show the device and interface it was connected to. The termination Z did not show the device/interface data.

And on each device's detail page, the "via" was still missing, only showing the distant end device name and interface as before.

For clarification here's the path I'm working with:

+---------+     +-----+     +------------+     +------------+     +-----+     +---------+
|Interface|-----|Cable|-----|CircuitTermA|-----|CircuitTermZ|-----|Cable|-----|Interface|
+---------+     +-----+     +------------+     +------------+     +-----+     +---------+
@tyler-8 commented on GitHub (Jul 1, 2020): I did some testing on #4706 (now merged) and it does not appear to fully fix this particular issue. I first tried editing the cable and the circuit terminations and click the 'Save' button with no change. I also disconnected the cables from either termination and re-created them with no change. However, when I deleted the circuit terminations and re-created them, as well as recreated the interface connections, I got the termination A on the circuit detail page to show the device and interface it was connected to. The termination Z did not show the device/interface data. And on each device's detail page, the "via" was still missing, only showing the distant end device name and interface as before. For clarification here's the path I'm working with: ``` +---------+ +-----+ +------------+ +------------+ +-----+ +---------+ |Interface|-----|Cable|-----|CircuitTermA|-----|CircuitTermZ|-----|Cable|-----|Interface| +---------+ +-----+ +------------+ +------------+ +-----+ +---------+ ```
Author
Owner

@ddragic commented on GitHub (Jul 4, 2020):

Haven't done any extensive testing, but I just upgraded to v2.8.7 and as @tyler-8 said this issue is still there.

@ddragic commented on GitHub (Jul 4, 2020): Haven't done any extensive testing, but I just upgraded to v2.8.7 and as @tyler-8 said this issue is still there.
Author
Owner

@steffann commented on GitHub (Jul 13, 2020):

It turned out that with the current database models it is not feasible anymore to show "via" for interface-to-interface paths. What is still possible is to show the circuit when the trace ends at CircuitTermA (connected endpoint shows the circuti) or CircuitTermZ (connected endpoint shows "site Z via circuit X".

This is part of a recent cleanup ticket. I'm sorry that we cannot restore the "via" functionality for this use case at this point.

@steffann commented on GitHub (Jul 13, 2020): It turned out that with the current database models it is not feasible anymore to show "via" for interface-to-interface paths. What is still possible is to show the circuit when the trace ends at CircuitTermA (connected endpoint shows the circuti) or CircuitTermZ (connected endpoint shows "site Z via circuit X". This is part of a recent [cleanup](https://github.com/netbox-community/netbox/issues/4812) ticket. I'm sorry that we cannot restore the "via" functionality for this use case at this point.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3667