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

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

Closed
vaibhavhd opened this issue Dec 2, 2020 · 2 comments · Fixed by #5886
Closed

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

vaibhavhd opened this issue Dec 2, 2020 · 2 comments · Fixed by #5886

Comments

@vaibhavhd
Copy link
Contributor

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.

@vaibhavhd
Copy link
Contributor Author

@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

@jleveque
Copy link
Contributor

jleveque commented Dec 3, 2020

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants