CiscoTestAutomation / genieparser

sub-component of Genie that parse the device output into structured datastructure
Apache License 2.0
252 stars 387 forks source link

StarOS parsers issue #858

Closed luisantoniovillalobos closed 4 months ago

luisantoniovillalobos commented 5 months ago

Hello team.

I am building a pyats docker container with the last pyats full release.

`# Python Image FROM python:3.10.6

Create working Folder

RUN mkdir /pyats

ENVIRONMENT variables definition

ENV TZ="America/Mexico_City"

ENVIRONMENT VALUE FOR PYATS CONF FILE.

ENV PYATS_CONFIGURATION=/pyats/pyats.conf

Copying python scripts to pyats folder

COPY scripts/ /pyats/

Download latest version of pyats

RUN pip install pyats[full]==24.4

Clone Genie Parsers

RUN cd /pyats/ && git clone https://github.com/CiscoTestAutomation/genieparser.git

Copy StarOS parsers to container

COPY staros/ /pyats/genieparser/src/genie/libs/parser/staros/`

My container has several parsers for starOS and today I noticed a new error regarding my parsers.

2024-05-24T23:42:46: %AETEST-INFO: +------------------------------------------------------------------------------+ 2024-05-24T23:42:46: %AETEST-INFO: | Starting section virtual | 2024-05-24T23:42:46: %AETEST-INFO: +------------------------------------------------------------------------------+ 2024-05-24T23:42:46: %AETEST-ERROR: Caught an exception while executing section virtual: 2024-05-24T23:42:46: %AETEST-ERROR: Traceback (most recent call last): 2024-05-24T23:42:46: %AETEST-ERROR: File "/pyats/staros_basic_healthcheck.py", line 21, in virtual 2024-05-24T23:42:46: %AETEST-ERROR: card_table = device.parse('show card table') 2024-05-24T23:42:46: %AETEST-ERROR: File "src/genie/conf/base/device.py", line 527, in genie.conf.base.device.Device.parse 2024-05-24T23:42:46: %AETEST-ERROR: File "/pyats/genieparser/src/genie/libs/parser/utils/common.py", line 236, in get_parser 2024-05-24T23:42:46: %AETEST-ERROR: raise ParserNotFound(command, tokens) 2024-05-24T23:42:46: %AETEST-ERROR: genie.libs.parser.utils.common.ParserNotFound: Could not find parser for 'show card table' under {'os': ['staros'], 'platform': ['staros'], 'revision': []} 2024-05-24T23:42:46: %AETEST-INFO: The result of section virtual is => ERRORED 2024-05-24T23:42:46: %AETEST-INFO: The result of testcase EVALUATION is => ERRORED

My doubt is why the parsers are not taking effect although I verified with "make develop" and "make json".

`root@af59818caa08:/pyats# cd genieparser/ root@af59818caa08:/pyats/genieparser# make develop


Building and installing genie.libs.parser development distributable: develop

Found existing installation: genie.libs.parser 24.4 Uninstalling genie.libs.parser-24.4: Successfully uninstalled genie.libs.parser-24.4 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv Requirement already satisfied: xmltodict in /usr/local/lib/python3.10/site-packages (0.13.0) Requirement already satisfied: requests in /usr/local/lib/python3.10/site-packages (2.32.2) Requirement already satisfied: netaddr<1.0.0 in /usr/local/lib/python3.10/site-packages (0.10.1) Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/site-packages (from requests) (3.7) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/site-packages (from requests) (2024.2.2) Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/site-packages (from requests) (2.2.1) Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/site-packages (from requests) (3.3.2) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip available: 22.2.1 -> 24.0 [notice] To update, run: pip install --upgrade pip /usr/local/lib/python3.10/site-packages/setuptools/dist.py:286: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated, consider using implicit namespaces instead (PEP 420). warnings.warn(msg, SetuptoolsDeprecationWarning) running develop /usr/local/lib/python3.10/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running egg_info writing src/genie.libs.parser.egg-info/PKG-INFO writing dependency_links to src/genie.libs.parser.egg-info/dependency_links.txt writing namespace_packages to src/genie.libs.parser.egg-info/namespace_packages.txt writing requirements to src/genie.libs.parser.egg-info/requires.txt writing top-level names to src/genie.libs.parser.egg-info/top_level.txt reading manifest file 'src/genie.libs.parser.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '.json' warning: no files found matching '.html' under directory 'src' warning: no previously-included files matching '.dll' found anywhere in distribution warning: no previously-included files matching '.pyc' found anywhere in distribution warning: no previously-included files matching '.pyo' found anywhere in distribution warning: no previously-included files matching '.so' found anywhere in distribution adding license file 'LICENSE' writing manifest file 'src/genie.libs.parser.egg-info/SOURCES.txt' running build_ext Installing /usr/local/lib/python3.10/site-packages/genie.libs.parser-nspkg.pth Creating /usr/local/lib/python3.10/site-packages/genie.libs.parser.egg-link (link to src) Adding genie.libs.parser 24.4 to easy-install.pth file

Installed /pyats/genieparser/src

Completed building and installing: develop

Done.`

`root@af59818caa08:/pyats/genieparser# make json


Generating Parser json file

Done.`

And if I used in my container with an oldest pyats full version 23.11 or 23.10, I have the next error when I launched "make json" under /pyats/genieparser.

`root@04f32dc8e432:/pyats/genieparser# make json


Generating Parser json file

Caught error while executing target in child process-0: target = _worker args = () kwargs = {'payload': (<genie.json.make_json.MakeParsers object at 0x7fc6ac0c37c0>, '/pyats/genieparser/src/../sdk_generator/outputs/github_parser.json')}

Traceback (most recent call last): File "src/pyats/async/parallelcall.py", line 90, in pyats.async.parallelcall.ChildLabor.run File "src/genie/json/make_json.py", line 870, in genie.json.make_json._worker File "src/genie/json/make_json.py", line 211, in genie.json.make_json.MakeParsers.make File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/pyats/genieparser/src/genie/libs/parser/init.py", line 23, in abstract.declare_package(feature='parser') TypeError: declarepackage() got an unexpected keyword argument 'feature' pyats.async.exceptions.RemoteException:

Traceback (most recent call last): File "src/genie/json/make_json.py", line 870, in genie.json.make_json._worker File "src/genie/json/make_json.py", line 211, in genie.json.make_json.MakeParsers.make File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/pyats/genieparser/src/genie/libs/parser/init.py", line 23, in abstract.declare_package(feature='parser') TypeError: declare_package() got an unexpected keyword argument 'feature'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "", line 1, in File "src/genie/json/make_json.py", line 888, in genie.json.make_json.makegenieparser File "src/pyats/async/parallelcall.py", line 157, in pyats.async.parallelcall.Pcall.pcall File "src/pyats/async/parallelcall.py", line 278, in pyats.async.parallelcall.Pcall.join pyats.async.exceptions.ChildProcessException: declare_package() got an unexpected keyword argument 'feature' make: *** [Makefile:235: json] Error 1`

Thanks in advance.

luisantoniovillalobos commented 5 months ago

Hello team. Today I tested my parsers in a container with pyats 23.11 and genieparser 23.11 and my parsers are working properly.

Do you know why with genieparser 24.4 with another pyats versions . It could be 24.4 or lower I am having errors?

Harishv01 commented 5 months ago

Hi,

Please try using version 24.4.3. In this version, we have fixed the issue.

Thank you.

luisantoniovillalobos commented 5 months ago

Hello Harish. I verified the versions installed on my container and are the next ones:

`root@e633db0d794d:/pyats# pyats version check You are currently running pyATS version: 24.4 Python: 3.10.6 [64bit]

Package Version


genie 24.4.3 genie.libs.clean 24.4 genie.libs.conf 24.4 genie.libs.filetransferutils 24.4 genie.libs.health 24.4 genie.libs.ops 24.4 genie.libs.parser 24.4 genie.libs.robot 24.4 genie.libs.sdk 24.4 genie.telemetry 24.4 genie.trafficgen 24.4 pyats 24.4 pyats.aereport 24.4 pyats.aetest 24.4 pyats.async 24.4 pyats.connections 24.4 pyats.contrib 24.4 pyats.datastructures 24.4 pyats.easypy 24.4 pyats.kleenex 24.4 pyats.log 24.4 pyats.reporter 24.4 pyats.results 24.4 pyats.robot 24.4 pyats.tcl 24.4 pyats.topology 24.4 pyats.utils 24.4 rest.connector 24.4 unicon 24.4 unicon.plugins 24.4 yang.connector 24.4`

Also, with the version suggested, I have the same error.

2024-05-30T12:36:52: %AETEST-INFO: +------------------------------------------------------------------------------+ 2024-05-30T12:36:52: %AETEST-INFO: | Starting section virtual | 2024-05-30T12:36:52: %AETEST-INFO: +------------------------------------------------------------------------------+ 2024-05-30T12:36:52: %AETEST-ERROR: Caught an exception while executing section virtual: 2024-05-30T12:36:52: %AETEST-ERROR: Traceback (most recent call last): 2024-05-30T12:36:52: %AETEST-ERROR: File "/pyats/staros_basic_healthcheck.py", line 21, in virtual 2024-05-30T12:36:52: %AETEST-ERROR: card_table = device.parse('show card table') 2024-05-30T12:36:52: %AETEST-ERROR: File "src/genie/conf/base/device.py", line 527, in genie.conf.base.device.Device.parse 2024-05-30T12:36:52: %AETEST-ERROR: File "/usr/local/lib/python3.10/site-packages/genie/libs/parser/utils/common.py", line 236, in get_parser 2024-05-30T12:36:52: %AETEST-ERROR: raise ParserNotFound(command, tokens) 2024-05-30T12:36:52: %AETEST-ERROR: genie.libs.parser.utils.common.ParserNotFound: Could not find parser for 'show card table' under {'os': ['staros'], 'platform': ['staros'], 'revision': []}

Could you help me to verify if the issue resolved on genie 24.4.3 is the same one that I have?

Best Regards

Harishv01 commented 5 months ago

I am unable to see that command in the StarOS. Can you please let me know why you are trying to use a command that is not available? Thank you.

luisantoniovillalobos commented 5 months ago

Hello Harish.

I developed several parsers for StarOS. In a previous pyats and genie release "23.11". Those parser commands were working without issues.

To use those parsers I followed the procedure "make develop" and "make json" to enable my parsers to my personal usage.

The main doubt is why my parsers cannot be used with current "genie" and "pyats" versions.

Harishv01 commented 5 months ago

Could you please share the log that was passed on 23.11?

luisantoniovillalobos commented 5 months ago

Could you please share the log that was passed on 23.11?

Sure, let me do the tests today. Best Regards

luisantoniovillalobos commented 5 months ago

Hello Harish. Below you can find my outputs from a docker container with pyats and genie 23.11. Also, you can find that make develop and make json are working properly. And the most important is that my pasers for staros are below the path "/pyats/genieparser/src/genie/libs/parser/staros".

`root@b4653ccf8da9:/#pyats version check You are currently running pyATS version: 23.11 Python: 3.10.6 [64bit]

Package Version


genie 23.11 genie.libs.clean 23.11 genie.libs.conf 23.11 genie.libs.filetransferutils 23.11 genie.libs.health 23.11 genie.libs.ops 23.11 genie.libs.parser 23.11 genie.libs.sdk 23.11 genie.telemetry 23.11 genie.trafficgen 23.11 pyats 23.11 pyats.aereport 23.11 pyats.aetest 23.11 pyats.async 23.11 pyats.connections 23.11 pyats.contrib 23.11 pyats.datastructures 23.11 pyats.easypy 23.11 pyats.kleenex 23.11 pyats.log 23.11 pyats.reporter 23.11 pyats.results 23.11 pyats.tcl 23.11 pyats.topology 23.11 pyats.utils 23.11 rest.connector 23.11 unicon 23.11 unicon.plugins 23.11 yang.connector 23.11.1

root@b4653ccf8da9:/# pwd / root@b4653ccf8da9:/# ls bin boot dev etc home lib lib64 media mnt opt proc pyats root run sbin srv sys tmp usr var root@b4653ccf8da9:/# cd pyats/genieparser/ root@b4653ccf8da9:/pyats/genieparser# ls DESCRIPTION.rst LICENSE MANIFEST.in Makefile README.md _static changelog sdk_generator setup.py src tests root@b4653ccf8da9:/pyats/genieparser# make develop

Building and installing genie.libs.parser development distributable: develop

Found existing installation: genie.libs.parser 23.11 Uninstalling genie.libs.parser-23.11: Successfully uninstalled genie.libs.parser-23.11 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv Requirement already satisfied: xmltodict in /usr/local/lib/python3.10/site-packages (0.13.0) Requirement already satisfied: requests in /usr/local/lib/python3.10/site-packages (2.31.0) Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/site-packages (from requests) (3.3.2) Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/site-packages (from requests) (3.6) Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/site-packages (from requests) (2.1.0) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/site-packages (from requests) (2023.11.17) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv /usr/local/lib/python3.10/site-packages/setuptools/dist.py:286: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated, consider using implicit namespaces instead (PEP 420). warnings.warn(msg, SetuptoolsDeprecationWarning) running develop /usr/local/lib/python3.10/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running egg_info writing src/genie.libs.parser.egg-info/PKG-INFO writing dependency_links to src/genie.libs.parser.egg-info/dependency_links.txt writing namespace_packages to src/genie.libs.parser.egg-info/namespace_packages.txt writing requirements to src/genie.libs.parser.egg-info/requires.txt writing top-level names to src/genie.libs.parser.egg-info/top_level.txt reading manifest file 'src/genie.libs.parser.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '.json' warning: no files found matching '.html' under directory 'src' warning: no previously-included files matching '.dll' found anywhere in distribution warning: no previously-included files matching '.pyc' found anywhere in distribution warning: no previously-included files matching '.pyo' found anywhere in distribution warning: no previously-included files matching '.so' found anywhere in distribution adding license file 'LICENSE' writing manifest file 'src/genie.libs.parser.egg-info/SOURCES.txt' running build_ext Installing /usr/local/lib/python3.10/site-packages/genie.libs.parser-nspkg.pth Creating /usr/local/lib/python3.10/site-packages/genie.libs.parser.egg-link (link to src) Adding genie.libs.parser 23.11 to easy-install.pth file

Installed /pyats/genieparser/src

Completed building and installing: develop

Done.

root@b4653ccf8da9:/pyats/genieparser# make json


Generating Parser json file

Done.

root@b4653ccf8da9:/pyats/genieparser# ls DESCRIPTION.rst LICENSE MANIFEST.in Makefile README.md _static changelog sdk_generator setup.py src tests root@b4653ccf8da9:/pyats/genieparser# cd src/genie/ root@b4653ccf8da9:/pyats/genieparser/src/genie# ls init.py libs root@b4653ccf8da9:/pyats/genieparser/src/genie# cd libs/ init.py parser/ root@b4653ccf8da9:/pyats/genieparser/src/genie# cd libs/parser/ init.py asa/ comware/ hvrp/ ironware/ parsers.json staros/ yang/ pycache/ base.py dnac/ ios/ junos/ rpd/ template/ aireos/ bigip/ gaia/ iosxe/ linux/ sonic/ utils/ apic/ cheetah/ generic/ iosxr/ nxos/ sros/ viptela/ root@b4653ccf8da9:/pyats/genieparser/src/genie# cd libs/parser/staros/ root@b4653ccf8da9:/pyats/genieparser/src/genie/libs/parser/staros# ls -ltrh total 572K -rwxr-xr-x 1 root root 135 Dec 14 17:28 init.py -rwxr-xr-x 1 root root 13K Dec 14 17:28 show_active-charging_credit-control_statistics.py -rwxr-xr-x 1 root root 6.9K Dec 14 17:28 show_alarm_all.py -rwxr-xr-x 1 root root 2.2K Dec 14 17:28 show_boot.py -rwxr-xr-x 1 root root 2.1K Dec 14 17:28 show_context_all.py -rwxr-xr-x 1 root root 3.4K Dec 14 17:28 show_cpu_table.py -rwxr-xr-x 1 root root 4.8K Dec 14 17:28 show_hd_raid_verbose.py -rwxr-xr-x 1 root root 6.4K Dec 14 17:28 show_ims-auth_sessions_summary.py -rwxr-xr-x 1 root root 11K Dec 14 17:28 show_ntp_status.py -rwxr-xr-x 1 root root 6.2K Dec 14 17:28 show_port_table.py -rwxr-xr-x 1 root root 3.3K Dec 14 17:28 show_port_utilization.py -rwxr-xr-x 1 root root 1.3K Dec 14 17:28 show_power_chassis.py -rwxr-xr-x 1 root root 3.2K Dec 14 17:28 show_resources.py -rwxr-xr-x 1 root root 4.0K Dec 14 17:28 show_service_all.py -rwxr-xr-x 1 root root 26K Dec 14 17:28 show_session_counters_historical_all.py -rwxr-xr-x 1 root root 3.7K Dec 14 17:28 show_session_recovery_status_verbose.py -rwxr-xr-x 1 root root 5.0K Dec 14 17:28 show_snmp_trap.py -rwxr-xr-x 1 root root 6.8K Dec 14 17:28 show_subscribers_summary.py -rwxr-xr-x 1 root root 1.5K Dec 14 17:28 show_system_uptime.py -rwxr-xr-x 1 root root 4.8K Dec 14 17:28 show_task_resources_facility_sessmgr_all.py -rw-r--r-- 1 root root 1.8K Dec 14 23:37 ShowVersion.py -rwxr-xr-x 1 root root 4.9K Dec 27 14:56 show_ip_route.py -rwxr-xr-x 1 root root 33K Jan 1 18:56 'show active-charging ruledef statistics all charging.py' -rwxr-xr-x 1 root root 6.7K Jan 28 22:17 show_session_disconnect.py -rw-r--r-- 1 root root 5.4K Jan 31 16:17 show_session_disconnect_reasons.py -rwxr-xr-x 1 root root 2.7K Feb 5 20:25 show_crash_list.py -rwxr-xr-x 1 root root 3.4K Feb 15 18:57 show_version.py -rw-r--r-- 1 root root 5.4K Feb 26 17:07 show_card_hardware_vpc.py -rwxr-xr-x 1 root root 6.9K Feb 28 13:44 show_bulkstats.py drwxr-xr-x 1 root root 4.0K Mar 14 15:46 tests -rwxr-xr-x 1 root root 2.0K Mar 20 14:23 show_snmp_communities.py -rw-r--r-- 1 root root 8.0K Mar 22 12:48 show_rct_stats.py -rw-r--r-- 1 root root 4.5K Mar 22 13:28 show_cloud_per_dinet.py -rwxr-xr-x 1 root root 4.9K Mar 27 17:15 show_npu.py -rwxr-xr-x 1 root root 4.7K Apr 3 12:33 show_card_hardware.py -rw-r--r-- 1 root root 37K Apr 3 17:06 show_session_progress.py -rw-r--r-- 1 root root 1.9K Apr 4 11:37 show_session_duration.py -rw-r--r-- 1 root root 16K Apr 4 16:26 show_snmp_notifies.py -rw-r--r-- 1 root root 3.7K Apr 5 13:06 show_diameter_tps_statistics.py -rw-r--r-- 1 root root 3.5K Apr 10 16:13 show_active-charging_credit-control_session-states.py -rw-r--r-- 1 root root 4.7K Apr 10 16:15 show_gtpp_counters_all.py -rwxr-xr-x 1 root root 2.9K Apr 12 16:37 show_temperature.py -rwxr-xr-x 1 root root 3.2K Apr 12 19:18 show_card_table.py -rw-r--r-- 1 root root 13K Apr 16 12:01 show_cloud_preformance_summary.py -rwxr-xr-x 1 root root 3.3K Apr 16 15:45 show_fans.py -rw-r--r-- 1 root root 4.1K Apr 16 15:46 show_fan.py -rwxr-xr-x 1 root root 5.6K Apr 16 18:11 show_link-aggregation_table.py -rwxr-xr-x 1 root root 21K Apr 24 14:35 show_license_info.py -rw-r--r-- 1 root root 92K May 2 16:19 show_task_resources.py -rw-r--r-- 1 root root 35K May 14 15:44 show_config_errors_verbose.py -rwxr-xr-x 1 root root 12K May 14 15:51 show_diameter_peers_full.py drwxr-xr-x 1 root root 4.0K May 14 16:01 pycache root@b4653ccf8da9:/pyats/genieparser/src/genie/libs/parser/staros# `

Harishv01 commented 5 months ago

Could you please share the complete Dockerfile and the entire log of the Dockerfile execution? Also, could you let me know if the ‘make develop’ and ‘make json’ commands are present in the Dockerfile?

luisantoniovillalobos commented 5 months ago

Hello Hariv. You can find my project on the internal github. https://wwwin-github.cisco.com/luisvill/pyATS_Healtcheck

I have created a pyats version 23.11 already working with my container that are working properly. To illustrate creating a new container with pyats 23.11, I created a new image called pyats2311.

If I defined my dockerfile with make develop and make json, I am having an error. So, my dockerfile doesn´t have enabled make develop and make json in it.

Attached you can find the complete logs. Logs.txt

Thanks in advance.

luisantoniovillalobos commented 5 months ago

And also, if I defined my pyats container with pyats version 24.4, I am having the errors commented previously.

2024-05-24T23:42:46: %AETEST-INFO: +------------------------------------------------------------------------------+ 2024-05-24T23:42:46: %AETEST-INFO: | Starting section virtual | 2024-05-24T23:42:46: %AETEST-INFO: +------------------------------------------------------------------------------+ 2024-05-24T23:42:46: %AETEST-ERROR: Caught an exception while executing section virtual: 2024-05-24T23:42:46: %AETEST-ERROR: Traceback (most recent call last): 2024-05-24T23:42:46: %AETEST-ERROR: File "/pyats/staros_basic_healthcheck.py", line 21, in virtual 2024-05-24T23:42:46: %AETEST-ERROR: card_table = device.parse('show card table') 2024-05-24T23:42:46: %AETEST-ERROR: File "src/genie/conf/base/device.py", line 527, in genie.conf.base.device.Device.parse 2024-05-24T23:42:46: %AETEST-ERROR: File "/pyats/genieparser/src/genie/libs/parser/utils/common.py", line 236, in get_parser 2024-05-24T23:42:46: %AETEST-ERROR: raise ParserNotFound(command, tokens) 2024-05-24T23:42:46: %AETEST-ERROR: genie.libs.parser.utils.common.ParserNotFound: Could not find parser for 'show card table' under {'os': ['staros'], 'platform': ['staros'], 'revision': []} 2024-05-24T23:42:46: %AETEST-INFO: The result of section virtual is => ERRORED 2024-05-24T23:42:46: %AETEST-INFO: The result of testcase EVALUATION is => ERRORED

Harishv01 commented 5 months ago

I am able to see 23.11 in the Dockerfile. There was an error of TypeError: declare_package() got an unexpected keyword argument 'feature', but we have fixed it in the latest versions. Kindly install pyats version 24.5 and try again.

luisantoniovillalobos commented 5 months ago

Hello Harish.

I tried with the latest version I am still seeing the same error reported in the beginning.

2024-06-05T16:28:55: %AETEST-INFO: +------------------------------------------------------------------------------+ 2024-06-05T16:28:55: %AETEST-INFO: | Starting section virtual | 2024-06-05T16:28:55: %AETEST-INFO: +------------------------------------------------------------------------------+ 2024-06-05T16:28:55: %AETEST-ERROR: Caught an exception while executing section virtual: 2024-06-05T16:28:55: %AETEST-ERROR: Traceback (most recent call last): 2024-06-05T16:28:55: %AETEST-ERROR: File "/pyats/staros_basic_healthcheck.py", line 21, in virtual 2024-06-05T16:28:55: %AETEST-ERROR: card_table = device.parse('show card table') 2024-06-05T16:28:55: %AETEST-ERROR: File "src/genie/conf/base/device.py", line 527, in genie.conf.base.device.Device.parse 2024-06-05T16:28:55: %AETEST-ERROR: File "/pyats/genieparser/src/genie/libs/parser/utils/common.py", line 236, in get_parser 2024-06-05T16:28:55: %AETEST-ERROR: raise ParserNotFound(command, tokens) 2024-06-05T16:28:55: %AETEST-ERROR: genie.libs.parser.utils.common.ParserNotFound: Could not find parser for 'show card table' under {'os': ['staros'], 'platform': ['staros'], 'revision': []} 2024-06-05T16:28:55: %AETEST-INFO: The result of section virtual is => ERRORED 2024-06-05T16:28:55: %AETEST-INFO: The result of testcase EVALUATION is => ERRORED

Attached you can find the complete log that shows installation and execution. Log245.txt

Best Regards

Harishv01 commented 5 months ago

Hi,

Please run make clean, make develop, and make json and try it again.

Thank you.

luisantoniovillalobos commented 5 months ago

Hello Harish.

Same issue. I think that there is an error with the genie config due to my parsers are not recognized.

Log245_2.txt

Best Regards

Harishv01 commented 5 months ago

Hi,

Please let me know in the Webex when you are available so that we can connect and resolve it.

Thank you.

luisantoniovillalobos commented 5 months ago

Hello Hariv.

Thanks for your time, and sorry for my delay.

As far as I understand you. I cloned oficial pyats repo into my container under /pyats existing path.

root@258ddb730927:/pyats# git clone https://github.com/CiscoTestAutomation/pyats.git Cloning into 'pyats'... remote: Enumerating objects: 1586, done. remote: Counting objects: 100% (509/509), done. remote: Compressing objects: 100% (241/241), done. remote: Total 1586 (delta 305), reused 376 (delta 264), pack-reused 1077 Receiving objects: 100% (1586/1586), 2.07 MiB | 2.81 MiB/s, done. Resolving deltas: 100% (925/925), done. root@258ddb730927:/pyats# ls HC_ASR.py pycache genieparser my_testbed.yaml pyats staros_basic_healthcheck.py

I am not understanding in which directory I should paste again my parsers due to those ones are already below /pyats/genieparser/src/genie/libs/parser/staros.

root@258ddb730927:/pyats/genieparser# cd src/genie/libs/parser/staros/ root@258ddb730927:/pyats/genieparser/src/genie/libs/parser/staros# ls ShowVersion.py show_diameter_peers_full.py show_session_counters_historical_all.py init.py show_diameter_tps_statistics.py show_session_disconnect.py pycache show_fan.py show_session_disconnect_reasons.py 'show active-charging ruledef statistics all charging.py' show_fans.py show_session_duration.py show_active-charging_credit-control_session-states.py show_gtpp_counters_all.py show_session_progress.py show_active-charging_credit-control_statistics.py show_hd_raid_verbose.py show_session_recovery_status_verbose.py show_alarm_all.py show_ims-auth_sessions_summary.py show_snmp_communities.py show_boot.py show_ip_route.py show_snmp_notifies.py show_bulkstats.py show_license_info.py show_snmp_trap.py show_card_hardware.py show_link-aggregation_table.py show_subscribers_summary.py show_card_hardware_vpc.py show_npu.py show_system_uptime.py show_card_table.py show_ntp_status.py show_task_resources.py show_cloud_per_dinet.py show_port_table.py show_task_resources_facility_sessmgr_all.py show_cloud_preformance_summary.py show_port_utilization.py show_temperature.py show_config_errors_verbose.py show_power_chassis.py show_version.py show_context_all.py show_rct_stats.py tests show_cpu_table.py show_resources.py show_crash_list.py show_service_all.py

Could you clarify with me under wich path do I need to paste my parsers, please?

Harishv01 commented 5 months ago

Under Staros, you need to paste your parses. After this, please run "make clean", "make develop", "make json" and try again.

luisantoniovillalobos commented 5 months ago

Hello Hariv.

Thanks for your time today. According to oyr conversation, you need new tests to verify what are the parser commands that are not working.

Could you confirm the tests that you need, please?

Best Regards

Harishv01 commented 5 months ago

Hi, I requested that you raise the draft PR by adding all the files and share it with me. I will test it from my end. Thank you.

Harishv01 commented 5 months ago

You shared some details. I will go through them and get back to you.

Thank you.

Harishv01 commented 5 months ago

I don't have access to clone the repo.Also update the branch to the latest version, i.e., 24.5

(devat) sjc-ads-8829:/nobackup/hyv/workspace/parser > git clone [git@github.com](mailto:git@github.com):apatino18/genieparser.git
Cloning into 'genieparser'...
The authenticity of host 'github.com ([140.82.116.3](https://140.82.116.3/))' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com,140.82.116.3' (ECDSA) to the list of known hosts.
[git@github.com](mailto:git@github.com): Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
Harishv01 commented 5 months ago

I will add one of the parsers to my branch. I will check whether it will work for me or not.

Thank you.

Harishv01 commented 5 months ago

I don't have access to clone the repo.Also, update the branch to the latest version

Harishv01 commented 4 months ago

Hi, Can you please provide an update on the above? Thank you.

luisantoniovillalobos commented 4 months ago

Hello Harish.

According to our last conversation on webex you will test the StarOS commands cloning the repo from the repo taht I shared with you. If I need to consider another thing or I am confused, let me know.

Best Regards

Harishv01 commented 4 months ago

I don't have access to clone the repo you shared. So, I added the comment above to request permission to clone your repo. I also informed you to update the branch to the latest version.

luisantoniovillalobos commented 4 months ago

Hello Harish.

I shared with you two internal repos where you can find the starOS parsers.

Best Regards

Harishv01 commented 4 months ago

Hi, I have raised a PR for this issue. I will let you know once it's merged.

Thank you.

Harishv01 commented 4 months ago

Hi,

The PR has been merged and the fix will be available in the next version. Therefore, I am closing the issue.

Thank you.