Device type import fails silently #5042

Closed
opened 2025-12-29 19:23:28 +01:00 by adam · 4 comments
Owner

Originally created by @candlerb on GitHub (Jul 4, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.11.7

Python version

3.6

Steps to Reproduce

  1. Create a manufacturer called "Unknown"
  2. Go to Devices > Device Types > Import (/dcim/device-types/import/)
  3. Paste in the following YAML and click Submit
manufacturer: Unknown
model: Packet Shooter 9000
slug: packet-shooter-9000
u_height: 1
front-ports:
  - name: F1
    description: foo
    label: FP1
rear-ports:
  - name: R1
    type: 8p8c
    description: bar
    label: RP1

Expected Behavior

Error returned showing data validation problem (some things are missing, like front-port type and front-port to rear-port association)

Observed Behavior

GUI goes to /dcim/device-types/28/ but reports "The requested page does not exist."

This is not a caching bug:

  • invalidating the cache makes no difference
  • select * from dcim_devicetype where id=28; returns no rows
Originally created by @candlerb on GitHub (Jul 4, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.11.7 ### Python version 3.6 ### Steps to Reproduce 1. Create a manufacturer called "Unknown" 2. Go to Devices > Device Types > Import (`/dcim/device-types/import/`) 3. Paste in the following YAML and click Submit ``` manufacturer: Unknown model: Packet Shooter 9000 slug: packet-shooter-9000 u_height: 1 front-ports: - name: F1 description: foo label: FP1 rear-ports: - name: R1 type: 8p8c description: bar label: RP1 ``` ### Expected Behavior Error returned showing data validation problem (some things are missing, like front-port type and front-port to rear-port association) ### Observed Behavior GUI goes to `/dcim/device-types/28/` but reports "The requested page does not exist." This is not a caching bug: * invalidating the cache makes no difference * `select * from dcim_devicetype where id=28;` returns no rows
adam added the type: bugstatus: accepted labels 2025-12-29 19:23:28 +01:00
adam closed this issue 2025-12-29 19:23:28 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 4, 2021):

I can confirm this behavior under the master branch, however under develop I instead get a RelatedObjectDoesNotExist exception:

FrontPortTemplate has no rear_port.

I'm not sure what caused the change in behavior, but it's clearly a bug either way.

@jeremystretch commented on GitHub (Jul 4, 2021): I can confirm this behavior under the `master` branch, however under `develop` I instead get a RelatedObjectDoesNotExist exception: ``` FrontPortTemplate has no rear_port. ``` I'm not sure what caused the change in behavior, but it's clearly a bug either way.
Author
Owner

@jeremystretch commented on GitHub (Jul 4, 2021):

Oh, I know what it was: #6354 #6345 introduced a new exception for handling permissions violations. Previously, the RelatedObjectDoesNotExist exception was being accidentally swallowed, hence the "ghost" redirect.

@jeremystretch commented on GitHub (Jul 4, 2021): Oh, I know what it was: ~#6354~ #6345 introduced a new exception for handling permissions violations. Previously, the RelatedObjectDoesNotExist exception was being accidentally swallowed, hence the "ghost" redirect.
Author
Owner

@candlerb commented on GitHub (Jul 4, 2021):

I believe you mean #6345 ?

@candlerb commented on GitHub (Jul 4, 2021): I believe you mean #6345 ?
Author
Owner

@jeremystretch commented on GitHub (Jul 4, 2021):

Whoops, yes, that one.

@jeremystretch commented on GitHub (Jul 4, 2021): Whoops, yes, that one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5042