Skip to content

An IndexError exception can be raised if stale cable paths exist #21524

@jeremystretch

Description

@jeremystretch

NetBox Edition

NetBox Community

NetBox Version

v4.5.3

Python Version

3.12

Steps to Reproduce

In a scenario where stale cable paths exist, an IndexError exception may be raised. For example, this may occur when querying for /api/circuits/circuit-terminations/<id>/paths/. This is because the get_path() method on CablePathSerializer assumes that every set of nodes within path_objects will have at least one node.

(Stale cable paths should be removed automatically, preventing this scenario, but we have observed it in production.)

Expected Behavior

Invalid paths should be silently ignored.

Observed Behavior

An IndexError exception is raised.

Metadata

Metadata

Assignees

Labels

netboxseverity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions