-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After upgrade from 3.5 to 3.7, instantiating a DeviceType which contains nested InventoryItems throws "InventoryItem matching query does not exist" #15598
Comments
BTW - I opened this issue here (rather than in docker-netbox) because it does not seem like an issue with the Docker image or related tooling and rather more like an issue with schema or a script. |
Thank you for opening a bug report. I was unable to reproduce the reported behavior on NetBox v3.7.4. Please re-confirm the reported behavior on the current stable release and adjust your post above as necessary. Remember to provide detailed steps that someone else can follow using a clean installation of NetBox to reproduce the issue. Remember to include the steps taken to create any initial objects or other data. |
Replicates fine here following his steps. The offending commit is this: The cause is pretty obvious, inventory items are intentionally created with bulk_create=False to avoid trying to reference a non-existant object. The above commit moves the instantiation of the inventory items outside the bulk_create check. Reverting the commit allows creating the device again. |
Thanks @kkthxbye-code, would you like to submit a PR for this? |
@jeremystretch @kkthxbye-code I got it. I'll have a PR shortly. |
Commit: padthaitofuhot@415cb30 @jeremystretch apparently I need you to assign this issue to me so my PR doesn't get automatically deleted. Please assign this issue to me?
|
Thanks @padthaitofuhot! |
@jeremystretch PR submitted. Do I need to ping somewhere to ask for a review or is there some other process? Every project is a little different. |
@padthaitofuhot nope, we review PRs daily as they come in. I've just reviewed & merged yours. Thank you for contributing to NetBox! |
Deployment Type
Self-hosted
NetBox Version
v3.7.4
Python Version
3.11
Steps to Reproduce
Expected Behavior
A new Device is created with nested InventoryItems from DeviceType.
Observed Behavior
Instantiating a DeviceType which contains nested InventoryItems throws:
The text was updated successfully, but these errors were encountered: