GraphQL query does not show mac addresses on interface #10838

Closed
opened 2025-12-29 21:36:31 +01:00 by adam · 1 comment
Owner

Originally created by @rejoice-full on GitHub (Mar 4, 2025).

Deployment Type

Self-hosted

NetBox Version

v4.2.3

Python Version

3.11

Steps to Reproduce

Using GraphQL query:

query getHWInterfaces {
  resp: interface_list {
    id
    name
    enabled
    description
    mac_addresses {
      mac_address
    }
    type
    custom_fields
    device {
      id
      name
    }
  }
}

The 'resp' list with interfaces contains items like

{
        "id": "7133",
        "name": "IPMI",
        "enabled": true,
        "description": "",
        "mac_addresses": [],
        "type": "1000base-t",
        "custom_fields": {},
        "device": {
          "id": "1542",
          "name": "1J00NN2"
        }
      }

'mac_addresses' are always an empty list, although they actually exist and can be seen through web-interface or REST API query.

Expected Behavior

'mac_addresses' list is populated with mac addresses which are assigned to corresponding interfaces.

Observed Behavior

'mac_addresses' list is always empty

Originally created by @rejoice-full on GitHub (Mar 4, 2025). ### Deployment Type Self-hosted ### NetBox Version v4.2.3 ### Python Version 3.11 ### Steps to Reproduce Using GraphQL query: ``` query getHWInterfaces { resp: interface_list { id name enabled description mac_addresses { mac_address } type custom_fields device { id name } } } ``` The 'resp' list with interfaces contains items like ``` { "id": "7133", "name": "IPMI", "enabled": true, "description": "", "mac_addresses": [], "type": "1000base-t", "custom_fields": {}, "device": { "id": "1542", "name": "1J00NN2" } } ``` 'mac_addresses' are always an empty list, although they actually exist and can be seen through web-interface or REST API query. ### Expected Behavior 'mac_addresses' list is populated with mac addresses which are assigned to corresponding interfaces. ### Observed Behavior 'mac_addresses' list is always empty
adam added the type: bugstatus: revisions needed labels 2025-12-29 21:36:31 +01:00
adam closed this issue 2025-12-29 21:36:31 +01:00
Author
Owner

@arthanson commented on GitHub (Mar 4, 2025):

I was not able to reproduce this (see screenshot below using your GraphQL query). I created the Mac Address, assigned to the interface and then set it as the Primary MAC Address and it appears correctly - this was on NetBox v4.2.3.

Monosnap GraphiQL | NetBox 2025-03-04 07-56-55.png
@arthanson commented on GitHub (Mar 4, 2025): I was not able to reproduce this (see screenshot below using your GraphQL query). I created the Mac Address, assigned to the interface and then set it as the Primary MAC Address and it appears correctly - this was on NetBox v4.2.3. <img src="https://uploads.linear.app/93557cdd-2eb2-4bdc-91bb-6a48bc06b416/fb9183c1-7c06-457a-8650-a1b37fd01194/de921e51-b3a4-418b-9f66-0ae3e15fd63e?signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXRoIjoiLzkzNTU3Y2RkLTJlYjItNGJkYy05MWJiLTZhNDhiYzA2YjQxNi9mYjkxODNjMS03YzA2LTQ1N2EtODY1MC1hMWIzN2ZkMDExOTQvZGU5MjFlNTEtYjNhNC00MThiLTlmNjYtMGFlM2UxNWZkNjNlIiwiaWF0IjoxNzQxMTA0MDg0LCJleHAiOjMzMzExNjY0MDg0fQ.oKVNY-8H_Atgs_TV6Ba0wXJCWfSBwJlk8zpToUGm1_I " alt="Monosnap GraphiQL | NetBox 2025-03-04 07-56-55.png" width="602" data-linear-height="626" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10838