GraphQL interface_list query returns all interfaces if filter contains non-existing device #9745

Closed
opened 2025-12-29 21:22:00 +01:00 by adam · 3 comments
Owner

Originally created by @dmulyalin on GitHub (May 26, 2024).

Deployment Type

Self-hosted

NetBox Version

v4.0.3

Python Version

3.10

Steps to Reproduce

Run query like this:

{
  interface_list(filters: {device: ["fceos21", "ceos1"]}) {
    name
  }
}

where fceos21 is a device not defined in Netbox and ceos1 is a device that exists in Netbox, that query returns ALL interfaces defined in Netbox for all devices

Expected Behavior

Query returns interfaces only for existing devices, if none of the devices from query filter exists in Netbox return None

Observed Behavior

query returns all interfaces defined in Netbox if non existing device given in query filter

Originally created by @dmulyalin on GitHub (May 26, 2024). ### Deployment Type Self-hosted ### NetBox Version v4.0.3 ### Python Version 3.10 ### Steps to Reproduce Run query like this: ``` { interface_list(filters: {device: ["fceos21", "ceos1"]}) { name } } ``` where fceos21 is a device not defined in Netbox and ceos1 is a device that exists in Netbox, that query returns ALL interfaces defined in Netbox for all devices ### Expected Behavior Query returns interfaces only for existing devices, if none of the devices from query filter exists in Netbox return None ### Observed Behavior query returns all interfaces defined in Netbox if non existing device given in query filter
adam added the type: bugtopic: GraphQL labels 2025-12-29 21:22:00 +01:00
adam closed this issue 2025-12-29 21:22:00 +01:00
Author
Owner

@jeffgdotorg commented on GitHub (May 29, 2024):

Thanks for reporting a problem you've encountered in NetBox.

I've managed to reproduce the problem in the lab, but in future, please remember to assume a pristine, unpopulated NetBox install as the starting point, and to specify all the objects that need creating to make the problem reproducible.

@jeffgdotorg commented on GitHub (May 29, 2024): Thanks for reporting a problem you've encountered in NetBox. I've managed to reproduce the problem in the lab, but in future, please remember to assume a pristine, unpopulated NetBox install as the starting point, and to specify all the objects that need creating to make the problem reproducible.
Author
Owner

@jeremystretch commented on GitHub (May 30, 2024):

@jeffgdotorg please assign a severity level for this.

@jeremystretch commented on GitHub (May 30, 2024): @jeffgdotorg please assign a severity level for this.
Author
Owner

@arthanson commented on GitHub (Jun 17, 2024):

This is actually the same as #16024 (this would result in an AND query). closing this and noting in that issue to make sure this syntax is tested as well.

@arthanson commented on GitHub (Jun 17, 2024): This is actually the same as #16024 (this would result in an AND query). closing this and noting in that issue to make sure this syntax is tested as well.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9745