Creating a Connection Fails if the Site is Specified Without the Rack #2459

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

Originally created by @hSaria on GitHub (Mar 13, 2019).

  • Python version: 3.6.6
  • NetBox version: 2.5.8

Steps to Reproduce

  1. Go to the connection creation page (go to device, click the connect button on an interface)
  2. On the B Side, click on the Select tab
  3. Specify the site, device, type, and name, like the screenshot below (don't specify the rack)
  4. It will fail because the rack was not specified, though the error will be on the Device field and it will say "Select a valid choice. That choice is not one of the available choices."

image

Expected Behavior

Only the device/type/name tuple are required for creating a connection. The site and rack fields are only there to filter the list of available devices.

Observed Behavior

Connection creation fails because the site was specified without the rack. Note that if you don't specify the site nor the rack, it works fine.

Originally created by @hSaria on GitHub (Mar 13, 2019). * Python version: 3.6.6 * NetBox version: 2.5.8 ### Steps to Reproduce 1. Go to the connection creation page (go to device, click the connect button on an interface) 2. On the B Side, click on the `Select` tab 3. Specify the site, device, type, and name, like the screenshot below (don't specify the rack) 4. It will fail because the rack was not specified, though the error will be on the Device field and it will say "Select a valid choice. That choice is not one of the available choices." ![image](https://user-images.githubusercontent.com/34197532/54265733-e65b3680-456d-11e9-9b88-dc67c4b029d0.png) ### Expected Behavior Only the device/type/name tuple are required for creating a connection. The site and rack fields are only there to filter the list of available devices. ### Observed Behavior Connection creation fails because the site was specified without the rack. Note that if you don't specify the site nor the rack, it works fine.
adam added the type: bugstatus: accepted labels 2025-12-29 18:19:02 +01:00
adam closed this issue 2025-12-29 18:19:02 +01:00
Author
Owner

@hSaria commented on GitHub (Mar 13, 2019):

Do note that currently, the Device field isn't even required for connection creation; it is another field to filter down the list of the available interface. You can specify the Interface without knowing which device it belongs to and it'll work. That's not necessarily a bad thing, but I just thought I'd mention this behavior.

For this issue, I propose that it is solved by relaxing the requirement on the Site/Rack/Device fields given that they're not a part of the connection object.

@hSaria commented on GitHub (Mar 13, 2019): Do note that currently, the Device field isn't even required for connection creation; it is another field to filter down the list of the available interface. You can specify the Interface without knowing which device it belongs to and it'll work. That's not necessarily a bad thing, but I just thought I'd mention this behavior. For this issue, I propose that it is solved by relaxing the requirement on the Site/Rack/Device fields given that they're not a part of the connection object.
Author
Owner

@jeremystretch commented on GitHub (Mar 19, 2019):

The bug here is that the API query is not limited by the rack field if it's empty. Selecting a site but not a rack should query the device list with e.g. ?site_id=123&rack_id=null. (Currently it is only querying for ?site_id=123.)

@jeremystretch commented on GitHub (Mar 19, 2019): The bug here is that the API query is not limited by the rack field if it's empty. Selecting a site but not a rack should query the device list with e.g. `?site_id=123&rack_id=null`. (Currently it is only querying for `?site_id=123`.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2459