Cable connection fails if Rack value is deleted and only uses Site and Device values #3290

Closed
opened 2025-12-29 18:27:27 +01:00 by adam · 2 comments
Owner

Originally created by @JerradGit on GitHub (Feb 6, 2020).

Environment

  • Python version: 3.6.9
  • NetBox version: 2.7.4

Steps to Reproduce

  1. Select any Device which has a Front Port, Rear Port, Interface, or Console Port
  2. Connect a cable (Front Port, Rear Port, Interface, or Console Server Port) it doesn't matter
  3. When the connection window displays, on the B Side, remove the auto populated rack name so that only the Site field remains populated
  4. Choose a device from the Device drop down
  5. Make a selection from the Name field to connect this cable to
  6. Click on Connect

Expected Behavior

I expect a new cable to be created and be returned back to the device page with the Created cable notification

Observed Behavior

An error message is returned to the UI with the message "Select a valid choice. That choice is not one of the available choices." directly below the Device field.

Before clicking Connect
image

After Clicking Connect
image

If I follow the same steps, but also delete the auto populated Site name in addition to the rack name the procedure works as expected.
image
image

If on the other hand you know which rack the device is in and select that rack first before selecting the Device it also works.

There are two old issues which I think are related to this
#3999
#3310

3310 automatically populates Site/Rack name now, so any time you need to connect a cable to a device which isn't in the same rack you need to delete the rack or choose a different one before the Device field will present values to choose from which is how I discovered this.

Originally created by @JerradGit on GitHub (Feb 6, 2020). ### Environment * Python version: 3.6.9 * NetBox version: 2.7.4 ### Steps to Reproduce 1. Select any Device which has a Front Port, Rear Port, Interface, or Console Port 2. Connect a cable (Front Port, Rear Port, Interface, or Console Server Port) it doesn't matter 3. When the connection window displays, on the B Side, remove the auto populated rack name so that only the Site field remains populated 4. Choose a device from the Device drop down 5. Make a selection from the Name field to connect this cable to 6. Click on Connect <!-- What did you expect to happen? --> ### Expected Behavior I expect a new cable to be created and be returned back to the device page with the Created cable notification <!-- What happened instead? --> ### Observed Behavior An error message is returned to the UI with the message **"Select a valid choice. That choice is not one of the available choices."** directly below the Device field. Before clicking Connect ![image](https://user-images.githubusercontent.com/11369530/73969544-3f982b00-48e1-11ea-90a9-1989d0e927b6.png) After Clicking Connect ![image](https://user-images.githubusercontent.com/11369530/73969491-21cac600-48e1-11ea-9c3b-c9a79d4419f1.png) If I follow the same steps, but also delete the auto populated Site name in addition to the rack name the procedure works as expected. ![image](https://user-images.githubusercontent.com/11369530/73970735-4162ee00-48e3-11ea-9cde-d068ade727e5.png) ![image](https://user-images.githubusercontent.com/11369530/73971334-4ffdd500-48e4-11ea-8dda-6235a681646e.png) If on the other hand you know which rack the device is in and select that rack first before selecting the Device it also works. There are two old issues which I think are related to this [#3999](https://github.com/netbox-community/netbox/issues/3999) [#3310](https://github.com/netbox-community/netbox/issues/3310) 3310 automatically populates Site/Rack name now, so any time you need to connect a cable to a device which isn't in the same rack you need to delete the rack or choose a different one before the Device field will present values to choose from which is how I discovered this.
adam closed this issue 2025-12-29 18:27:27 +01:00
Author
Owner

@hSaria commented on GitHub (Feb 10, 2020):

This is fixed indirectly with #3912.

@hSaria commented on GitHub (Feb 10, 2020): This is fixed indirectly with #3912.
Author
Owner

@jeremystretch commented on GitHub (Feb 11, 2020):

Just merged a PR for #3912 and I can confirm that this is no longer a problem. It will be resolved in v2.7.5.

@jeremystretch commented on GitHub (Feb 11, 2020): Just merged a PR for #3912 and I can confirm that this is no longer a problem. It will be resolved in v2.7.5.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3290