Skip to content

"show system-health summary" crashes due to missing module health_checker. #6104

Closed

Description

@vaibhavhd

Description
system_health script crashes due to missing module health_checker.

Root cause - The system_health library (in sonic-utilities) is Python3 based whereas health_checker (in sonic-buildimage) is still Python2 based:

  File "/usr/local/lib/python3.7/dist-packages/show/system_health.py", line 33, in summary
    from health_checker.manager import HealthCheckerManager
ModuleNotFoundError: No module named 'health_checker'
./usr/local/lib/python2.7/dist-packages/health_checker
./usr/local/lib/python2.7/dist-packages/health_checker/health_checker.py

Steps to reproduce the issue:

  1. Install latest SONiC master image.
  2. After applying fix Use default values for healthd if config file is missing on the device. #6096, the system-health service starts. But show system-health summary throws error.

Describe the results you received:

root@str-s6100-acs-4:~# show system-health summary
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/show/system_health.py", line 21, in summary
    if os.environ["UTILITIES_UNIT_TESTING"] == "1":
  File "/usr/lib/python3.7/os.py", line 678, in __getitem__
    raise KeyError(key) from None
KeyError: 'UTILITIES_UNIT_TESTING'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/show", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/show/system_health.py", line 33, in summary
    from health_checker.manager import HealthCheckerManager
ModuleNotFoundError: No module named 'health_checker'
root@str-s6100-acs-4:~# 

Describe the results you expected:

show system-health summary should not crash.

Activity

  1. vaibhavhd commented on Dec 3, 2020

    @vaibhavhd
    ContributorAuthor

    @jleveque, is there an existing plan/effort to port system-health module to Python3?

    https://github.com/Azure/sonic-buildimage/tree/master/src/system-health

  2. jleveque commented on Dec 3, 2020

    @jleveque
    Contributor

    I already have a PR to do so, but I am waiting for Mellanox to provide a Python 3 sonic-platform package before merging it: #5886. @Junchao-Mellanox and @keboliu are working on the Python 3 sonic-platform package, ETA of later this month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions