Editing the cable via the API messes up connected_endpoints_reachable #10245

Closed
opened 2025-12-29 21:28:49 +01:00 by adam · 1 comment
Owner

Originally created by @tomasz-c on GitHub (Sep 13, 2024).

Deployment Type

Self-hosted

NetBox Version

v4.1.1

Python Version

3.12

Steps to Reproduce

Changing b_terminations, object_id to another from API sets connected_endpoints_reachable to False (for endpoint B)

  1. Create device 'Device1'
    1.1 Create PowerPort 'PSU0'
  2. Create device 'PDU1'
    2.1 Create PowerOutlets 'Outlet1', 'Outlet2'
  3. Create a power cable connecting PSU0 to Outlet1
  4. From the API level, edit the cable by changing Outlet1 to Outlet2
curl -X 'PATCH' \
  'https://demo.netbox.dev/api/dcim/cables/130/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-CSRFTOKEN: PJLgWsiQYTsVsuHKC1baamdme8kH9TdQF6r3Ib6CXZWLsrQ3Pu4rxvGKnzp38___' \
  -d '{
  "b_terminations": [
    {
      "object_type": "dcim.poweroutlet",
      "object_id": 170
    }
  ]
}'
  1. Check status Outlet2, for example: https://demo.netbox.dev/dcim/power-outlets/170/
    What we see:
    Connection: Path Status > Not Reachable
    via API:
    "connected_endpoints_reachable": null,
    Connection: Path Status > Not Reachable
    via API:
    "connected_endpoints_reachable": null,

image

But the cable is properly connected at both ends: https://demo.netbox.dev/dcim/cables/130/

image

The above situation does not occur if:

  • editing the cable through the browser,
  • the cable is created (not edited) by the API,

This bug is not new, it also occurs on version v3.7.8

I ran all tests on my Netbox instance, I used the demo only to demonstrate the issue.

Expected Behavior

Editing the cable via the API should work correctly, just like through the browser.

Observed Behavior

Editing the cable by API breaks “Status Connected” ('connected_endpoints_reachable`)

Originally created by @tomasz-c on GitHub (Sep 13, 2024). ### Deployment Type Self-hosted ### NetBox Version v4.1.1 ### Python Version 3.12 ### Steps to Reproduce Changing b_terminations, object_id to another from API sets connected_endpoints_reachable to False (for endpoint B) 1. Create device 'Device1' 1.1 Create PowerPort 'PSU0' 2. Create device 'PDU1' 2.1 Create PowerOutlets 'Outlet1', 'Outlet2' 3. Create a power cable connecting PSU0 to Outlet1 4. From the API level, edit the cable by changing Outlet1 to Outlet2 ```bash curl -X 'PATCH' \ 'https://demo.netbox.dev/api/dcim/cables/130/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H 'X-CSRFTOKEN: PJLgWsiQYTsVsuHKC1baamdme8kH9TdQF6r3Ib6CXZWLsrQ3Pu4rxvGKnzp38___' \ -d '{ "b_terminations": [ { "object_type": "dcim.poweroutlet", "object_id": 170 } ] }' ``` 5. Check status Outlet2, for example: https://demo.netbox.dev/dcim/power-outlets/170/ What we see: `Connection: Path Status > Not Reachable` via API: `"connected_endpoints_reachable": null,` `Connection: Path Status > Not Reachable` via API: `"connected_endpoints_reachable": null,` ![image](https://github.com/user-attachments/assets/23546fa9-daaa-4016-8092-38e0450c2e24) But the cable is properly connected at both ends: https://demo.netbox.dev/dcim/cables/130/ ![image](https://github.com/user-attachments/assets/bfd89fe1-e28a-402c-9577-0a3ca5b0c95b) The above situation does not occur if: - editing the cable through the browser, - the cable is created (not edited) by the API, This bug is not new, it also occurs on version v3.7.8 I ran all tests on my Netbox instance, I used the demo only to demonstrate the issue. ### Expected Behavior Editing the cable via the API should work correctly, just like through the browser. ### Observed Behavior Editing the cable by API breaks “Status Connected” ('connected_endpoints_reachable`)
adam added the type: bugnetboxtopic: cablingseverity: low labels 2025-12-29 21:28:49 +01:00
adam closed this issue 2025-12-29 21:28:49 +01:00
Author
Owner

@tomasz-c commented on GitHub (Feb 4, 2025):

It seems to be fixed in 4.1.11 and 4.2.0
Probably as a result of issue: https://github.com/netbox-community/netbox/issues/18263

I think this issue can be closed.

@tomasz-c commented on GitHub (Feb 4, 2025): It seems to be fixed in 4.1.11 and 4.2.0 Probably as a result of issue: https://github.com/netbox-community/netbox/issues/18263 I think this issue can be closed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10245