Changing Interface on a cable throws an error. #59

Closed
opened 2026-04-05 16:21:23 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @kollross on 3/27/2026

NetBox Edition

NetBox Community

NetBox Version

v4.5.5

Python Version

3.12

Steps to Reproduce

  1. Edit and existing cable between a Front port and Interface.
  2. Change the Interface name on one side of the cable.
  3. Click save.

The following Error appears.

Image
  1. Using the back arrow in your browser to go back to the edit page, click cancel.
  2. You will find that the Interface was actually updated to the new interface.
Error log:
2026-03-27 12:35:16,010 netbox.views.ObjectEditView INFO: Modified cable #11571 (PK: 11571)
2026-03-27 12:35:16,035 django.request ERROR: Internal Server Error: /dcim/cables/11571/edit/
Traceback (most recent call last):
  File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/django/db/models/fields/related_descriptors.py", line 243, in __get__
    rel_obj = self.field.get_cached_value(instance)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/django/db/models/fields/mixins.py", line 37, in get_cached_value
    return instance._state.fields_cache[self.cache_name]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: '_path'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/netbox/netbox/middleware.py", line 40, in __call__
    with apply_request_processors(request):
  File "/usr/lib/python3.12/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/opt/netbox/netbox/utilities/request.py", line 113, in apply_request_processors
    with ExitStack() as stack:
  File "/usr/lib/python3.12/contextlib.py", line 610, in __exit__
    raise exc_details[1]
  File "/usr/lib/python3.12/contextlib.py", line 595, in __exit__
    if cb(*exc_details):
       ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/opt/netbox/netbox/netbox/context_managers.py", line 26, in event_tracking
    flush_events(events)
  File "/opt/netbox/netbox/extras/events.py", line 246, in flush_events
    func(events)
  File "/opt/netbox/netbox/extras/events.py", line 231, in process_event_queue
    process_event_rules(
  File "/opt/netbox/netbox/extras/events.py", line 133, in process_event_rules
    if not event_rule.eval_conditions(event['data']):
                                      ~~~~~^^^^^^^^
  File "/opt/netbox/netbox/extras/events.py", line 36, in __getitem__
    data = serialize_for_event(self['object'])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/netbox/extras/events.py", line 51, in serialize_for_event
    return serializer.data
           ^^^^^^^^^^^^^^^
  File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/rest_framework/serializers.py", line 573, in data
    ret = super().data
          ^^^^^^^^^^^^
  File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/rest_framework/serializers.py", line 251, in data
    self._data = self.to_representation(self.instance)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/rest_framework/serializers.py", line 540, in to_representation
    ret[field.field_name] = field.to_representation(attribute)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/rest_framework/fields.py", line 1870, in to_representation
    return method(value)
           ^^^^^^^^^^^^^
  File "/opt/netbox/netbox/dcim/api/serializers_/base.py", line 33, in get_connected_endpoints
    if endpoints := obj.connected_endpoints:
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/netbox/dcim/models/device_components.py", line 1102, in connected_endpoints
    return super().connected_endpoints
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/netbox/dcim/models/device_components.py", line 358, in connected_endpoints
    return self._path.destinations if self._path else []
                                      ^^^^^^^^^^
  File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/django/db/models/fields/related_descriptors.py", line 261, in __get__
    rel_obj = self.get_object(instance)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/django/db/models/fields/related_descriptors.py", line 224, in get_object
    return qs.get(self.field.get_reverse_related_filter(instance))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/django/db/models/query.py", line 635, in get
    raise self.model.DoesNotExist(
dcim.models.cables.CablePath.DoesNotExist: CablePath matching query does not exist.

This is somehow related to an Event Rule I have created. Here is the json of Event Rule I have. Disabling the rule results in normal operation:

{
    "id": 1,
    "url": "https://netbox.domain.com/api/extras/event-rules/1/",
    "display_url": "https://netbox.domain.com/extras/event-rules/1/",
    "display": "interface_description",
    "object_types": [
        "dcim.interface"
    ],
    "name": "interface_description",
    "enabled": true,
    "event_types": [
        "object_created",
        "object_updated",
        "object_deleted"
    ],
    "conditions": null,
    "action_type": {
        "value": "webhook",
        "label": "Webhook"
    },
    "action_object_type": "extras.webhook",
    "action_object_id": 3,
    "action_object": {
        "id": 3,
        "url": "https://netbox.domain.com/api/extras/webhooks/3/",
        "display": "interface_description",
        "name": "interface_description",
        "description": "Update network equipment interface descriptions."
    },
    "description": "",
    "custom_fields": {},
    "owner": null,
    "tags": [],
    "created": "2024-01-04T09:03:58.920728-06:00",
    "last_updated": "2026-03-27T12:26:35.816745-05:00"
}

Expected Behavior

No error message an updated Interface

Observed Behavior

The above posted error message.

*Originally created by @kollross on 3/27/2026* ### NetBox Edition NetBox Community ### NetBox Version v4.5.5 ### Python Version 3.12 ### Steps to Reproduce 1. Edit and existing cable between a Front port and Interface. 2. Change the Interface name on one side of the cable. 3. Click save. The following Error appears. <img width="939" height="463" alt="Image" src="https://github.com/user-attachments/assets/d70215df-3c32-4bc5-ad4b-5617c343ea80" /> 4. Using the back arrow in your browser to go back to the edit page, click cancel. 5. You will find that the Interface was actually updated to the new interface. ``` Error log: 2026-03-27 12:35:16,010 netbox.views.ObjectEditView INFO: Modified cable #11571 (PK: 11571) 2026-03-27 12:35:16,035 django.request ERROR: Internal Server Error: /dcim/cables/11571/edit/ Traceback (most recent call last): File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/django/db/models/fields/related_descriptors.py", line 243, in __get__ rel_obj = self.field.get_cached_value(instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/django/db/models/fields/mixins.py", line 37, in get_cached_value return instance._state.fields_cache[self.cache_name] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ KeyError: '_path' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/netbox/netbox/middleware.py", line 40, in __call__ with apply_request_processors(request): File "/usr/lib/python3.12/contextlib.py", line 144, in __exit__ next(self.gen) File "/opt/netbox/netbox/utilities/request.py", line 113, in apply_request_processors with ExitStack() as stack: File "/usr/lib/python3.12/contextlib.py", line 610, in __exit__ raise exc_details[1] File "/usr/lib/python3.12/contextlib.py", line 595, in __exit__ if cb(*exc_details): ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/contextlib.py", line 144, in __exit__ next(self.gen) File "/opt/netbox/netbox/netbox/context_managers.py", line 26, in event_tracking flush_events(events) File "/opt/netbox/netbox/extras/events.py", line 246, in flush_events func(events) File "/opt/netbox/netbox/extras/events.py", line 231, in process_event_queue process_event_rules( File "/opt/netbox/netbox/extras/events.py", line 133, in process_event_rules if not event_rule.eval_conditions(event['data']): ~~~~~^^^^^^^^ File "/opt/netbox/netbox/extras/events.py", line 36, in __getitem__ data = serialize_for_event(self['object']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/netbox/extras/events.py", line 51, in serialize_for_event return serializer.data ^^^^^^^^^^^^^^^ File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/rest_framework/serializers.py", line 573, in data ret = super().data ^^^^^^^^^^^^ File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/rest_framework/serializers.py", line 251, in data self._data = self.to_representation(self.instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/rest_framework/serializers.py", line 540, in to_representation ret[field.field_name] = field.to_representation(attribute) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/rest_framework/fields.py", line 1870, in to_representation return method(value) ^^^^^^^^^^^^^ File "/opt/netbox/netbox/dcim/api/serializers_/base.py", line 33, in get_connected_endpoints if endpoints := obj.connected_endpoints: ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/functools.py", line 995, in __get__ val = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/netbox/dcim/models/device_components.py", line 1102, in connected_endpoints return super().connected_endpoints ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/functools.py", line 995, in __get__ val = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/netbox/dcim/models/device_components.py", line 358, in connected_endpoints return self._path.destinations if self._path else [] ^^^^^^^^^^ File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/django/db/models/fields/related_descriptors.py", line 261, in __get__ rel_obj = self.get_object(instance) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/django/db/models/fields/related_descriptors.py", line 224, in get_object return qs.get(self.field.get_reverse_related_filter(instance)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox-4.5.5/venv/lib/python3.12/site-packages/django/db/models/query.py", line 635, in get raise self.model.DoesNotExist( dcim.models.cables.CablePath.DoesNotExist: CablePath matching query does not exist. ``` This is somehow related to an Event Rule I have created. Here is the json of Event Rule I have. Disabling the rule results in normal operation: ``` { "id": 1, "url": "https://netbox.domain.com/api/extras/event-rules/1/", "display_url": "https://netbox.domain.com/extras/event-rules/1/", "display": "interface_description", "object_types": [ "dcim.interface" ], "name": "interface_description", "enabled": true, "event_types": [ "object_created", "object_updated", "object_deleted" ], "conditions": null, "action_type": { "value": "webhook", "label": "Webhook" }, "action_object_type": "extras.webhook", "action_object_id": 3, "action_object": { "id": 3, "url": "https://netbox.domain.com/api/extras/webhooks/3/", "display": "interface_description", "name": "interface_description", "description": "Update network equipment interface descriptions." }, "description": "", "custom_fields": {}, "owner": null, "tags": [], "created": "2024-01-04T09:03:58.920728-06:00", "last_updated": "2026-03-27T12:26:35.816745-05:00" } ``` ### Expected Behavior No error message an updated Interface ### Observed Behavior The above posted error message.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#59