Cable Trace for interface terminated on circuit not working #6693

Closed
opened 2025-12-29 19:44:02 +01:00 by adam · 8 comments
Owner

Originally created by @jaylik on GitHub (Jul 20, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.3-beta1

Python version

3.9

Steps to Reproduce

  1. Create circuit
  2. Create router with interface
  3. Terminate circuit on router interface
  4. Try to run Cable Trace

Expected Behavior

Tracing should work like in v3.2.6

Observed Behavior

Trace returns empty.

Originally created by @jaylik on GitHub (Jul 20, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.3-beta1 ### Python version 3.9 ### Steps to Reproduce 1. Create circuit 2. Create router with interface 3. Terminate circuit on router interface 4. Try to run Cable Trace ### Expected Behavior Tracing should work like in v3.2.6 ### Observed Behavior Trace returns empty.
adam added the type: bugstatus: acceptedbeta labels 2025-12-29 19:44:02 +01:00
adam closed this issue 2025-12-29 19:44:02 +01:00
Author
Owner

@jaylik commented on GitHub (Jul 20, 2022):

Also throws,

Traceback (most recent call last):
  File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/rest_framework/viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/netbox/netbox/netbox/api/viewsets/__init__.py", line 117, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/opt/netbox/netbox/dcim/api/views.py", line 63, in trace
    return HttpResponse(drawing.render().tostring(), content_type='image/svg+xml')
  File "/opt/netbox/netbox/dcim/svg/cables.py", line 366, in render
    self.draw_terminations(far_ends)
  File "/opt/netbox/netbox/dcim/svg/cables.py", line 200, in draw_terminations
    width = self.width / len(terminations)

Exception Type: ZeroDivisionError at /api/dcim/interfaces/496/trace/
Exception Value: division by zero
@jaylik commented on GitHub (Jul 20, 2022): Also throws, ``` Traceback (most recent call last): File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/rest_framework/viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) File "/opt/netbox/netbox/netbox/api/viewsets/__init__.py", line 117, in dispatch return super().dispatch(request, *args, **kwargs) File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch response = self.handle_exception(exc) File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception self.raise_uncaught_exception(exc) File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception raise exc File "/opt/netbox-3.3-beta0e18292/venv/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch response = handler(request, *args, **kwargs) File "/opt/netbox/netbox/dcim/api/views.py", line 63, in trace return HttpResponse(drawing.render().tostring(), content_type='image/svg+xml') File "/opt/netbox/netbox/dcim/svg/cables.py", line 366, in render self.draw_terminations(far_ends) File "/opt/netbox/netbox/dcim/svg/cables.py", line 200, in draw_terminations width = self.width / len(terminations) Exception Type: ZeroDivisionError at /api/dcim/interfaces/496/trace/ Exception Value: division by zero ```
Author
Owner

@AllenEllis commented on GitHub (Jul 21, 2022):

I tried to recreate this just now but was unable to. I believe I followed your steps to reproduce correctly but please let me know if/what I missed. I tried terminating on both A and Z sides.

Screenshots showing my result:

Cable Trace:
Screen Shot 2022-07-20 at 7 00 40 PM

Circuit:
Screen Shot 2022-07-20 at 7 00 34 PM

Interface:
Screen Shot 2022-07-20 at 7 28 09 PM

Cable:
Screen Shot 2022-07-20 at 7 27 51 PM

The data that I entered for this test in case it is relevant:
circuits.json.txt
dcim.json.txt

@AllenEllis commented on GitHub (Jul 21, 2022): I tried to recreate this just now but was unable to. I believe I followed your steps to reproduce correctly but please let me know if/what I missed. I tried terminating on both A and Z sides. Screenshots showing my result: Cable Trace: <img width="1396" alt="Screen Shot 2022-07-20 at 7 00 40 PM" src="https://user-images.githubusercontent.com/13372560/180116454-83892f55-34ba-4239-b132-0ee8e8beaaa1.png"> Circuit: <img width="1396" alt="Screen Shot 2022-07-20 at 7 00 34 PM" src="https://user-images.githubusercontent.com/13372560/180116468-d7c54620-96a6-4e34-b701-bc1a97d6efec.png"> Interface: <img width="1370" alt="Screen Shot 2022-07-20 at 7 28 09 PM" src="https://user-images.githubusercontent.com/13372560/180116957-a2b729f0-329d-431f-b139-37d52c5b2617.png"> Cable: <img width="1419" alt="Screen Shot 2022-07-20 at 7 27 51 PM" src="https://user-images.githubusercontent.com/13372560/180116988-d81c22ce-3cd6-431b-a67f-d3667de96650.png"> The data that I entered for this test in case it is relevant: [circuits.json.txt](https://github.com/netbox-community/netbox/files/9155685/circuits.json.txt) [dcim.json.txt](https://github.com/netbox-community/netbox/files/9155686/dcim.json.txt)
Author
Owner

@jaylik commented on GitHub (Jul 21, 2022):

I tried to recreate this just now but was unable to. I believe I followed your steps to reproduce correctly but please let me know if/what I missed. I tried terminating on both A and Z sides.

Could you test if trace is working when you add A side provider network and connect interface to Z side?

@jaylik commented on GitHub (Jul 21, 2022): > I tried to recreate this just now but was unable to. I believe I followed your steps to reproduce correctly but please let me know if/what I missed. I tried terminating on both A and Z sides. Could you test if trace is working when you add A side provider network and connect interface to Z side?
Author
Owner

@jeremystretch commented on GitHub (Jul 25, 2022):

I'm also unable to replicate this in the current feature branch. It's likely that the bug has already been resolved by other work since the release of v3.3-beta1. Please see if you're able to reproduce the behavior under the feature branch, and if so, we can re-open this. Thanks!

@jeremystretch commented on GitHub (Jul 25, 2022): I'm also unable to replicate this in the current `feature` branch. It's likely that the bug has already been resolved by other work since the release of v3.3-beta1. Please see if you're able to reproduce the behavior under the `feature` branch, and if so, we can re-open this. Thanks!
Author
Owner

@jaylik commented on GitHub (Jul 27, 2022):

@jeremystretch - Please re-open, i will post PR to fix this.

@jaylik commented on GitHub (Jul 27, 2022): @jeremystretch - Please re-open, i will post PR to fix this.
Author
Owner

@jeremystretch commented on GitHub (Jul 27, 2022):

@jaylik you'll need to provide steps to reproduce first, please. We will only review PRs for accepted issues.

@jeremystretch commented on GitHub (Jul 27, 2022): @jaylik you'll need to provide steps to reproduce first, please. We will only review PRs for accepted issues.
Author
Owner

@jaylik commented on GitHub (Jul 27, 2022):

@jeremystretch - Check below. @AllenEllis screenshots show that only A or Z termination was connected at the same time. When both terminations are connected at the same time SVG tracing stops working.

  1. Tested with feature /a6be8dc
  2. Create site, device type & device with single interface
  3. Create Provider & Provider network
  4. Crete Circuit Type & Circuit
  5. Add Circuit Termination A to created provider network
  6. Add Circuit Termination Z to device site
  7. Connect Circuit Termination Z to device interface
  8. Run trace for interface that has this circuit attached

Throws,

[27/Jul/2022 15:51:04] "GET /dcim/interfaces/669/trace/ HTTP/1.1" 200 97876
Internal Server Error: /api/dcim/interfaces/669/trace/
Traceback (most recent call last):
  File "C:\work\git\netbox\venv\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
  File "C:\work\git\netbox\venv\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\work\git\netbox\venv\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
  File "C:\work\git\netbox\netbox\netbox\api\viewsets\__init__.py", line 118, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 480, in raise_uncaught_exception
    raise exc
  File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "C:\work\git\netbox\netbox\dcim\api\views.py", line 64, in trace
    return HttpResponse(drawing.render().tostring(), content_type='image/svg+xml')
  File "C:\work\git\netbox\netbox\dcim\svg\cables.py", line 366, in render
    self.draw_terminations(far_ends)
  File "C:\work\git\netbox\netbox\dcim\svg\cables.py", line 200, in draw_terminations
    width = self.width / len(terminations)
ZeroDivisionError: division by zero
Internal Server Error: /api/dcim/interfaces/669/trace/
Traceback (most recent call last):
  File "C:\work\git\netbox\venv\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
  File "C:\work\git\netbox\venv\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\work\git\netbox\venv\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
  File "C:\work\git\netbox\netbox\netbox\api\viewsets\__init__.py", line 118, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 480, in raise_uncaught_exception
    raise exc
  File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "C:\work\git\netbox\netbox\dcim\api\views.py", line 64, in trace
    return HttpResponse(drawing.render().tostring(), content_type='image/svg+xml')
  File "C:\work\git\netbox\netbox\dcim\svg\cables.py", line 366, in render
    self.draw_terminations(far_ends)
  File "C:\work\git\netbox\netbox\dcim\svg\cables.py", line 200, in draw_terminations
    width = self.width / len(terminations)
ZeroDivisionError: division by zero
@jaylik commented on GitHub (Jul 27, 2022): @jeremystretch - Check below. @AllenEllis screenshots show that only A or Z termination was connected at the same time. When **both** terminations are connected at the same time SVG tracing stops working. 1. Tested with [feature /a6be8dc ](https://github.com/netbox-community/netbox/tree/a6be8dccf55726ddd1c9a8319f4a162c43023fa0) 2. Create site, device type & device with single interface 3. Create Provider & Provider network 4. Crete Circuit Type & Circuit 5. Add Circuit Termination A to created provider network 6. Add Circuit Termination Z to device site 7. Connect Circuit Termination Z to device interface 8. Run trace for interface that has this circuit attached Throws, ``` [27/Jul/2022 15:51:04] "GET /dcim/interfaces/669/trace/ HTTP/1.1" 200 97876 Internal Server Error: /api/dcim/interfaces/669/trace/ Traceback (most recent call last): File "C:\work\git\netbox\venv\lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) File "C:\work\git\netbox\venv\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\work\git\netbox\venv\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) File "C:\work\git\netbox\netbox\netbox\api\viewsets\__init__.py", line 118, in dispatch return super().dispatch(request, *args, **kwargs) File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 509, in dispatch response = self.handle_exception(exc) File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 469, in handle_exception self.raise_uncaught_exception(exc) File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 480, in raise_uncaught_exception raise exc File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 506, in dispatch response = handler(request, *args, **kwargs) File "C:\work\git\netbox\netbox\dcim\api\views.py", line 64, in trace return HttpResponse(drawing.render().tostring(), content_type='image/svg+xml') File "C:\work\git\netbox\netbox\dcim\svg\cables.py", line 366, in render self.draw_terminations(far_ends) File "C:\work\git\netbox\netbox\dcim\svg\cables.py", line 200, in draw_terminations width = self.width / len(terminations) ZeroDivisionError: division by zero Internal Server Error: /api/dcim/interfaces/669/trace/ Traceback (most recent call last): File "C:\work\git\netbox\venv\lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) File "C:\work\git\netbox\venv\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\work\git\netbox\venv\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\viewsets.py", line 125, in view return self.dispatch(request, *args, **kwargs) File "C:\work\git\netbox\netbox\netbox\api\viewsets\__init__.py", line 118, in dispatch return super().dispatch(request, *args, **kwargs) File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 509, in dispatch response = self.handle_exception(exc) File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 469, in handle_exception self.raise_uncaught_exception(exc) File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 480, in raise_uncaught_exception raise exc File "C:\work\git\netbox\venv\lib\site-packages\rest_framework\views.py", line 506, in dispatch response = handler(request, *args, **kwargs) File "C:\work\git\netbox\netbox\dcim\api\views.py", line 64, in trace return HttpResponse(drawing.render().tostring(), content_type='image/svg+xml') File "C:\work\git\netbox\netbox\dcim\svg\cables.py", line 366, in render self.draw_terminations(far_ends) File "C:\work\git\netbox\netbox\dcim\svg\cables.py", line 200, in draw_terminations width = self.width / len(terminations) ZeroDivisionError: division by zero ```
Author
Owner

@jeremystretch commented on GitHub (Aug 1, 2022):

@jaylik thanks for providing the necessary reproduction steps!

@jeremystretch commented on GitHub (Aug 1, 2022): @jaylik thanks for providing the necessary reproduction steps!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6693