cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
360
Views
5
Helpful
18
Replies

Issue in Genie parser for commands "show ip mroute summary vrf <name>"

Akshayrane
Level 1
Level 1

Im running into a unique issue with the genie parser for the command show ip mroute summary vrf vrf_captain_america. The same parser works fine on my Nexus switches that are not part of the vxlan fabric, and I get the parsed output correctly.

However, when I use the same command on the Nexus model leaf or border leaf switches of my vxlan fabric, the command parsing fails. So I tried to run the parser through the pyATS cli and I see the following error.

 

Please can someone help me fix this parser issue.

 

 

pyats parse "show ip mroute summary vrf vrf_captain_america" --testbed-file intf_detail_testbed.yaml --output log_files/12Nov2025

 

 

 

Issue with the parser show ip mroute summary vrf vrf_captain_america

 

Traceback (most recent call last):

  File "src/genie/cli/commands/parser.py", line 339, in genie.cli.commands.parser.ParserCommand.parse

  File "src/genie/conf/base/device.py", line 536, in genie.conf.base.device.Device.parse

  File "src/genie/conf/base/device.py", line 576, in genie.conf.base.device.Device._get_parser_output

  File "src/genie/conf/base/device.py", line 574, in genie.conf.base.device.Device._get_parser_output

  File "src/genie/metaparser/_metaparser.py", line 342, in genie.metaparser._metaparser.MetaParser.parse

  File "src/genie/metaparser/_metaparser.py", line 322, in genie.metaparser._metaparser.MetaParser.parse

  File "src/genie/metaparser/util/schemaengine.py", line 419, in genie.metaparser.util.schemaengine.Schema.validate

genie.metaparser.util.exceptions.SchemaMissingKeyError: Missing keys: [['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.20.32/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.20.33/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.48.40/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.48.87/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.49.1/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.49.2/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.49.3/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.49.4/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.65.56/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.65.57/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.65.60/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.65.113/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.65.126/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.65.150/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.65.151/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.65.153/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.65.187/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.40/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.41/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.42/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.43/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.44/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.45/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.46/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.50/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.51/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.52/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.53/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.54/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.55/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.80.56/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.40/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.41/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.42/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.43/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.44/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.45/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.46/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.50/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.51/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.52/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.53/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.54/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.55/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.56/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.208/32', 'source'], ['vrf', 'vrf_captain_america', 'address_family', 'ipv4', 'groups', '239.216.81.209/32', 'source']]

 

 

My current package list is as follows

Package Version
---------------------------- -------------
genie latest (25.9)
genie.libs.clean latest (25.9)
genie.libs.conf latest (25.9)
genie.libs.filetransferutils latest (25.9)
genie.libs.health latest (25.9)
genie.libs.ops latest (25.9)
genie.libs.parser latest (25.9)
genie.libs.sdk latest (25.9)
genie.trafficgen latest (25.9)
pyats latest (25.9)
pyats.aereport latest (25.9)
pyats.aetest latest (25.9)
pyats.async latest (25.9)
pyats.connections latest (25.9)
pyats.contrib latest (25.9)
pyats.datastructures latest (25.9)
pyats.easypy latest (25.9)
pyats.kleenex latest (25.9)
pyats.log latest (25.9)
pyats.reporter latest (25.9)
pyats.results latest (25.9)
pyats.tcl latest (25.9)
pyats.topology latest (25.9)
pyats.utils latest (25.9)
rest.connector latest (25.9)
unicon latest (25.9)
unicon.plugins latest (25.9)
yang.connector latest (25.9)

 

 

the command output from the device for one of the multicast group  looks like this. 

 

leaf_switch-5a# sh ip mroute 239.216.15.1 vrf vrf_captain_america | json-pretty
{
"TABLE_vrf": {
"ROW_vrf": {
"vrf-name": "vrf_captain_america",
"TABLE_one_route": {
"ROW_one_route": {
"mcast-addrs": "(10.110.15.1/32, 239.216.15.1/32)",
"source_addrs": "10.110.15.1/32",
"group_addrs": "239.216.15.1/32",
"pending": "false",
"bidir": "false",
"uptime": "2y21w",
"uptime_detailed": "P2Y5M6DT7H45M25S",
"mofrr": "false",
"TABLE_mpib": {
"ROW_mpib": [
{
"mpib-name": "ip",
"stale-route": "false"
},
{
"mpib-name": "pim",
"stale-route": "false"
},
{
"mpib-name": "mrib",
"stale-route": "false"
}
]
},
"route-iif": "Vlan1011",
"rpf-nbr": "10.110.15.1",
"mofrr-iif": "Null",
"mofrr-nbr": "0.0.0.0",
"internal": "true",
"oif-count": "0",
"fabric-oif": "false",
"fabric-loser": "false"
}
}
}
}
}

18 Replies 18

@Akshayrane thanks, so this would conclude that your the entire bug. Nothing else is wrong with the parser and the spacing is fine, vrf handling is fine (we know this from the non vxlan exmaples and the the other vrfs), everything else just works fine.

It's just this one hardcoded "bps" in group p8 that's causing all 47 groups in vrf_captain_america to fail parsing. I am wonder, if we can prove this, by clearing your counters (clear ip mroute stats vrf vrf_captain_america too?), then run show ip mroute summary vrf vrf_captain_america, showing bps and then run your pyATS script to parse the command.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

@bigevilbeard 

 

Kudos! 
Your suggestion to clear the stats worked but then it breaks after a few seconds. Let me explain!

Immediately running the script after issuing the command "clear ip mroute statistics vrf vrf_captain_america" the command output reflects the groups with 0.0 bps in the bitrate column, and the script captures the data correctly showing the bitrate for each group to be 0. This explains no issue with the parser.

However, when the command output is populated with stats of each group, the parser fails again as now the bitrate value is populated to be value_x mbps (value_x is any random value depending on the rate at which the multicast feed is sent by the sender ex: 27.2 or 33.6 or 65.1). This confirms your findings on why the parser is breaking for the groups with mbps as it is not configured to include the mbps and only bps. This issue inturn breaks the parser for the entire output.

Now, that we know what is causing the issue, how do we fix the parser to also include kbps or mbps along with bps in the bitrate column following the value of the bitrate?

@Akshayrane amazing, congrats on finding a bug, hopefully you win a prize from the pyats team! So two fixes, you could update your local version or this needs to be raised as a PR on the repo for the team to update. Technically i can see the parser code needs to change in two place, the regex and also the capture unit.

I am chatting with the pyats team and community in a webex space to confirm these findings.

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

@Akshayrane i raised an issue for this here on the repo https://github.com/CiscoTestAutomation/genieparser/issues/970 - i took out all your info, but added in all your testing as without this the issue would not have been found. If you are talking to TAC you can point them to this issue. I have shared this with team in the pyats webex team space too.

 

Edit: Team advise an issue wont fix this, a PR needs to be raised with suggest code changes.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io