Page MenuHomeVyOS Platform

API call for `show ip/ipv6 route vrf <NAME>` fails with tagNode / virtualTagNode error
Open, NormalPublicBUG

Description

Summary

Querying VRF routing tables through the VyOS API is broken in recent rolling releases.
The CLI version of the same command works correctly, but the API returns an internal schema error.

This regression appears related to recent changes in op-mode schema processing, in particular PR https://github.com/vyos/vyos-1x/pull/4565 and associated schema adjustments.

Description

Calling the API with:

{"op": "show", "path": ["ipv6", "route", "vrf", "supervrf"]}

returns:

ApiResponse(
  status=200,
  request={'data': '{"op": "show", "path": ["ipv6", "route", "vrf", "supervrf"]}', 'key': '***REDACTED***'},
  result='Internal error: Node with type "tagNode" must not have a <virtualTagNode> child\n',
  error=False
)

The same operation through the CLI works:

show ipv6 route vrf supervrf

This indicates the underlying op-mode logic is functional, but the API op-mode execution path is failing due to schema-node handling issues.

Suspected cause

The issue appears tied to logic around tag node validation in:

vyos-utils/src/vyos_op_run.ml#L411
https://github.com/vyos/vyos-utils/blob/dbecbd0c4f25f8b8d7055e5ed3ffc8e5be59b1f0/src/vyos_op_run.ml#L411

The error indicates:

Node with type "tagNode" must not have a <virtualTagNode> child

This suggests that the op-mode tree created when processing API requests is generating a schema structure (tagNode → virtualTagNode) that is not permitted, whereas the CLI op-mode evaluator builds a valid structure.

This coincides with the work in:

Steps to reproduce

  1. Configure a VRF (e.g., supervrf) and ensure it contains routes.
  2. Run via CLI:
show ip route vrf supervrf

→ Works as expected.

  1. Call the API with:
{"op":"show","path":["ip","route","vrf","supervrf"]}
  1. Observe internal error:
Node with type "tagNode" must not have a <virtualTagNode> child

Same behavior with IPv6 path.

Expected behavior

The API should behave identically to the CLI and return the VRF routing table.

Actual behavior

API op-mode execution aborts due to an invalid schema node structure.

Additional notes

This breaks all VRF-based route queries through automation tools using the VyOS API.
The CLI continues to function normally, so the problem is isolated to API op-mode evaluation.

Details

Version
2025.12.01-0024-rolling
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)