-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Labels
netboxseverity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtopic: GraphQLtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox Edition
NetBox Community
NetBox Version
v4.4.1
Python Version
3.12
Steps to Reproduce
- Use GraphQL to query
aggregate_list
with the following filter:
aggregate_list(filters: {
prefix: {
prefix: {
i_regex: "^(?!10\\.)[^:]+$"
}
}
}) {
prefix
}
- Run the query.
Expected Behavior
- The query should return prefixes that match the regex pattern (e.g., IPv6 only).
- Same return we can expect not only for
i_regex
, but also for the otherStrFilterLookup
fields like exact, contains and so on. - No error should occur, since the query syntax is valid.
Observed Behavior
- The query fails with the following error:
{
"data": null,
"errors": [
{
"message": "Unsupported lookup 'prefix__iregex' for IPNetworkField or join on the field not permitted.",
"locations": [
{
"line": 36,
"column": 3
}
],
"path": [
"aggregate_list"
]
}
]
}
- We tried to other StrFilterLookup Fields, such as
contains
but it also did not work. - No results are returned.
Background:
Before upgrading to NetBox 4.4.1 from 4.1.11, we used the following GraphQL query to filter IPv6 prefixes:
aggregate_list(filters: {family: 6}) {
prefix
}
This query worked correctly in version 4.1.11. However, after upgrading to 4.4.1, the family filter is no longer supported.
To work around this, we tried using a regex filter on the prefix field to exclude IPv4 addresses and target IPv6 only.
jona7777, tagur87 and hcrumpler
Metadata
Metadata
Assignees
Labels
netboxseverity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtopic: GraphQLtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application