netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Assigning a cable termination to multiple front-ports on multiple devices raises an AssertionError

Open jsenecal opened this issue 3 years ago • 9 comments

NetBox version

v3.3-beta1

Python version

3.8

Steps to Reproduce

  1. Populate NetBox with what is required to create a device and at least an interface (Manufacturer, Device Type, Sites, etc).
  2. Populate NetBox with what is required to create two patch-panel like devices with at least one front port and one rear port (Manufacturer, Device Type, etc).
  3. Create two patch-panel like devices ("device1", "device2"), each having a front/rear port pair.
  4. Create a "device3" with at least one interface
  5. Connect the interface of device3 to the two front ports of devices 1 and 2
  6. AssertionError

Expected Behavior

The cable should be created and split the cable trace when everything gets connected (rear ports, etc).

Observed Behavior

A AssertionError exception is raised.

jsenecal avatar Jul 28 '22 16:07 jsenecal

This occurs only when at least one of the mapped rear ports has multiple positions. We don't currently handle a case where a cable splits across multiple multi-position rear ports.

jeremystretch avatar Aug 02 '22 12:08 jeremystretch

This occurs only when at least one of the mapped rear ports has multiple positions. We don't currently handle a case where a cable splits across multiple multi-position rear ports.

What is a 'multi-position rear port'?

sdktr avatar Aug 05 '22 09:08 sdktr

A rear port with positions set to a value greater than 1.

jeremystretch avatar Aug 05 '22 12:08 jeremystretch

Example for use-case: https://github.com/netbox-community/netbox/issues/9139#issuecomment-1122478520

jsenecal avatar Aug 05 '22 21:08 jsenecal

I have single position rear ports and having problems to create one interface to two front ports.

I managed to replicate my problem into demo instance too: https://demo.netbox.dev/dcim/interfaces/2278/trace/

Jorcha avatar Aug 29 '22 17:08 Jorcha

gle position rear ports and having problems to create one interface to two front ports.

Unfortunately the demo instance resets quite often.

Would you be able to document the steps here @Jorcha ? It may very well be a different issue...

jsenecal avatar Sep 20 '22 19:09 jsenecal

Sure. At this time I got different result while I tested next setup in demo instance v3.3.4! It seemed to work okay while using two position splice (cable trace shows right result see attachment) but single position cabling seems to have issues to find out path to remote.. If I click node below Path Split text I get no path found message (see another attachment)

When testing in our own v3.3.0 version, if I have single cable to single front port to single position rear port everything is ok, if I add second one position front port to same interface I will get "must have rear port" error (see 3rd attachement) BUT now two connections from interface to front ports linked to two position rear port seems to work fine! (I think my previous test had some kind of demo effect involved)

How to create simple demo setup:

  1. Create "Fiber panel AtoB" device with two single position rear ports and one two position rear port for testing (https://demo.netbox.dev/dcim/devices/107/rear-ports/)
  2. Create four front ports to "Fiber panel AtoB" and map them to rear ports (https://demo.netbox.dev/dcim/devices/107/front-ports/)
  3. Create another "Fiber panel BtoA" device with two single position rear ports and one two position rear port for testing (https://demo.netbox.dev/dcim/devices/108/rear-ports/)
  4. Create four front ports to "Fiber panel BtoA" and map them to rear ports (https://demo.netbox.dev/dcim/devices/108/front-ports/)
  5. Map all ports between AtoB and BtoA (three connections: two single ones and one splice)
  6. Create two "switches" having atleast two normal interfaces (https://demo.netbox.dev/dcim/devices/109/interfaces/ & https://demo.netbox.dev/dcim/devices/110/interfaces/)
  7. Connect switch 1 from first interface to first two front ports of AtoB fiber panel
  8. Connect switch 1 from second interface to next two front ports of AtoB fiber panel
  9. Repeat same to switch 2 and BtoA fiber panel.

poc-cable-splice poc-cable-single single-v330-error

Jorcha avatar Sep 22 '22 12:09 Jorcha

Quick small testing more about Path Split:

If I do connection illustrated in attachment I will get path split. I think if I have two fiber patch panels connected together with multi position cabling cable trace has issues to find remote device. (Terminology issue in attachment! Instead Switch there should text "Interface")

Problem-Cabling

Jorcha avatar Sep 23 '22 06:09 Jorcha

This occurs only when at least one of the mapped rear ports has multiple positions. We don't currently handle a case where a cable splits across multiple multi-position rear ports.

I don't know if I should open a new FR for this, or just provide a use case that makes the current behavior a "bug".

I have a number of dark fiber circuits that use a Tx MUX + Rx MUX (Or single Tx/Rx MUX going to two strands) terminating in a single interface that unfortunately can't be modeled due to this limitation.

Side note, FR would ideally include specifying Tx/Rx direction on the connection but for this implementation I would just set the cable label to include this info

Interface_to_Separate_Tx_and_Rx_Strands

+1 for getting this fixed, or I'm happy to create that new FR

craized avatar Oct 13 '22 19:10 craized

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. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

github-actions[bot] avatar Dec 13 '22 04:12 github-actions[bot]

I wasn't able to replicate the original issue anymore - Closing

jsenecal avatar Jan 03 '23 18:01 jsenecal

@Jorcha your issue is still relevant but would require a new one to be opened as it is different from the one I originally opened.

Thanks!

jsenecal avatar Jan 03 '23 18:01 jsenecal