#1148903 ceph-mgr fails to startup with: ImportError: PyO3 modules do not yet support subinterpreters

Package:
ceph-mgr
Source:
ceph-mgr
Description:
manager for the ceph distributed file system
Submitter:
Tim Small
Date:
2026-10-16 08:21:02 UTC
Severity:
normal
Tags:
#1148903#5
Date:
2026-09-24 19:12:44 UTC
From:
To:
ceph-mgr fails to start with:

ImportError: PyO3 modules do not yet support subinterpreters, see https://github.com/PyO3/pyo3/issues/576
2026-09-24T08:40:53.923+0100 7fa0bdc6f0c0 -1 mgr[py] Class not found in module 'orchestrator'
2026-09-24T08:40:53.923+0100 7fa0bdc6f0c0 -1 mgr[py] Error loading module 'orchestrator': (22) Invalid argument
2026-09-24T08:40:53.995+0100 7fa0bdc6f0c0 -1 mgr[py] Module not found: 'mgr_module'
2026-09-24T08:40:53.995+0100 7fa0bdc6f0c0 -1 mgr[py] Traceback (most recent call last):
  File "/usr/share/ceph/mgr/mgr_module.py", line 29, in <module>
    from mgr_util import profile_method
  File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
    import bcrypt
  File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
    from ._bcrypt import (
    ...<11 lines>...
    )

This appears to be an upstream bug:

https://github.com/ceph/ceph/pull/67515 etc.

and also impacted Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/ceph/+bug/2150762

#1148903#10
Date:
2026-09-24 19:33:40 UTC
From:
To:
This is effectively a duplicate of #1102751.

The bcrypt import problem can be worked around as shown below. This helps to
get the dashboard running again. I don't know whether it helps or works for
other modules.

Cheers,
sur5r
--- mgr_util.py.orig 2025-04-14 05:01:25.000000000 +0000 +++ mgr_util.py 2025-04-28 08:57:44.246802789 +0000 @@ -3,7 +3,7 @@ if 'UNITTEST' in os.environ: import tests
#1148903#13
Date:
2026-10-16 08:07:01 UTC
From:
To:
Hello,

Bug #1148903 in ceph reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/ceph-team/ceph/-/commit/d57da463e9b1936431cf9dabff44fff9abbee19d
------------------------------------------------------------------------
mgr: replace bcrypt with crypt_r (Closes: #1148903)

PyO3 extensions cannot be imported inside a Python subinterpreter,
which is how ceph-mgr loads its modules, so every mgr module failed
to load with Python 3.13 python3-bcrypt (including the dashboard
module). crypt_r computes the same $2b$ bcrypt hashes, so existing
password hashes keep verifying. The blowfish cost is kept at 12
(rounds=4096 as crypt_r.mksalt expects the literal iteration count)
to match bcrypt.gensalt() defaults, and the dashboard password-hash
import validation now uses a format check instead of bcrypt.checkpw.
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1148903

#1148903#18
Date:
2026-10-16 08:17:07 UTC
From:
To:
Hello,

Bug #1148903 in ceph reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/ceph-team/ceph/-/commit/352f285d5d262e8487f769ae29f9a05d125123f5
------------------------------------------------------------------------
mgr: replace bcrypt with crypt_r (Closes: #1148903)

PyO3 extensions cannot be imported inside a Python subinterpreter,
which is how ceph-mgr loads its modules, so every mgr module failed
to load with Python 3.13 python3-bcrypt (including the dashboard
module). crypt_r computes the same $2b$ bcrypt hashes, so existing
password hashes keep verifying. The blowfish cost is kept at 12
(rounds=4096 as crypt_r.mksalt expects the literal iteration count)
to match bcrypt.gensalt() defaults, and the dashboard password-hash
import validation now uses a format check instead of bcrypt.checkpw.
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1148903

#1148903#21
Date:
2026-10-16 08:18:29 UTC
From:
To:
Hello,

Bug #1148903 in ceph reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/ceph-team/ceph/-/commit/2882399ce729a0d887516b93bf2341371e9e9811
------------------------------------------------------------------------
mgr: replace bcrypt with crypt_r (Closes: #1148903)

PyO3 extensions cannot be imported inside a Python subinterpreter,
which is how ceph-mgr loads its modules, so every mgr module failed
to load with Python 3.13 python3-bcrypt (including the dashboard
module). crypt_r computes the same $2b$ bcrypt hashes, so existing
password hashes keep verifying. The blowfish cost is kept at 12
(rounds=4096 as crypt_r.mksalt expects the literal iteration count)
to match bcrypt.gensalt() defaults, and the dashboard password-hash
import validation now uses a format check instead of bcrypt.checkpw.
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1148903