Skip to content
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.metaparser.util.exceptions.SchemaMissingKeyError: Show Command: show spanning-tree #110

Open
xjs678qr opened this issue Aug 25, 2022 · 5 comments
Assignees

Comments

@xjs678qr
Copy link

Hi,

I encounter some missing key exceptions on the 'stp' model (Stp.Learn) for IOS-XE (running 17.3.4)

Missing keys: [['rapid_pvst', 'vlans', 2135, 'interfaces'], ['rapid_pvst', 'vlans', 2140, 'interfaces'], ['rapid_pvst', 'vlans', 2145, 'interfaces'], ['rapid_pvst', 'vlans', 2151, 'interfaces'], ['rapid_pvst', 'vlans', 2157, 'interfaces'], ['rapid_pvst', 'vlans', 2160, 'interfaces'], ['rapid_pvst', 'vlans', 3346, 'interfaces']]

Caught error while executing target in child process-4:

@stevedhn
Copy link

Hi, i think the pattern is matched from the device output is not matching the output schema. You can start investigating from there, or you can share the device output with us and the commands you used.

@stevedhn stevedhn self-assigned this Aug 25, 2022
@xjs678qr
Copy link
Author

Hi,

I can reproduce with the following command:
genie learn stp --testbed Testbed.yaml --output STP

This is the beginning of the exception file (it's very long, I can send it to you in private if you prefer).

Issue while parsing: <class 'genie.libs.parser.iosxe.show_spanning_tree.ShowSpanningTreeDetail'>

Traceback (most recent call last):
  File "src/genie/cli/commands/learn.py", line 365, in genie.cli.commands.learn.LearnCommand._retrieve_ops
  File "/home/swina/genie/genie-venv/lib/python3.10/site-packages/genie/libs/ops/stp/iosxe/stp.py", line 128, in learn
    self.make(final_call=True)
  File "/home/swina/genie/genie-venv/lib/python3.10/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: Show Command: show spanning-tree detail
Missing keys: [['rapid_pvst', 'vlans', 1, 'interfaces', 'GigabitEthernet5/0/19', 'link_type'], [...

I can also provide you the full command output in private if desired. Please find a sample:

#sh spanning-tree detail

 VLAN0001 is executing the rstp compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, sysid 1, address 00ee.ab8f.0a00
  Configured hello time 2, max age 20, forward delay 15, transmit hold-count 6
  We are the root of the spanning tree
  Topology change flag not set, detected flag not set
  Number of topology changes 17 last change occurred 12w3d ago
          from Port-channel2
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0, aging 300

 Port 203 (AppGigabitEthernet3/0/1) of VLAN0001 is designated forwarding
   Port path cost 4, Port priority 128, Port Identifier 128.203.
   Designated root has priority 32769, address 00ee.ab8f.0a00
   Designated bridge has priority 32769, address 00ee.ab8f.0a00
   Designated port id is 128.203, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 8998667, received 0

 Port 403 (GigabitEthernet5/0/19) of VLAN0001 is designated forwarding
   Port path cost 4, Port priority 128, Port Identifier 128.403.
   Designated root has priority 32769, address 00ee.ab8f.0a00
   Designated bridge has priority 32769, address 00ee.ab8f.0a00
   Designated port id is 128.403, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   The port is in the portfast mode by portfast trunk configuration
   Link type is point-to-point
   Root guard is enabled on the port
   BPDU: sent 8998636, received 0

 Port 2474 (Port-channel2) of VLAN0001 is designated forwarding
   Port path cost 1, Port priority 128, Port Identifier 128.2474.
   Designated root has priority 32769, address 00ee.ab8f.0a00
   Designated bridge has priority 32769, address 00ee.ab8f.0a00
   Designated port id is 128.2474, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point
   BPDU: sent 8996657, received 37

@stevedhn
Copy link

Hi, can you send me the testbed file via [email protected]?

@xjs678qr
Copy link
Author

Hi, can you send me the testbed file via [email protected]?

Done!

@stevedhn
Copy link

stevedhn commented Sep 29, 2022

Hi sorry for the late response, so far the issue relates to the parser show spanning-tree detail, as the parser library is community-driven, we recommend you to try modifying this parser to match your needs.
https://pubhub.devnetcloud.com/media/genie-feature-browser/docs/#/parsers/show%2520spanning-tree%2520detail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants