Project

General

Profile

Bug #38469

If installed python packages share names with mgr modules, ceph-mgr loads the wrong thing

Added by Tim Serong 4 months ago. Updated 4 months ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
Category:
ceph-mgr
Target version:
-
Start date:
02/25/2019
Due date:
% Done:

0%

Source:
Tags:
Backport:
luminous,mimic
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

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.


Related issues

Copied to mgr - Backport #38531: luminous: If installed python packages share names with mgr modules, ceph-mgr loads the wrong thing New
Copied to mgr - Backport #38532: mimic: If installed python packages share names with mgr modules, ceph-mgr loads the wrong thing Resolved

History

#1 Updated by Tim Serong 4 months ago

  • Status changed from New to Need Review
  • Pull request ID set to 26623

#2 Updated by Sage Weil 4 months ago

  • Status changed from Need Review to Pending Backport

#3 Updated by Nathan Cutler 4 months ago

  • Tags deleted (luminous,mimic)
  • Backport set to luminous,mimic

#4 Updated by Nathan Cutler 4 months ago

  • Copied to Backport #38531: luminous: If installed python packages share names with mgr modules, ceph-mgr loads the wrong thing added

#5 Updated by Nathan Cutler 4 months ago

  • Copied to Backport #38532: mimic: If installed python packages share names with mgr modules, ceph-mgr loads the wrong thing added

Also available in: Atom PDF