Skip to content

GraphQL frequently returns Null in a site_list primary_ip4 query #19036

@OliElli

Description

@OliElli

Deployment Type

NetBox self hosted

NetBox Version

4.1.11

Python Version

3.11

Steps to Reproduce

  1. Upgrade from any version 4.1.10 or earlier
  2. Use this style query to return primary_ip4:
query MyQuery {
  site_list(
    filters: {status: "active", name: {i_exact: "QRO1"}, tenant: "dco"}
  ) {
    name
    devices(filters: {status: "active", tenant: "dco", platform_id: "3"}) {
      name
      primary_ip4 {
        address
      }
    }
  }
}

Expected Behavior

I expect null for qro1-fw-01b and qro1-fw-02b, but an IP for the others

{
  "data": {
    "site_list": [
      {
        "name": "QRO1",
        "devices": [
          {
            "name": "qro1-fw-01a",
            "primary_ip4": {
              "address": "10.1.52.1/24"
            }
          },
          {
            "name": "qro1-fw-01b",
            "primary_ip4": null
          },
          {
            "name": "qro1-fw-02a",
            "primary_ip4": {
              "address": "10.1.52.2/24"
            }
          },
          {
            "name": "qro1-fw-02b",
            "primary_ip4": null
          },
          {
            "name": "qro1-rt-01",
            "primary_ip4": {
              "address": "10.1.52.51/24"
            }
          },
          {
            "name": "qro1-rt-02",
            "primary_ip4": {
              "address": "10.1.52.52/24"
            }
          },
          {
            "name": "qro1-sw-02",
            "primary_ip4": {
              "address": "10.1.52.102/24"
            }
          },
          {
            "name": "qro1-sw-99",
            "primary_ip4": {
              "address": "10.1.52.199/24"
            }
          }
        ]
      }
    ]
  }
}

Observed Behavior

{
  "data": {
    "site_list": [
      {
        "name": "QRO1",
        "devices": [
          {
            "name": "qro1-fw-01a",
            "primary_ip4": {
              "address": "10.1.52.1/24"
            }
          },
          {
            "name": "qro1-fw-01b",
            "primary_ip4": null
          },
          {
            "name": "qro1-fw-02a",
            "primary_ip4": null
          },
          {
            "name": "qro1-fw-02b",
            "primary_ip4": null
          },
          {
            "name": "qro1-rt-01",
            "primary_ip4": null
          },
          {
            "name": "qro1-rt-02",
            "primary_ip4": null
          },
          {
            "name": "qro1-sw-02",
            "primary_ip4": null
          },
          {
            "name": "qro1-sw-99",
            "primary_ip4": null
          }
        ]
      }
    ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending closureRequires immediate attention to avoid being closed for inactivitystatus: revisions neededThis issue requires additional information to be actionabletype: bugA confirmed report of unexpected behavior in the application

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions