Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cable traces do not display via anymore #4619

Closed
hellerve opened this issue May 11, 2020 · 17 comments
Closed

Cable traces do not display via anymore #4619

hellerve opened this issue May 11, 2020 · 17 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@hellerve
Copy link
Contributor

hellerve commented May 11, 2020

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

@jeremystretch
Copy link
Member

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

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

@jeremystretch jeremystretch added the status: revisions needed This issue requires additional information to be actionable label May 11, 2020
@hellerve
Copy link
Contributor Author

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

@jeremystretch jeremystretch removed the status: revisions needed This issue requires additional information to be actionable label May 11, 2020
@DanSheps
Copy link
Member

Looks like #4622 and #4625 might be related.

@DanSheps
Copy link
Member

DanSheps commented 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.

@stale
Copy link

stale bot commented May 27, 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 stale bot added the pending closure Requires immediate attention to avoid being closed for inactivity label May 27, 2020
@steffann
Copy link
Contributor

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

@stale stale bot removed the pending closure Requires immediate attention to avoid being closed for inactivity label May 27, 2020
@stale
Copy link

stale bot commented Jun 10, 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 stale bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Jun 10, 2020
@steffann
Copy link
Contributor

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.

@stale stale bot removed the pending closure Requires immediate attention to avoid being closed for inactivity label Jun 11, 2020
@martink2
Copy link

@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?

@steffann
Copy link
Contributor

My intention is to require no manual action

@stale
Copy link

stale bot commented 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 stale bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Jun 25, 2020
@hellerve
Copy link
Contributor Author

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 :)

@stale stale bot removed the pending closure Requires immediate attention to avoid being closed for inactivity label Jun 25, 2020
@Kircheneer
Copy link

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

@DanSheps DanSheps added status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application labels Jun 26, 2020
@hellerve
Copy link
Contributor Author

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

@tyler-8
Copy link
Contributor

tyler-8 commented 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|
+---------+     +-----+     +------------+     +------------+     +-----+     +---------+

@ddragic
Copy link

ddragic commented 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.

@steffann
Copy link
Contributor

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 steffann added pending closure Requires immediate attention to avoid being closed for inactivity status: maybe later and removed pending closure Requires immediate attention to avoid being closed for inactivity labels Jul 13, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

8 participants