Device (Type) Import is missing component data type validation #11775

Closed
opened 2025-12-29 21:49:43 +01:00 by adam · 2 comments
Owner

Originally created by @m-hau on GitHub (Oct 24, 2025).

Originally assigned to: @m-hau on GitHub.

NetBox Edition

NetBox Community

NetBox Version

v4.4.4 (and main Branch)

Python Version

3.12

Steps to Reproduce

  1. Open the WebUI
  2. Create a Manufacturer named M
  3. Open the "Device Type Bulk Import" aka /dcim/device-types/import/
  4. Insert the following Data, and Submit

4a.

---
manufacturer: M
model: DT1
slug: dt1
u_height: 1
console-ports: con0

4b.

---
manufacturer: M
model: DT2
slug: dt2
u_height: 1
console-ports:
  - con0

Expected Behavior

You get a proper validation error, stating what the problem is

4a: console-ports: Must be a list
4b: console-ports[0]: Must be a dictionary

Observed Behavior

You get an error page with a traceback.

AttributeError at /dcim/device-types/import/
'str' object has no attribute 'update'

Originally found while working on #20042. Fix can also already be found in commits bb8f5ee1 and 16e284f0. Would like to create a PR for this.

Originally created by @m-hau on GitHub (Oct 24, 2025). Originally assigned to: @m-hau on GitHub. ### NetBox Edition NetBox Community ### NetBox Version v4.4.4 (and `main` Branch) ### Python Version 3.12 ### Steps to Reproduce 1. Open the WebUI 2. Create a Manufacturer named `M` 3. Open the "Device Type Bulk Import" aka `/dcim/device-types/import/` 4. Insert the following Data, and Submit 4a. ``` --- manufacturer: M model: DT1 slug: dt1 u_height: 1 console-ports: con0 ``` 4b. ``` --- manufacturer: M model: DT2 slug: dt2 u_height: 1 console-ports: - con0 ``` ### Expected Behavior You get a proper validation error, stating what the problem is 4a: `console-ports: Must be a list` 4b: `console-ports[0]: Must be a dictionary` ### Observed Behavior You get an error page with a traceback. ``` AttributeError at /dcim/device-types/import/ 'str' object has no attribute 'update' ``` <hr> Originally found while working on #20042. Fix can also already be found in commits bb8f5ee1 and 16e284f0. Would like to create a PR for this.
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:49:43 +01:00
adam closed this issue 2025-12-29 21:49:43 +01:00
Author
Owner

@arthanson commented on GitHub (Oct 28, 2025):

@m-hau do you want to create a PR for this? I can assign to you if so.

@arthanson commented on GitHub (Oct 28, 2025): @m-hau do you want to create a PR for this? I can assign to you if so.
Author
Owner

@m-hau commented on GitHub (Oct 28, 2025):

Yes please.

@m-hau commented on GitHub (Oct 28, 2025): Yes please.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11775