Exception raised when uploading invalid device bay CSV #9206

Closed
opened 2025-12-29 20:46:57 +01:00 by adam · 1 comment
Owner

Originally created by @candlerb on GitHub (Feb 7, 2024).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

Self-hosted

NetBox Version

v3.7.2

Python Version

3.8

Steps to Reproduce

  1. Go to /dcim/device-bays/import/ (from left menu: Devices > Device Bays > Upload)
  2. Paste in the following data, select format as "CSV", then Submit.

Case 1:

name
foo

Case 2:

name,device
foo,blah-nonexistent

Expected Behavior

A meaningful error message. In the first case, something like "missing column device". In the second case, something like "device "blah-nonexistent" does not exist"

Observed Behavior

A RelatedObjectDoesNotExist exception is raised.

<class 'dcim.models.device_components.DeviceBay.device.RelatedObjectDoesNotExist'>

DeviceBay has no device.

Python version: 3.8.10
NetBox version: 3.7.2
Originally created by @candlerb on GitHub (Feb 7, 2024). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type Self-hosted ### NetBox Version v3.7.2 ### Python Version 3.8 ### Steps to Reproduce 1. Go to `/dcim/device-bays/import/` (from left menu: Devices > Device Bays > Upload) 2. Paste in the following data, select format as "CSV", then Submit. Case 1: ``` name foo ``` Case 2: ``` name,device foo,blah-nonexistent ``` ### Expected Behavior A meaningful error message. In the first case, something like "missing column `device`". In the second case, something like "device "blah-nonexistent" does not exist" ### Observed Behavior A RelatedObjectDoesNotExist exception is raised. ``` <class 'dcim.models.device_components.DeviceBay.device.RelatedObjectDoesNotExist'> DeviceBay has no device. Python version: 3.8.10 NetBox version: 3.7.2 ```
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 20:46:57 +01:00
adam closed this issue 2025-12-29 20:46:58 +01:00
Author
Owner

@candlerb commented on GitHub (Feb 7, 2024):

Note: these errors are properly handled when uploading Interfaces.

Case 1:

name
foo

image

Case 2:

name,type,device
foo,virtual,blah-nonexistent

image

@candlerb commented on GitHub (Feb 7, 2024): Note: these errors *are* properly handled when uploading Interfaces. Case 1: ``` name foo ``` ![image](https://github.com/netbox-community/netbox/assets/44789/e8dd6e47-aaa8-4b95-b575-61cf7d30c42c) Case 2: ``` name,type,device foo,virtual,blah-nonexistent ``` ![image](https://github.com/netbox-community/netbox/assets/44789/e967d208-5de9-4258-a4d9-7aadc34fc940)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9206