netbox v3.2-beta1 - dcim/device-types/inventory-items error "'component' does not resolve to an item" #6098

Closed
opened 2025-12-29 19:36:47 +01:00 by adam · 5 comments
Owner

Originally created by @PieterL75 on GitHub (Feb 16, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.2-beta1

Python version

3.9

Steps to Reproduce

  1. Create a devicetype
  2. Create a Module Bay on that device type
  3. Create a new inventory item on that device type.
    (only complete the mandatory fields, leave the rest default)

Expected Behavior

The Inventory item is created without errors

Observed Behavior

After clicking the 'create' button, an error is thrown:

<class 'ValueError'>
'component' does not resolve to an item that supports prefetching - this is an invalid parameter to prefetch_related().
Python version: 3.8.10
NetBox version: 3.2.0-beta1

When refreshing, the inventory items was created properly.

I noticed that after this, creating inventory items work without errors

Originally created by @PieterL75 on GitHub (Feb 16, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.2-beta1 ### Python version 3.9 ### Steps to Reproduce 1. Create a devicetype 2. Create a Module Bay on that device type 3. Create a new inventory item on that device type. (only complete the mandatory fields, leave the rest default) ### Expected Behavior The Inventory item is created without errors ### Observed Behavior After clicking the 'create' button, an error is thrown: <class 'ValueError'> 'component' does not resolve to an item that supports prefetching - this is an invalid parameter to prefetch_related(). Python version: 3.8.10 NetBox version: 3.2.0-beta1 When refreshing, the inventory items was created properly. I noticed that after this, creating inventory items work without errors
adam added the type: bugstatus: acceptedbeta labels 2025-12-29 19:36:47 +01:00
adam closed this issue 2025-12-29 19:36:47 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 16, 2022):

I'm not able to reproduce this currently, though I recall running into a similar issue with InventoryItemTable (for device items). It has something to do with the table attempting to prefetch component, which, as a generic foreign key, cannot be prefetched reliably.

@jeremystretch commented on GitHub (Feb 16, 2022): I'm not able to reproduce this currently, though I recall running into a similar issue with InventoryItemTable (for device items). It has something to do with the table attempting to prefetch `component`, which, as a generic foreign key, cannot be prefetched reliably.
Author
Owner

@jeremystretch commented on GitHub (Mar 1, 2022):

@PieterL75 have you uncovered a way to reproduce this reliably? I haven't seen any further reports so far.

@jeremystretch commented on GitHub (Mar 1, 2022): @PieterL75 have you uncovered a way to reproduce this reliably? I haven't seen any further reports so far.
Author
Owner

@PieterL75 commented on GitHub (Mar 2, 2022):

I'm not able to reproduce it... migth have been bad caching or something.

You may close the bugreport.. if I experience it again, I'll create a new bugreport

greetz

Pieter

@PieterL75 commented on GitHub (Mar 2, 2022): I'm not able to reproduce it... migth have been bad caching or something. You may close the bugreport.. if I experience it again, I'll create a new bugreport greetz Pieter
Author
Owner

@jeremystretch commented on GitHub (Mar 2, 2022):

Thanks!

@jeremystretch commented on GitHub (Mar 2, 2022): Thanks!
Author
Owner

@jeremystretch commented on GitHub (Mar 3, 2022):

I just happened to reproduce this today.

@jeremystretch commented on GitHub (Mar 3, 2022): I just happened to reproduce this today.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6098