Validation error when adding a new cable #6661

Closed
opened 2025-12-29 19:43:37 +01:00 by adam · 5 comments
Owner

Originally created by @DanSheps on GitHub (Jul 14, 2022).

NetBox version

3.3.0-beta1

Python version

3.10

Steps to Reproduce

  1. Create a site ("Test")
  2. Create a manufacturer ("Panduit")
  3. Create a manufacturer ("Cisco")
  4. Create a device type ("C9200-48T") with "Cisco" manufacturer
  5. Create a device type ("Patch Panel") with "Panduit" manufacturer
  6. Add (1) 12 position rear port to "Patch Panel"
  7. Add (12) front ports to "Patch Panel"
  8. Add (48) 1000base-t interfaces to "C9200-48T"
  9. Create a device role ("Access Switch")
  10. Create a device role ("Fiber Patch Panel")
  11. Create (2) devices of type "Patch Panel" ("P1", "P2") in site "Test" with role "Fiber Patch Panel"
  12. Create (2) devices of type "C9200-48T" ("S1", "S2") in site "Test" with role "Access Switch"
  13. On "Patch Panel", attempt to connect rear-port on P1 to rear-port on P2

Expected Behavior

Cable created successfully

Observed Behavior

"Must define A and B terminations when creating a new cable."

Originally created by @DanSheps on GitHub (Jul 14, 2022). ### NetBox version 3.3.0-beta1 ### Python version 3.10 ### Steps to Reproduce 1. Create a site ("Test") 2. Create a manufacturer ("Panduit") 3. Create a manufacturer ("Cisco") 4. Create a device type ("C9200-48T") with "Cisco" manufacturer 5. Create a device type ("Patch Panel") with "Panduit" manufacturer 6. Add (1) 12 position rear port to "Patch Panel" 7. Add (12) front ports to "Patch Panel" 8. Add (48) 1000base-t interfaces to "C9200-48T" 9. Create a device role ("Access Switch") 10. Create a device role ("Fiber Patch Panel") 11. Create (2) devices of type "Patch Panel" ("P1", "P2") in site "Test" with role "Fiber Patch Panel" 12. Create (2) devices of type "C9200-48T" ("S1", "S2") in site "Test" with role "Access Switch" 13. On "Patch Panel", attempt to connect rear-port on P1 to rear-port on P2 ### Expected Behavior Cable created successfully ### Observed Behavior "Must define A and B terminations when creating a new cable."
adam added the type: bugstatus: acceptedbeta labels 2025-12-29 19:43:37 +01:00
adam closed this issue 2025-12-29 19:43:37 +01:00
Author
Owner

@DanSheps commented on GitHub (Jul 14, 2022):

The error is throw in:

868e94fb73/netbox/dcim/models/cables.py (L149)

Because this is in clean() instead of save, the instance terminations must be set in clean() on the form instead of save() as below:

868e94fb73/netbox/dcim/forms/connections.py (L163-L169)

@DanSheps commented on GitHub (Jul 14, 2022): The error is throw in: https://github.com/netbox-community/netbox/blob/868e94fb730e24e174abba13a77cdef32c619e6e/netbox/dcim/models/cables.py#L149 Because this is in clean() instead of save, the instance terminations must be set in clean() on the form instead of save() as below: https://github.com/netbox-community/netbox/blob/868e94fb730e24e174abba13a77cdef32c619e6e/netbox/dcim/forms/connections.py#L163-L169
Author
Owner

@DanSheps commented on GitHub (Jul 14, 2022):

Another thing of note, this may also impact elsewhere (API, etc), I only currently looked quickly at the form.

@DanSheps commented on GitHub (Jul 14, 2022): Another thing of note, this may also impact elsewhere (API, etc), I only currently looked quickly at the form.
Author
Owner

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

Was there a need to create the switches as well? They don't appear to have any effect on the reported behavior.

@jeremystretch commented on GitHub (Jul 18, 2022): Was there a need to create the switches as well? They don't appear to have any effect on the reported behavior.
Author
Owner

@DanSheps commented on GitHub (Jul 18, 2022):

Was there a need to create the switches as well? They don't appear to have any effect on the reported behavior.

I was originally reproducing the other bug, and hit this one. The switch is not required, sorry.

@DanSheps commented on GitHub (Jul 18, 2022): > Was there a need to create the switches as well? They don't appear to have any effect on the reported behavior. I was originally reproducing the other bug, and hit this one. The switch is not required, sorry.
Author
Owner

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

Thanks @mzbroch!

@jeremystretch commented on GitHub (Jul 18, 2022): Thanks @mzbroch!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6661