Project

General

Profile

Actions

Bug #38469

closed

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

Added by Tim Serong about 5 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
ceph-mgr
Target version:
-
% 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.


Related issues 2 (0 open2 closed)

Copied to mgr - Backport #38531: luminous: If installed python packages share names with mgr modules, ceph-mgr loads the wrong thingRejectedActions
Copied to mgr - Backport #38532: mimic: If installed python packages share names with mgr modules, ceph-mgr loads the wrong thingResolvedPrashant DActions
Actions #1

Updated by Tim Serong about 5 years ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 26623
Actions #2

Updated by Sage Weil about 5 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #3

Updated by Nathan Cutler about 5 years ago

  • Tags deleted (luminous,mimic)
  • Backport set to luminous,mimic
Actions #4

Updated by Nathan Cutler about 5 years ago

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

Updated by Nathan Cutler about 5 years ago

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

Updated by Nathan Cutler about 3 years ago

  • Status changed from Pending Backport to Resolved

While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".

Actions

Also available in: Atom PDF