-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
genie learn isis fails to parse alternate configurations #197
Comments
Hi Thanks for reporting. Could you please share the device output of the command, the os, platform and the command used. |
Hello, The commands are being run on a Nexus 9kV running 9.3.6 code. However, I also have a customer who is using physical Nexus 9000 (9336-FX) that is experiencing the same issue. I also believe they have seen this issue on some IOS-XE platforms as well (ISR/ASR routers they ran genie learn isis). The command being run in genie is "genie learn isis --testbed isis_testbed.yaml" The first error is experienced when we lack an interface in a default vrf configuration. In the case of my system I only have vrf blue configured on this device. You can see the output of "show isis interface vrf all": ` Ethernet1/1, Interface status: protocol-up/link-up/admin-up Ethernet1/2, Interface status: protocol-up/link-up/admin-up IS-IS process: 100 VRF: default Now, if I add an interface to the default vrf as part of IS-IS process, the Missing key for interface goes away, but instead I receive this error: genie.metaparser.util.exceptions.SchemaMissingKeyError: Missing keys: [['instance', '100', 'vrf', 'default', 'area_address']] This is due to the lack of net address in the ISIS configuration on the router. As we are not using that vrf we do not want a System ID/NET configured under the isis router process (see router config below) and we need the genie isis parser to be ok with that scenario.
If I place a physical interface into the default vrf, add a net in the default vrf and establish adjacency to another IS-IS router, and proceed to run genie learn isis again. The errors related to the default vrf go away but now I am presented with my VRF blue interfaces complaining they are missing the key levels (which is missing because they are IP unnumbered). Note the difference between the Ethernet 1/1 and 1/2 interfaces in vrf blue (ip unnumbered) and the Ethernet 1/3 interface in vrf default (bottom) genie.metaparser.util.exceptions.SchemaMissingKeyError: Missing keys: [['instance', '100', 'vrf', 'blue', 'interfaces', 'Ethernet1/1', 'levels'], ['instance', '100', 'vrf', 'blue', 'interfaces', 'Ethernet1/2', 'levels']] `n9kv-s2(config-router)# show isis interface vrf all Ethernet1/1, Interface status: protocol-up/link-up/admin-up Ethernet1/2, Interface status: protocol-up/link-up/admin-up IS-IS process: 100 VRF: default The issue with IP unnumbered not limited to a vrf configuration. Even interfaces in the default vrf experience this issue because they are missing the key 'levels' and based on reviewing the parser, would also error on the lack of 'topologies'. |
The parser is also broken for IOS-XR. It seems that the parser also assumes specific configuration and if VRFs, IPv6+v4 topology, SRv6, etc are configured then it fails (albeit a bit differently).
Note that if I manually fix the undefined var or change the topology/configuration (as originally reported in this issue), there are still many parsing issues with isis. This is against a topology with no VRFs, ipv4 and ipv6 configured.
|
Running into issues with the "genie learn isis" command when configurations deviate from what the parser expects to process.
First, when using ip unnumbered interfaces, the parser looks for the key levels which doesn't exist on an unnumbered interface (see below)
Issue while parsing: <class 'genie.libs.parser.nxos.show_isis.ShowIsisInterface'>
Traceback (most recent call last):
File "src/genie/cli/commands/learn.py", line 365, in genie.cli.commands.learn.LearnCommand._retrieve_ops
File "/Users/mleuschn/Builds/system_venv/venv/lib/python3.9/site-packages/genie/libs/ops/isis/nxos/isis.py", line 397, in learn
self.make()
File "/Users/mleuschn/Builds/system_venv/venv/lib/python3.9/site-packages/genie/ops/base/base.py", line 103, in make
self.maker.make(*args, **kwargs)
File "src/genie/ops/base/maker.py", line 315, in genie.ops.base.maker.Maker.make
File "src/genie/ops/base/maker.py", line 427, in genie.ops.base.maker.Maker._call_parser
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: [['instance', '100', 'vrf', 'default', 'interfaces', 'Ethernet1/1', 'levels'], ['instance', '100', 'vrf', 'default', 'interfaces', 'Ethernet1/2', 'levels']]
As a result, the parser fails to collect data and stops processing. I switched levels and topologies in the parser to be Optional() values showIsisInterfaceSchema which "appears" to fix the issue but I'm not sure if this potentially breaks other things within genie.
Second, there appears to be an issue across the board with genie learn isis when the default vrf is not used. If a user deploys a non-default vrf (say vrf blue) across the system and associates all interfaces with that vrf, genie learn still expects to see interfaces, or a system/area id configured in the default vrf. As a result, we see failures because no interfaces are associated with the default vrf, only vrf blue. Without an interface configured in the default vrf, ShowIsisInterface parser fails. If you put an interface in the default vrf, then showisisadjacency fails. While this is expected in a configuration without a default vrf, in a situation where default is not configured, genie should ignore and parse the other configured vrfs.
Issue while parsing: <class 'genie.libs.parser.nxos.show_isis.ShowIsisInterface'>
Traceback (most recent call last):
File "src/genie/cli/commands/learn.py", line 365, in genie.cli.commands.learn.LearnCommand._retrieve_ops
File "/Users/mleuschn/Builds/system_venv/venv/lib/python3.9/site-packages/genie/libs/ops/isis/nxos/isis.py", line 397, in learn
self.make()
File "/Users/mleuschn/Builds/system_venv/venv/lib/python3.9/site-packages/genie/ops/base/base.py", line 103, in make
self.maker.make(*args, **kwargs)
File "src/genie/ops/base/maker.py", line 315, in genie.ops.base.maker.Maker.make
File "src/genie/ops/base/maker.py", line 427, in genie.ops.base.maker.Maker._call_parser
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: [['instance', '100', 'vrf', 'default', 'interfaces']]
Issue while parsing: <class 'genie.libs.parser.nxos.show_isis.ShowIsisAdjacency'>
Traceback (most recent call last):
File "src/genie/cli/commands/learn.py", line 365, in genie.cli.commands.learn.LearnCommand._retrieve_ops
File "/Users/mleuschn/Builds/system_venv/venv/lib/python3.9/site-packages/genie/libs/ops/isis/nxos/isis.py", line 397, in learn
self.make()
File "/Users/mleuschn/Builds/system_venv/venv/lib/python3.9/site-packages/genie/ops/base/base.py", line 103, in make
self.maker.make(*args, **kwargs)
File "src/genie/ops/base/maker.py", line 315, in genie.ops.base.maker.Maker.make
File "src/genie/ops/base/maker.py", line 427, in genie.ops.base.maker.Maker._call_parser
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: [['instance', '100', 'vrf', 'default', 'interfaces']]
The text was updated successfully, but these errors were encountered: