Skip to content

GraphQL: Filtering FHRP group assignments by device/VM is not available #19640

Closed
@Leo1003

Description

@Leo1003
Contributor

Deployment Type

Self-hosted

NetBox Version

v4.3.1

Python Version

3.10

Steps to Reproduce

Originally, it was able to filter FHRP group assignments by device/VM id.
This feature was added by #9314.
However, in the version 4.3.1, Those fields definition are missing in FHRPGroupAssignmentFilter.
And this regression breaks our scripts.

I can even check this issue from the demo site: https://demo.netbox.dev/graphql/

The following GraphQL query works fine in version 4.2, but it causes an error in version 4.3

{
  fhrp_group_assignment_list(filters: {virtual_machine_id: ["22"]}) {
    group {
      id
      ip_addresses {
        address
        dns_name
      }
    }
  }
}

Expected Behavior

Should be able to use device, device_id, virtual_machine, virtual_machine_id to filter FHRPGroupAssignment.

Observed Behavior

The above query return an error:

Field 'virtual_machine_id' is not defined by type 'FHRPGroupAssignmentFilter'.

And those fields are missing from FHRPGroupAssignmentFilter definition.

Activity

added
type: bugA confirmed report of unexpected behavior in the application
status: needs triageThis issue is awaiting triage by a maintainer
on Jun 4, 2025
added theissue type on Jun 4, 2025
jnovinger

jnovinger commented on Jun 4, 2025

@jnovinger
Member

@Leo1003 , thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

With respect to the additions in #9314 (which is actually a PR for #8858), these changes are added to the relevant REST API filtersets. As of v4.3, these filtersets are no longer powering filtering in the GraphQL API. As you can see, these filters on the FHRPGroupAssignmentFilterSet are, in fact, still present.

added
status: revisions neededThis issue requires additional information to be actionable
and removed
status: needs triageThis issue is awaiting triage by a maintainer
on Jun 4, 2025
Leo1003

Leo1003 commented on Jun 4, 2025

@Leo1003
ContributorAuthor

After doing some git blame, I think it is introduced by #18701.

The PR makes GraphQL API no longer use filterset, however, it didn't add all the filters back to the GraphQL filter.

The following GraphQL query works fine in version 4.2, but it causes an error in version 4.3

{
  fhrp_group_assignment_list(filters: {virtual_machine_id: ["22"]}) {
    group {
      id
      ip_addresses {
        address
        dns_name
      }
    }
  }
}
Field 'virtual_machine_id' is not defined by type 'FHRPGroupAssignmentFilter'.
jnovinger

jnovinger commented on Jun 4, 2025

@jnovinger
Member

Thanks @Leo1003 , and thank you for updating the original report!

added
status: needs ownerThis issue is tentatively accepted pending a volunteer committed to its implementation
severity: lowDoes not significantly disrupt application functionality, or a workaround is available
and removed
status: revisions neededThis issue requires additional information to be actionable
on Jun 4, 2025
self-assigned this
on Jun 16, 2025
added a commit that references this issue on Jun 16, 2025

Fixes #19640: restores device/vm FHRPGroupAssignment graphql filters

0113b31

6 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtopic: GraphQLtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Relationships

None yet

    Participants

    @jnovinger@Leo1003

    Issue actions

      GraphQL: Filtering FHRP group assignments by device/VM is not available · Issue #19640 · netbox-community/netbox