Deleting a connected port, interface or other connection on a device should not be possible if there's a connected cable #4333

Closed
opened 2025-12-29 18:34:51 +01:00 by adam · 19 comments
Owner

Originally created by @pobk on GitHub (Dec 4, 2020).

Environment

  • Python version: 3.7
  • NetBox version: 2.9.9

Proposed Functionality

Amend the deletion process for interfaces, and ports that prevents deletion of the interface/port if the port is bound.

The current "Disconnect" button and "Delete" button currently display the same UI with little variance, however, the delete button can be infinitely more destructive.

It should not be possible to delete a rear-port which is bound to front-ports that are bound to cables.

Use Case

The current UI allows for the following scenario:

  1. Create a patch panel device, e.g. 4U Panel Panel with 432 LC ports (modelling for example an extremely high density 4U modular patch bay with 12x 36 port LC cassettes)
  2. Create a Rear-port with 432 positions (to model a 432F cable termination into a patch panel)
  3. Create a Front port with the rear-port set to one of the 432F Rear-Port positions
  4. Connect multiple front-ports of the 432 patch panel to devices in the rack
  5. "Accidentally" click the "Delete" function, in place of the "Disconnect" button on the rear-port. Confirm the action, assuming you're disconnecting the cable from the rear-port given the difference between the two is "Delete cable" or "Delete port"...
  6. Watch in horror as 432F front-ports are also deleted as well as any connections made to each of the front-ports.
  7. Make appointment with family practitioner/GP for anxiety and work related stress

This behaviour is not intuitive at present. The deletion button and disconnect button are pictographs and fairly close proximity to each other.

Furthermore the difference between the confirmation dialogue for deleting a cable and deleting a port is virtually identical aside from "Cable" or "Port". This can be missed during the mass-update/deletion process.

The use case should be as follows:

  1. Create a patch panel device, e.g. 4U Panel Panel with 432 LC ports (modelling for example an extremely high density 4U modular patch bay with 12x 36 port LC cassettes)
  2. Create a Rear-port with 432 positions (to model a 432F cable termination into a patch panel)
  3. Create a Front port with the rear-port set to one of the 432F Rear-Port positions
  4. Connect multiple front-ports of the 432 patch panel to devices in the rack
  5. Clicking "Delete" function associated with a rear-port should display:
    1. an alternative deletion warning page which highlights which front-ports are also bound and that different confirmation mechanism be used to indicate that deletion of the rear-port will cascade the deletion of front-ports and cables in addition to the rear-port.
    2. an error noting that several of the front-ports are bound to cables and need to be disconnected first.

This should be expanded to include any interface, console port, power port or connection on a device. If it's connected to "something" then NetBox should either make it very obvious what other things will be affected or refuse to delete the object?

Database Changes

No database changes required.

External Dependencies

No external dependencies

Originally created by @pobk on GitHub (Dec 4, 2020). ### Environment * Python version: 3.7 * NetBox version: 2.9.9 ### Proposed Functionality Amend the deletion process for interfaces, and ports that prevents deletion of the interface/port if the port is bound. The current "Disconnect" button and "Delete" button currently display the same UI with little variance, however, the delete button can be infinitely more destructive. It should not be possible to delete a rear-port which is bound to front-ports that are bound to cables. ### Use Case The current UI allows for the following scenario: 1. Create a patch panel device, e.g. 4U Panel Panel with 432 LC ports (modelling for example an extremely high density 4U modular patch bay with 12x 36 port LC cassettes) 1. Create a Rear-port with 432 positions (to model a 432F cable termination into a patch panel) 1. Create a Front port with the rear-port set to one of the 432F Rear-Port positions 1. Connect multiple front-ports of the 432 patch panel to devices in the rack 1. "Accidentally" click the "Delete" function, in place of the "Disconnect" button on the rear-port. Confirm the action, assuming you're disconnecting the cable from the rear-port given the difference between the two is "Delete cable" or "Delete port"... 1. Watch in horror as 432F front-ports are also deleted as well as any connections made to each of the front-ports. 1. Make appointment with family practitioner/GP for anxiety and work related stress This behaviour is not intuitive at present. The deletion button and disconnect button are pictographs and fairly close proximity to each other. Furthermore the difference between the confirmation dialogue for deleting a cable and deleting a port is virtually identical aside from "Cable" or "Port". This can be missed during the mass-update/deletion process. The use case should be as follows: 1. Create a patch panel device, e.g. 4U Panel Panel with 432 LC ports (modelling for example an extremely high density 4U modular patch bay with 12x 36 port LC cassettes) 1. Create a Rear-port with 432 positions (to model a 432F cable termination into a patch panel) 1. Create a Front port with the rear-port set to one of the 432F Rear-Port positions 1. Connect multiple front-ports of the 432 patch panel to devices in the rack 1. Clicking "Delete" function associated with a rear-port should display: 1. an alternative deletion warning page which highlights which front-ports are also bound and that different confirmation mechanism be used to indicate that deletion of the rear-port will cascade the deletion of front-ports and cables in addition to the rear-port. 1. an error noting that several of the front-ports are bound to cables and need to be disconnected first. This should be expanded to include any interface, console port, power port or connection on a device. If it's connected to "something" then NetBox should either make it very obvious what other things will be affected or refuse to delete the object? ### Database Changes No database changes required. ### External Dependencies No external dependencies
adam added the type: featurepending closurestatus: under review labels 2025-12-29 18:34:51 +01:00
adam closed this issue 2025-12-29 18:34:51 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 4, 2020):

A delete confirmation is displayed and then actioned, which then deletes the cables.

This is the intended behavior. If you'd like to propose changing this behavior, please rewrite or resbumit your issue as a feature request citing your specific use case.

@jeremystretch commented on GitHub (Dec 4, 2020): > A delete confirmation is displayed and then actioned, which then deletes the cables. This is the intended behavior. If you'd like to propose changing this behavior, please rewrite or resbumit your issue as a [feature request](https://github.com/netbox-community/netbox/issues/new?template=feature_request.md) citing your specific use case.
Author
Owner

@pobk commented on GitHub (Dec 5, 2020):

Revised to feature request.

@pobk commented on GitHub (Dec 5, 2020): Revised to feature request.
Author
Owner

@Infiniverse commented on GitHub (Dec 5, 2020):

Should this be expanded to, deleting any port or interface should not be possible if there is a cable connected to it?

@Infiniverse commented on GitHub (Dec 5, 2020): Should this be expanded to, deleting any port or interface should not be possible if there is a cable connected to it?
Author
Owner

@pobk commented on GitHub (Dec 5, 2020):

Should this be expanded to, deleting any port or interface should not be possible if there is a cable connected to it?

Agreed. Have updated FR to include this on any connection made to a device, interface, ports, console, power etc...

@pobk commented on GitHub (Dec 5, 2020): > Should this be expanded to, deleting any port or interface should not be possible if there is a cable connected to it? Agreed. Have updated FR to include this on any connection made to a device, interface, ports, console, power etc...
Author
Owner

@jeremystretch commented on GitHub (Dec 8, 2020):

This will need to be addressed by the community, as I suspect there's a good number of people who rely on the current behavior.

@jeremystretch commented on GitHub (Dec 8, 2020): This will need to be addressed by the community, as I suspect there's a good number of people who rely on the current behavior.
Author
Owner

@pobk commented on GitHub (Dec 15, 2020):

I think the sticking point of this issue is that the confirmation page for deleting cables and a connections, look virtually identical.

Delete cable confirmation: https://pasteboard.co/JF3FFNT.png
Delete port confirmation: https://pasteboard.co/JF3G0OW.png

There's nothing immediately obvious in the UI to indicate that deletion of the port will also delete, ports, cables and interfaces and more possibly, in future. It's a lot more destructive.

I suspect the better option would be an alternative delete confirmation page, that way you're not breaking the work-flow, just reformatting it a little bit?

@pobk commented on GitHub (Dec 15, 2020): I think the sticking point of this issue is that the confirmation page for deleting cables and a connections, look virtually identical. Delete cable confirmation: [https://pasteboard.co/JF3FFNT.png](https://pasteboard.co/JF3FFNT.png) Delete port confirmation: [https://pasteboard.co/JF3G0OW.png](https://pasteboard.co/JF3G0OW.png) There's nothing immediately obvious in the UI to indicate that deletion of the port will also delete, ports, cables and interfaces and more possibly, in future. It's a lot more destructive. I suspect the better option would be an alternative delete confirmation page, that way you're not breaking the work-flow, just reformatting it a little bit?
Author
Owner

@TheTrafficNetwork commented on GitHub (Dec 15, 2020):

From my perspective, removing the cable before removing a port/interface/etc seems logical. If I were wanting to remove a module from a switch, I would in the majority of cases remove all of the cables first. I do not have anything that would break from this change so my views may be different than much more developed power users.

@TheTrafficNetwork commented on GitHub (Dec 15, 2020): From my perspective, removing the cable before removing a port/interface/etc seems logical. If I were wanting to remove a module from a switch, I would in the majority of cases remove all of the cables first. I do not have anything that would break from this change so my views may be different than much more developed power users.
Author
Owner

@stale[bot] commented on GitHub (Jan 30, 2021):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale[bot] commented on GitHub (Jan 30, 2021): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@pobk commented on GitHub (Feb 9, 2021):

So how does one get more input from the community on this to establish more of a consensus?

@pobk commented on GitHub (Feb 9, 2021): So how does one get more input from the community on this to establish more of a consensus?
Author
Owner

@pobk commented on GitHub (Mar 17, 2021):

Is there no more appetite for discussion here?

Is it worth putting together a PR for this?

@pobk commented on GitHub (Mar 17, 2021): Is there no more appetite for discussion here? Is it worth putting together a PR for this?
Author
Owner

@xkilian commented on GitHub (Mar 17, 2021):

I agree with the proposed changes.

As for NOT permitting the deletion of a port, I am more in agreement than disagreement. I think other power users should provide feedback to see if after a warning it should be allowed anyway.
Our current cabling management system REQUIRES that a cable be disconnected before removing a port.. Especially because a "connexion" is not just a single cable but may be formed of a number of cables spanning multiple rooms or sites and care must be taking to decomission paths and/or single connexions depending on the use-case. (Removal, move, reconfiguration, etc.)

@xkilian commented on GitHub (Mar 17, 2021): I agree with the proposed changes. As for NOT permitting the deletion of a port, I am more in agreement than disagreement. I think other power users should provide feedback to see if after a warning it should be allowed anyway. Our current cabling management system REQUIRES that a cable be disconnected before removing a port.. Especially because a "connexion" is not just a single cable but may be formed of a number of cables spanning multiple rooms or sites and care must be taking to decomission paths and/or single connexions depending on the use-case. (Removal, move, reconfiguration, etc.)
Author
Owner

@xkilian commented on GitHub (Mar 17, 2021):

I think a PR should be prepared for this, are you proposing to do the work? I any case, the current way of doing things is dangerous.
As Netbox matures, it is issues like these that are valuable to improve workflow quality. Small things, but important things.
Same as looking at it from a task based perspective:
Take the TOP THREE tasks someone does in a day in Netbox and evaluate what can be improved:

  • how is input done
  • validation of input
  • number of clicks to do the task
  • number of panel changes to do a task
  • complexity of data presented and interpreted to do the task
  • sources of error
  • sources of user frustration
  • intuitiveness of UI
  • consistancy of UI
  • performance
  • overall time mesure to do the task, etc.

Based on the evaluation, improving important use-cases will provide high value for the most users. :-)

@xkilian commented on GitHub (Mar 17, 2021): I think a PR should be prepared for this, are you proposing to do the work? I any case, the current way of doing things is dangerous. As Netbox matures, it is issues like these that are valuable to improve workflow quality. Small things, but important things. Same as looking at it from a task based perspective: Take the TOP THREE tasks someone does in a day in Netbox and evaluate what can be improved: - how is input done - validation of input - number of clicks to do the task - number of panel changes to do a task - complexity of data presented and interpreted to do the task - sources of error - sources of user frustration - intuitiveness of UI - consistancy of UI - performance - overall time mesure to do the task, etc. Based on the evaluation, improving important use-cases will provide high value for the most users. :-)
Author
Owner

@DanSheps commented on GitHub (Mar 17, 2021):

Here is my take on this:

It might be better to instead of making any sweeping changes to the current functionality, change the delete pages for every device to provide a list of "impacted" additional models. For example, if you are deleting a rear port, it should simply state:

"You are deleting this port. By deleting this port, the following will be deleted as well: <insert list>"

@DanSheps commented on GitHub (Mar 17, 2021): Here is my take on this: It might be better to instead of making any sweeping changes to the current functionality, change the delete pages for every device to provide a list of "impacted" additional models. For example, if you are deleting a rear port, it should simply state: "You are deleting this port. By deleting this port, the following will be deleted as well: \<insert list\>"
Author
Owner

@jeremystretch commented on GitHub (Mar 17, 2021):

I think a PR should be prepared for this

Per the contributing guide, please don't open a PR for an issue before it has been accepted.

@jeremystretch commented on GitHub (Mar 17, 2021): > I think a PR should be prepared for this Per the contributing guide, please don't open a PR for an issue before it has been accepted.
Author
Owner

@xkilian commented on GitHub (Mar 17, 2021):

Oups, yes of course, this should be an accepted issue before submitting an PR.

@xkilian commented on GitHub (Mar 17, 2021): Oups, yes of course, this should be an accepted issue before submitting an PR.
Author
Owner

@pobk commented on GitHub (Apr 21, 2021):

It might be better to instead of making any sweeping changes to the current functionality, change the delete pages for every device to provide a list of "impacted" additional models. For example, if you are deleting a rear port, it should simply state:

"You are deleting this port. By deleting this port, the following will be deleted as well: "

This is the approach I was thinking of taking... Rather than simply looking like every other delete page in NetBox, adjust the delete template to communicate the complexity of the deletion... What else is going to be nuked. The sentiment being: if we communicate the changes to be made is a different way, someone might stop and identify the change as something they don't want to do.

The danger of the current generic approach, is that it looks like every other delete page, and users should strongly be urged to look at what they're deleting when it comes to read-ports, since it deletes more than is immediately obvious.

@pobk commented on GitHub (Apr 21, 2021): > It might be better to instead of making any sweeping changes to the current functionality, change the delete pages for every device to provide a list of "impacted" additional models. For example, if you are deleting a rear port, it should simply state: > > "You are deleting this port. By deleting this port, the following will be deleted as well: <insert list>" This is the approach I was thinking of taking... Rather than simply looking like every other delete page in NetBox, adjust the delete template to communicate the complexity of the deletion... What else is going to be nuked. The sentiment being: if we communicate the changes to be made is a different way, someone might stop and identify the change as something they don't want to do. The danger of the current generic approach, is that it looks like every other delete page, and users should strongly be urged to look at what they're deleting when it comes to read-ports, since it deletes more than is immediately obvious.
Author
Owner

@pobk commented on GitHub (Apr 21, 2021):

@jeremystretch should I adjust the FR in line with current discussion... Re-define it as a change to templates rather than change to process?

Would that be more palatable?

@pobk commented on GitHub (Apr 21, 2021): @jeremystretch should I adjust the FR in line with current discussion... Re-define it as a change to templates rather than change to process? Would that be more palatable?
Author
Owner

@github-actions[bot] commented on GitHub (Jun 21, 2021):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Jun 21, 2021): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Jul 21, 2021):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Jul 21, 2021): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4333