Actions
Bug #38469
closedIf installed python packages share names with mgr modules, ceph-mgr loads the wrong thing
% Done:
0%
Source:
Tags:
Backport:
luminous,mimic
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
Before loading each mgr module, ceph-mgr sets python's sys.path to the site-packages directories, followed by the mgr module path. For example:
ceph-mgr[25988]: 2019-02-22 11:06:05.334 7f57f8872b40 10 mgr[py] Computed sys.path '/usr/lib/python36.zip:/usr/lib64/python3.6:/usr/lib64/python3.6:/usr/lib64/python3.6/lib-dynload:/usr/lib64/python3.6/site-packages:/usr/lib/python3.6/site-packages:/usr/local/lib64/python3.6/site-packages:/usr/local/lib/python3.6/site-packages:/usr/lib64/ceph/mgr'
This means that if there's some random python package installed on the system that has the same name as a ceph-mgr module, ceph-mgr will try to load that thing, instead of the actual ceph-mgr module. This will of course fail, and the expected mgr module will not be available (see for example https://github.com/SUSE/DeepSea/pull/1543#issuecomment-466369489).
We can fix this by changing sys.path so the mgr module path comes before the various site-packages directories.
Actions