Skip to content

Node registration fails when host has tunnel/virtual interfaces with non-MAC port_id #496

Description

@jonathan-r-thorpe

When running nmos-cpp Node in Docker (host networking), registration with the Registry fails with 400 Bad Request due to IS-04 schema validation failure. The node resource includes a tunnel interface (tunl0) whose port_id is 4 octets instead of the required 6-octet MAC.

  • nmos-cpp Node and Registry in separate Docker containers
  • Host networking / multiple host_addresses (physical NIC + Docker bridge IPs)
  • Linux host with interfaces such as enP7s7, docker0, br-*, tunl0

Registry log

warning: JSON error: schema validation failed at root - no subschema has succeeded ...
{"type":"node","data":{...,"interfaces":[
  {"name":"enP7s7","port_id":"4c-bb-47-81-1f-e8",...},
  {"name":"docker0","port_id":"be-e8-aa-9a-16-c2",...},
  {"name":"br-47379b15f1c5","port_id":"d2-38-b9-d4-7e-80",...},
  {"name":"tunl0","port_id":"00-00-00-00",...}
]}}

Node log

Registration creation error: 400 Bad Request

Discovery and the POST to the Registration API succeed; only schema validation fails.

Root cause

On Linux, host_utils.cpp reads link-layer addresses from AF_PACKET and formats sll_halen bytes as-is. Tunnel interfaces like tunl0 report sll_halen == 4, producing "00-00-00-00".

IS-04 requires port_id to match ^([0-9a-f]{2}-){5}([0-9a-f]{2})$ (6 octets).

make_node_interfaces_port_id() in node_interfaces.cpp falls back to "00-00-00-00-00-00" only when port_id is empty — not when it is non-empty but invalid:

return value::string(!port_id.empty() ? port_id : U("00-00-00-00-00-00"));

Workaround

Restrict host_addresses to the single IP clients should use (e.g. the physical NIC), so tunnel interfaces are excluded:

"host_address": "192.168.6.54",
"host_addresses": ["192.168.6.54"]

Suggested fix

When physical_address is not a valid 6-octet MAC, either:

  • normalize to "00-00-00-00-00-00" (already used for missing addresses), or
  • exclude the interface from the node resource

This would make container/virtualised deployments more robust without requiring users to know which kernel-reported interfaces have non-MAC link addresses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions