Multi-termination Cable Trace: Interfaces are randomly swapped #8828

Closed
opened 2025-12-29 20:41:47 +01:00 by adam · 6 comments
Owner

Originally created by @uedvt359 on GitHub (Nov 10, 2023).

Originally assigned to: @Moehritz on GitHub.

NetBox version

v3.6.5

Python version

3.11

Steps to Reproduce

this is reproducible on demo.netbox.dev

1: Create 3 devices (names and interfaces obviously don't matter, but these are the ones in the screenshots):

  • server (nms)
  • switch-old (dist) with interface 65
  • switch-new (spine) with interface 1:10

2: connect server to both switches:

  • nms -> dist
  • spine -> nms

3: do a cable trace

Expected Behavior

the interface of switch-old (dist) should be displayed above switch-old and same for switch-new (spine)

Observed Behavior

depending on the order in which the terminations were added on the multi-side, the interfaces might be flipped around. it can be "fixed" by removing one of the terminations, saving and re-adding it (if it doesn't work, remove the other one).

flipped:
image

after the remove-and-readd workaround:
image

https://demo.netbox.dev/dcim/interfaces/1802/trace/

### Tasks
Originally created by @uedvt359 on GitHub (Nov 10, 2023). Originally assigned to: @Moehritz on GitHub. ### NetBox version v3.6.5 ### Python version 3.11 ### Steps to Reproduce this is reproducible on demo.netbox.dev 1: Create 3 devices (names and interfaces obviously don't matter, but these are the ones in the screenshots): * server (`nms`) * switch-old (`dist`) with interface `65` * switch-new (`spine`) with interface `1:10` 2: connect server to both switches: * `nms` -> `dist` * `spine` -> `nms` 3: do a cable trace ### Expected Behavior the interface of switch-old (`dist`) should be displayed above switch-old and same for switch-new (`spine`) ### Observed Behavior depending on the order in which the terminations were added on the multi-side, the interfaces might be flipped around. it can be "fixed" by removing one of the terminations, saving and re-adding it (if it doesn't work, remove the other one). flipped: ![image](https://github.com/netbox-community/netbox/assets/54625981/7f040b87-5083-45f9-a116-e6a25553b967) after the remove-and-readd workaround: ![image](https://github.com/netbox-community/netbox/assets/54625981/561e1c82-4b40-4607-925b-81c3f9d7a13a) https://demo.netbox.dev/dcim/interfaces/1802/trace/ ```[tasklist] ### Tasks ```
adam added the type: bugstatus: acceptedtopic: cablingseverity: low labels 2025-12-29 20:41:47 +01:00
adam closed this issue 2025-12-29 20:41:47 +01:00
Author
Owner

@abhi1693 commented on GitHub (Nov 10, 2023):

I don't believe this is a bug just an nuance that there is no ordering in place to keep the display same every time the page is opened

@abhi1693 commented on GitHub (Nov 10, 2023): I don't believe this is a bug just an nuance that there is no ordering in place to keep the display same every time the page is opened
Author
Owner

@uedvt359 commented on GitHub (Nov 10, 2023):

look again closely at the two bottom items: dist is always on the left, but the associated interface changes!

@uedvt359 commented on GitHub (Nov 10, 2023): look again closely at the two bottom items: `dist` is always on the left, but the associated interface changes!
Author
Owner

@DanSheps commented on GitHub (Nov 10, 2023):

I will try and take a stab at this this weekend

@DanSheps commented on GitHub (Nov 10, 2023): I will try and take a stab at this this weekend
Author
Owner

@DanSheps commented on GitHub (Nov 13, 2023):

Took a look at this a bit, probably won't be an easy fix and might need a bit of a rewrite to the svg draw code.

@DanSheps commented on GitHub (Nov 13, 2023): Took a look at this a bit, probably won't be an easy fix and might need a bit of a rewrite to the svg draw code.
Author
Owner

@Moehritz commented on GitHub (Jan 9, 2024):

I took a stab at this as well as #13922, they are related. I fixed both.

Currently device objects, terminations and cables are drawn separately with no linking them if they appear out of order, I built an extended testcase for that which highlights both issues:
image
(rear2 is actually connected to et1h1 of s02)

Updated Version looks like this:
image
If number of interfaces align, there will only be straight lines as before.

If it is okay for you I will submit my changes as a PR for review for you @DanSheps. Are there additional test-cases that I should do manually (verifying rendered SVG for some data) for changes in the renderer?

@Moehritz commented on GitHub (Jan 9, 2024): I took a stab at this as well as #13922, they are related. I fixed both. Currently device objects, terminations and cables are drawn separately with no linking them if they appear out of order, I built an extended testcase for that which highlights both issues: ![image](https://github.com/netbox-community/netbox/assets/1659422/d29c8ef1-4d05-4349-a569-95694ed38a8b) (rear2 is actually connected to et1h1 of s02) Updated Version looks like this: ![image](https://github.com/netbox-community/netbox/assets/1659422/10b8b03b-a1f3-4384-91ee-081e03b6bd9b) If number of interfaces align, there will only be straight lines as before. If it is okay for you I will submit my changes as a PR for review for you @DanSheps. Are there additional test-cases that I should do manually (verifying rendered SVG for some data) for changes in the renderer?
Author
Owner

@jeremystretch commented on GitHub (Jan 9, 2024):

Thanks @Moehritz, I'll take a look!

@jeremystretch commented on GitHub (Jan 9, 2024): Thanks @Moehritz, I'll take a look!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8828