Error when adding new connection to front port. #9186

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

Originally created by @ivanovuri on GitHub (Feb 2, 2024).

Originally assigned to: @DanSheps on GitHub.

Deployment Type

Self-hosted

NetBox Version

v3.7.1

Python Version

3.8

Steps to Reproduce

You can reproduce same behaviour in demo.netbox.dev. All devices was created in NewYork site.

  1. Log-in to public demo site.
  2. Locate NewYork devices: https://demo.netbox.dev/dcim/devices/?site_id=29
  3. Add port connection from NY-Router from port et-0/0/1 to Panel1.1-NY port 1 and port 24.
    image
  4. Press create and get an error))
    image

Crosses connection looks like this:
image

Expected Behavior

I expect a new fancy connection to the patch panel.

Observed Behavior

Server Error
<class 'AssertionError'>

Python version: 3.8.10
NetBox version: 3.7.1
Plugins:
netbox_demo: 0.3.1

Originally created by @ivanovuri on GitHub (Feb 2, 2024). Originally assigned to: @DanSheps on GitHub. ### Deployment Type Self-hosted ### NetBox Version v3.7.1 ### Python Version 3.8 ### Steps to Reproduce You can reproduce same behaviour in demo.netbox.dev. All devices was created in NewYork site. 1. Log-in to public demo site. 2. Locate NewYork devices: https://demo.netbox.dev/dcim/devices/?site_id=29 3. Add port connection from NY-Router from port et-0/0/1 to Panel1.1-NY port 1 and port 24. ![image](https://github.com/netbox-community/netbox/assets/108669313/69ed723d-46f5-4944-b249-a4c591952bdc) 4. Press create and get an error)) ![image](https://github.com/netbox-community/netbox/assets/108669313/4f843b6b-d87d-43e5-8dd0-88b0ef00ea2b) Crosses connection looks like this: ![image](https://github.com/netbox-community/netbox/assets/108669313/194333cd-f779-4819-b683-511bdae3d8df) ### Expected Behavior I expect a new fancy connection to the patch panel. ### Observed Behavior Server Error <class 'AssertionError'> Python version: 3.8.10 NetBox version: 3.7.1 Plugins: netbox_demo: 0.3.1
adam added the type: bugstatus: acceptednetboxseverity: low labels 2025-12-29 20:46:44 +01:00
adam closed this issue 2025-12-29 20:46:44 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 2, 2024):

  1. Log-in to public demo site.

Per the bug report template:

Additionally, do not rely on the demo instance for reproducing suspected bugs, as its data is prone to modification or deletion at any time.

Please revise your report above to include complete instructions that someone else can follow to reproduce the reported behavior. Otherwise, it will be closed as invalid.

@jeremystretch commented on GitHub (Feb 2, 2024): > 1. Log-in to public demo site. Per the bug report template: > Additionally, **do not rely on the demo instance** for reproducing suspected bugs, as its data is prone to modification or deletion at any time. Please revise your report above to include **complete instructions** that someone else can follow to reproduce the reported behavior. Otherwise, it will be closed as invalid.
Author
Owner

@ivanovuri commented on GitHub (Feb 3, 2024):

Ok, It's a pity but the same bahaviour on all version and you even not need to do anything.

To reproduce you should do:

  1. Create Panel1.1 Generic device
  2. Add a new rear port splice named "Rare port splice to Panel1.2" with 12 positions
  3. Add a new 12 front ports from 1 - 12 and attach it to newly created rare splice.
  4. Add a new rear port splice "Rare port splice to Panel1.3" with 12 positions
  5. Add a new 12 front ports from 24-35 and attach it to newly created rare splice.
  6. Create rear port splice name "Rare port splice" Panel1.3 Generic device
  7. Add a new rear port splice named "Rare port splice" with 12 positions
  8. Add a new 12 front ports from 1 - 12 and attach it to newly created rare splice.
  9. Create Panel1.3 Generic device
  10. Add a new rear port splice named "Rare port splice" with 12 positions
  11. Add a new 12 front ports from 1-12 and attach it to newly created rare splice.
  12. Connect rear splice named "Rare port splice to Panel1.2" rear port splice name "Rare port splice" Panel1.2
  13. Connect rear splice named "Rare port splice to Panel1.3" rear port splice name "Rare port splice" Panel1.3
  14. Connect router port as was shown in image in first message (add port connection from NY-Router from port et-0/0/1 to Panel1.1-NY port 1 and port 24).
@ivanovuri commented on GitHub (Feb 3, 2024): Ok, It's a pity but the same bahaviour on all version and you even not need to do anything. To reproduce you should do: 1. Create **Panel1.1** Generic device 2. Add a new rear port splice named **"Rare port splice to Panel1.2"** with 12 positions 3. Add a new 12 front ports from 1 - 12 and attach it to newly created rare splice. 4. Add a new rear port splice **"Rare port splice to Panel1.3"** with 12 positions 5. Add a new 12 front ports from 24-35 and attach it to newly created rare splice. 6. Create rear port splice name **"Rare port splice"** **Panel1.3** Generic device 7. Add a new rear port splice named **"Rare port splice"** with 12 positions 8. Add a new 12 front ports from 1 - 12 and attach it to newly created rare splice. 9. Create **Panel1.3** Generic device 10. Add a new rear port splice named **"Rare port splice"** with 12 positions 11. Add a new 12 front ports from 1-12 and attach it to newly created rare splice. 12. Connect rear splice named **"Rare port splice to Panel1.2"** rear port splice name **"Rare port splice"** **Panel1.2** 13. Connect rear splice named **"Rare port splice to Panel1.3"** rear port splice name **"Rare port splice"** **Panel1.3** 14. Connect router port as was shown in image in first message (add port connection from NY-Router from port et-0/0/1 to Panel1.1-NY port 1 and port 24).
Author
Owner

@jeffgdotorg commented on GitHub (Apr 1, 2024):

Thank you for making the requested updates to your report. I was able to reproduce the behavior on a v3.7.4 system using the new steps provided.

I also obtained the following traceback from v3.7.4, which may be helpful to the next person to work this issue:

Internal Server Error: /dcim/cables/add/
Traceback (most recent call last):
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/netbox/netbox/dcim/views.py", line 3194, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox/netbox/netbox/views/generic/object_views.py", line 175, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox/netbox/netbox/views/generic/base.py", line 26, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox/netbox/utilities/views.py", line 106, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/netbox/netbox/netbox/views/generic/object_views.py", line 269, in post
    obj = form.save()
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/forms/models.py", line 542, in save
    self.instance.save()
  File "/opt/netbox/netbox/dcim/models/cables.py", line 240, in save
    trace_paths.send(Cable, instance=self, created=_created)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 176, in send
    return [
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 177, in <listcomp>
    (receiver, receiver(signal=self, sender=sender, **named))
  File "/opt/netbox/netbox/dcim/signals.py", line 98, in update_connected_endpoints
    create_cablepath(nodes)
  File "/opt/netbox/netbox/dcim/utils.py", line 43, in create_cablepath
    cp = CablePath.from_origin(terminations)
  File "/opt/netbox/netbox/dcim/models/cables.py", line 547, in from_origin
    assert all(t.parent_object == terminations[0].parent_object for t in terminations[1:])
AssertionError
@jeffgdotorg commented on GitHub (Apr 1, 2024): Thank you for making the requested updates to your report. I was able to reproduce the behavior on a v3.7.4 system using the new steps provided. I also obtained the following traceback from v3.7.4, which may be helpful to the next person to work this issue: ``` Internal Server Error: /dcim/cables/add/ Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/netbox/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 104, in view return self.dispatch(request, *args, **kwargs) File "/opt/netbox/netbox/dcim/views.py", line 3194, in dispatch return super().dispatch(request, *args, **kwargs) File "/opt/netbox/netbox/netbox/views/generic/object_views.py", line 175, in dispatch return super().dispatch(request, *args, **kwargs) File "/opt/netbox/netbox/netbox/views/generic/base.py", line 26, in dispatch return super().dispatch(request, *args, **kwargs) File "/opt/netbox/netbox/utilities/views.py", line 106, in dispatch return super().dispatch(request, *args, **kwargs) File "/opt/netbox/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 143, in dispatch return handler(request, *args, **kwargs) File "/opt/netbox/netbox/netbox/views/generic/object_views.py", line 269, in post obj = form.save() File "/opt/netbox/venv/lib/python3.10/site-packages/django/forms/models.py", line 542, in save self.instance.save() File "/opt/netbox/netbox/dcim/models/cables.py", line 240, in save trace_paths.send(Cable, instance=self, created=_created) File "/opt/netbox/venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 176, in send return [ File "/opt/netbox/venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 177, in <listcomp> (receiver, receiver(signal=self, sender=sender, **named)) File "/opt/netbox/netbox/dcim/signals.py", line 98, in update_connected_endpoints create_cablepath(nodes) File "/opt/netbox/netbox/dcim/utils.py", line 43, in create_cablepath cp = CablePath.from_origin(terminations) File "/opt/netbox/netbox/dcim/models/cables.py", line 547, in from_origin assert all(t.parent_object == terminations[0].parent_object for t in terminations[1:]) AssertionError ```
Author
Owner

@jeffgdotorg commented on GitHub (May 20, 2024):

@ivanovuri have you had a chance to re-test this workflow in NetBox 4.0.x? We think there's a chance it got fixed as a side effect of other work, so before I mount a new effort to reproduce it, I thought I'd check with you.

@jeffgdotorg commented on GitHub (May 20, 2024): @ivanovuri have you had a chance to re-test this workflow in NetBox 4.0.x? We think there's a chance it got fixed as a side effect of other work, so before I mount a new effort to reproduce it, I thought I'd check with you.
Author
Owner

@maugli13 commented on GitHub (May 22, 2024):

This issue is reproducible in both 3.7.8 and 4.0.2 (used demo netbox)

The following scenario was tested:

  1. Created PatchPanel1.1 with two sets of Front ports, six ports in each related to 1 rear port with six positions. (Got PatchPanel with 12 front ports and two rear ports, six positions in each)
  2. Created PP2 with six front ports related to the rear port with six positions
  3. Created PP3 with six front ports related to the rear port with six positions
  4. Connected first rear port of PatchPanel1.1 to the rear port in PP2
  5. Connected second rear port of PatchPanel1.1 to the rear port in PP3

Intermediate result:

Screenshot 2024-05-21 at 15 06 24
  1. Created a switch and tried to connect the first port of the switch to multiple front ports on PatchPanel1.1 (see the screenshot below)
Screenshot 2024-05-21 at 15 08 04
  1. Clicked create and got the following error
Screenshot 2024-05-21 at 15 08 47
@maugli13 commented on GitHub (May 22, 2024): This issue is reproducible in both 3.7.8 and 4.0.2 (used demo netbox) The following scenario was tested: 1. Created PatchPanel1.1 with two sets of Front ports, six ports in each related to 1 rear port with six positions. (Got PatchPanel with 12 front ports and two rear ports, six positions in each) 2. Created PP2 with six front ports related to the rear port with six positions 3. Created PP3 with six front ports related to the rear port with six positions 4. Connected first rear port of PatchPanel1.1 to the rear port in PP2 5. Connected second rear port of PatchPanel1.1 to the rear port in PP3 Intermediate result: <img width="2080" alt="Screenshot 2024-05-21 at 15 06 24" src="https://github.com/netbox-community/netbox/assets/14159694/bab5cdac-89bb-48bc-b252-8970c67589b8"> 6. Created a switch and tried to connect the first port of the switch to multiple front ports on PatchPanel1.1 (see the screenshot below) <img width="772" alt="Screenshot 2024-05-21 at 15 08 04" src="https://github.com/netbox-community/netbox/assets/14159694/82ade1d9-33ef-42c3-a2d6-a6994d5869b2"> 7. Clicked create and got the following error <img width="718" alt="Screenshot 2024-05-21 at 15 08 47" src="https://github.com/netbox-community/netbox/assets/14159694/05971cfc-69ba-426d-be86-0f176f1039f6">
Author
Owner

@DanSheps commented on GitHub (May 29, 2024):

Double checking the code on this, the problem is here:

67165a9f91/netbox/dcim/models/cables.py (L548)

I don't thinkk this is really a bug (it is currently not supported to have different devices "mid-span" of a cable trace), but we should catch this assertion and report a proper error.

@DanSheps commented on GitHub (May 29, 2024): Double checking the code on this, the problem is here: https://github.com/netbox-community/netbox/blob/67165a9f9171d59afba582df7f881ca05b71e430/netbox/dcim/models/cables.py#L548 I don't thinkk this is really a bug (it is currently not supported to have different devices "mid-span" of a cable trace), but we should catch this assertion and report a proper error.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9186