bcrypt icon indicating copy to clipboard operation
bcrypt copied to clipboard

[4.1.1] ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process

Open hswong3i opened this issue 1 year ago • 18 comments

Similar as https://github.com/pyca/cryptography/issues/9016, my ceph-mgr in 18.2.1 get error message once upgrade from bcrypt 4.0.1 to 4.1.1:

root@node12:~# ceph health detail
HEALTH_WARN 9 mgr modules have failed dependencies
[WRN] MGR_MODULE_DEPENDENCY: 9 mgr modules have failed dependencies
   Module 'balancer' has failed dependency: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
   Module 'crash' has failed dependency: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
   Module 'devicehealth' has failed dependency: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
   Module 'orchestrator' has failed dependency: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
   Module 'pg_autoscaler' has failed dependency: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
   Module 'progress' has failed dependency: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
   Module 'rbd_support' has failed dependency: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
   Module 'telemetry' has failed dependency: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
   Module 'volumes' has failed dependency: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process

root@node12:~# journalctl -xef -u [email protected] 
Dec 12 03:41:13 node12 systemd[1]: Started Ceph cluster manager daemon.
░░ Subject: A start job for unit [email protected] has finished successfully
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit [email protected] has finished successfully.
░░ 
░░ The job identifier is 37868.
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.178+0000 7fc8359f5280 -1 mgr[py] Module status has missing NOTIFY_TYPES member
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.314+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.314+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:14 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.314+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'mirroring'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.314+0000 7fc8359f5280 -1 mgr[py] Error loading module 'mirroring': (22) Invalid argument
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.446+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.446+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:14 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.446+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'orchestrator'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.446+0000 7fc8359f5280 -1 mgr[py] Error loading module 'orchestrator': (22) Invalid argument
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.542+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.542+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:14 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.542+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'nfs'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.542+0000 7fc8359f5280 -1 mgr[py] Error loading module 'nfs': (22) Invalid argument
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.642+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.642+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:14 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.642+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'prometheus'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.642+0000 7fc8359f5280 -1 mgr[py] Error loading module 'prometheus': (22) Invalid argument
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.738+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.738+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:14 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.738+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'volumes'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.738+0000 7fc8359f5280 -1 mgr[py] Error loading module 'volumes': (22) Invalid argument
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.834+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.834+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:14 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.834+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'iostat'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.834+0000 7fc8359f5280 -1 mgr[py] Error loading module 'iostat': (22) Invalid argument
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.930+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.930+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:14 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:14 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:14 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.930+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'crash'
Dec 12 03:41:14 node12 ceph-mgr[3265527]: 2023-12-12T03:41:14.930+0000 7fc8359f5280 -1 mgr[py] Error loading module 'crash': (22) Invalid argument
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.026+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.026+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:15 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.026+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'devicehealth'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.026+0000 7fc8359f5280 -1 mgr[py] Error loading module 'devicehealth': (22) Invalid argument
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.122+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.122+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:15 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.122+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'osd_support'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.122+0000 7fc8359f5280 -1 mgr[py] Error loading module 'osd_support': (22) Invalid argument
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.218+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.218+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:15 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.218+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'restful'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.218+0000 7fc8359f5280 -1 mgr[py] Error loading module 'restful': (22) Invalid argument
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.318+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.318+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:15 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.318+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'localpool'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.318+0000 7fc8359f5280 -1 mgr[py] Error loading module 'localpool': (22) Invalid argument
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.418+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.418+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:15 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.418+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'pg_autoscaler'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.418+0000 7fc8359f5280 -1 mgr[py] Error loading module 'pg_autoscaler': (22) Invalid argument
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.518+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.518+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:15 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.518+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'zabbix'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.518+0000 7fc8359f5280 -1 mgr[py] Error loading module 'zabbix': (22) Invalid argument
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.618+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.618+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:15 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.622+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'snap_schedule'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.622+0000 7fc8359f5280 -1 mgr[py] Error loading module 'snap_schedule': (22) Invalid argument
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.718+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.718+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:15 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.718+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'test_orchestrator'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.722+0000 7fc8359f5280 -1 mgr[py] Error loading module 'test_orchestrator': (22) Invalid argument
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.838+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.838+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:15 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.838+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'stats'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.838+0000 7fc8359f5280 -1 mgr[py] Error loading module 'stats': (22) Invalid argument
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.950+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.950+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:15 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:15 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:15 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.950+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'progress'
Dec 12 03:41:15 node12 ceph-mgr[3265527]: 2023-12-12T03:41:15.950+0000 7fc8359f5280 -1 mgr[py] Error loading module 'progress': (22) Invalid argument
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.050+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.050+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:16 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.050+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'telemetry'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.050+0000 7fc8359f5280 -1 mgr[py] Error loading module 'telemetry': (22) Invalid argument
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.150+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.150+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:16 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.154+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'influx'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.154+0000 7fc8359f5280 -1 mgr[py] Error loading module 'influx': (22) Invalid argument
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.254+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.254+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:16 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.254+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'telegraf'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.254+0000 7fc8359f5280 -1 mgr[py] Error loading module 'telegraf': (22) Invalid argument
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.358+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.358+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:16 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.358+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'osd_perf_query'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.358+0000 7fc8359f5280 -1 mgr[py] Error loading module 'osd_perf_query': (22) Invalid argument
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.458+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.458+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:16 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.458+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'selftest'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.458+0000 7fc8359f5280 -1 mgr[py] Error loading module 'selftest': (22) Invalid argument
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.554+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.554+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:16 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.558+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'insights'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.558+0000 7fc8359f5280 -1 mgr[py] Error loading module 'insights': (22) Invalid argument
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.650+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.650+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:16 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.654+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'alerts'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.654+0000 7fc8359f5280 -1 mgr[py] Error loading module 'alerts': (22) Invalid argument
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.746+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.746+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:16 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.746+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'balancer'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.746+0000 7fc8359f5280 -1 mgr[py] Error loading module 'balancer': (22) Invalid argument
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.842+0000 7fc8359f5280 -1 mgr[py] Module not found: 'mgr_module'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.842+0000 7fc8359f5280 -1 mgr[py] Traceback (most recent call last):
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from mgr_util import profile_method
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     import bcrypt
Dec 12 03:41:16 node12 ceph-mgr[3265527]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 12 03:41:16 node12 ceph-mgr[3265527]:     from ._bcrypt import (
Dec 12 03:41:16 node12 ceph-mgr[3265527]: ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.842+0000 7fc8359f5280 -1 mgr[py] Class not found in module 'rbd_support'
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.842+0000 7fc8359f5280 -1 mgr[py] Error loading module 'rbd_support': (22) Invalid argument
Dec 12 03:41:16 node12 ceph-mgr[3265527]: 2023-12-12T03:41:16.842+0000 7fc8359f5280 -1 log_channel(cluster) log [ERR] : Failed to load ceph-mgr modules: mirroring, orchestrator, nfs, prometheus, volumes, iostat, crash, devicehealth, osd_support, restful, localpool, pg_autoscaler, zabbix, snap_schedule, test_orchestrator, stats, progress, telemetry, influx, telegraf, osd_perf_query, selftest, insights, alerts, balancer, rbd_support

This was initially introduced by:

  • https://github.com/pyca/bcrypt/commit/5505d32273cb00ccb4841d0a7511f88f6e5c261c, bump pyo3 from 0.15.2 to 0.18.3
  • https://github.com/PyO3/pyo3/commit/78ba70d2b4cdae1228561700bab62da793801d18, only allow each #[pymodule] to be initialized once, when pyo3 >= 0.17.0

My only workaround for now is, revert back to bcrypt == 4.0.1, which still depends on pyo3 = { version = "0.15.2" }

hswong3i avatar Dec 12 '23 04:12 hswong3i

I'm not familiar with how ceph is implemented, is there an obvious reason why it'd be initializing modules multiple times per process? Does it use subinterpreters?

alex avatar Dec 12 '23 13:12 alex

From my point of view, case should as similar as https://github.com/pyca/cryptography/issues/9016#issuecomment-1589003489.

BTW now I could combine both Ceph 18.2.1 + python3-cryptography 41.0.7 + python3-bcrypt 4.0.1 without error; the error only happen when running with bcrypt >= 4.1.0.

Therefore I guess bcrypt should reference some handling from cryptography between 41.0.1..41.0.7 for preventing multiple initialization?

hswong3i avatar Dec 12 '23 14:12 hswong3i

Hmm, so the problem requires using both cryptography 41.0.7 and bcrypt 4.1.1? This is very confusing, and I can't imagine what cross-package interaction would be.

On Tue, Dec 12, 2023 at 9:24 AM Wong Hoi Sing Edison < @.***> wrote:

From my point of view, case should as similar pyca/cryptography#9016 (comment) https://github.com/pyca/cryptography/issues/9016#issuecomment-1589003489 .

BTW now I could combine both Ceph 18.2.1 + python3-cryptography 41.0.7 + python3-bcrypt 4.0.1 without error; the error only happen when running with bcrypt >= 4.1.0.

Therefore I guess bcrypt should reference some handling from cryptography between 41.0.1..41.0.7 for preventing multiple initialization?

— Reply to this email directly, view it on GitHub https://github.com/pyca/bcrypt/issues/694#issuecomment-1852137080, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAGBBWCEFUH7YKSX35JLLYJBSKDAVCNFSM6AAAAABAQ2VAX2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJSGEZTOMBYGA . You are receiving this because you commented.Message ID: @.***>

-- All that is necessary for evil to succeed is for good people to do nothing.

alex avatar Dec 12 '23 14:12 alex

The case with Ceph 18.2.1 are:

  • OK: cryptography 40.0.2 + bcrypt 4.0.1
  • OK: cryptography 41.0.7 + bcrypt 4.0.1
  • FAILED: cryptography 40.0.2 + bcrypt 4.1.1
  • FAILED: cryptography 41.0.7 + bcrypt 4.1.1

Original report for Ceph 18.2.1 + cryptography 41.0.x could be found from:

  • https://tracker.ceph.com/issues/63529
  • https://github.com/bazaah/aur-ceph/issues/20
  • https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1055212

BTW as above cross check shown, now cryptography no longer become the root cause, but coming from bcrypt ;-(

hswong3i avatar Dec 12 '23 14:12 hswong3i

Is it straightforward for me to reproduce this locally, or do I need a full ceph installation?

alex avatar Dec 12 '23 14:12 alex

I have a Vagrant Box for Ceph 18.2: https://app.vagrantup.com/alvistack/boxes/ceph-18.2

It is now rebuilding with my latest functional combination (i.e. cryptography 41.0.7 + bcrypt 4.0.1): https://gitlab.com/alvistack/vagrant-ceph/-/pipelines/1103864469

If you are using VirtualBox (see https://github.com/alvistack/vagrant-ceph#quick-start):

# Initialize Vagrant
cat > Vagrantfile <<-EOF
Vagrant.configure('2') do |config|
  config.vm.hostname = 'ceph-18.2'
  config.vm.box = 'alvistack/ceph-18.2'

  config.vm.provider :virtualbox do |virtualbox|
    config.vm.disk :disk, name: 'sdb', size: '10GB'
    virtualbox.cpus = 2
    virtualbox.customize ['modifyvm', :id, '--cpu-profile', 'host']
    virtualbox.customize ['modifyvm', :id, '--nested-hw-virt', 'on']
    virtualbox.memory = 8192
  end
end
EOF

# Start the virtual machine
export VAGRANT_EXPERIMENTAL='1'
vagrant up

# SSH into this machine
vagrant ssh

Once the box is up and running:

  • vagrant ssh then sudo su - as root
  • Check with ceph -s, now should showing HEALTH_OK
  • Manually upgrade the preinstalled bcrypt 4.0.1 under /usr/lib/python3/dist-packages/bcrypt into 4.1.1
  • Reboot the box
  • Once login as root again and check with ceph -s, now it should show HEALTH_WARN 9 mgr modules have failed dependencies
  • With journalctl -xef -u ceph-mgr@* you should able to get the error log as show above

hswong3i avatar Dec 12 '23 14:12 hswong3i

If I built a custom wheel, would you be able to test that out and see if you can reproduce?

alex avatar Dec 12 '23 15:12 alex

If I built a custom wheel, would you be able to test that out and see if you can reproduce?

Or you may provide your forked GitHub branch, so I could keep rebuilding and testing with it in my local dev env?

hswong3i avatar Dec 12 '23 15:12 hswong3i

https://github.com/pyca/bcrypt/pull/695 -- you can either download a wheel from the wheel-builder job, or you can build yourself from that branch.

alex avatar Dec 12 '23 15:12 alex

@alex my quick check and report:

For the last case, the new error message is now:

Dec 13 06:41:15 node12 ceph-mgr[17264]: 2023-12-13T06:41:15.339+0000 7f3d7e793280 -1 mgr[py] Module status has missing NOTIFY_TYPES member
Dec 13 06:41:15 node12 ceph-mgr[17264]: 2023-12-13T06:41:15.479+0000 7f3d7e793280 -1 mgr[py] Module not found: 'mgr_module'
Dec 13 06:41:15 node12 ceph-mgr[17264]: 2023-12-13T06:41:15.479+0000 7f3d7e793280 -1 mgr[py] Traceback (most recent call last):
Dec 13 06:41:15 node12 ceph-mgr[17264]:   File "/usr/share/ceph/mgr/mgr_module.py", line 28, in <module>
Dec 13 06:41:15 node12 ceph-mgr[17264]:     from mgr_util import profile_method
Dec 13 06:41:15 node12 ceph-mgr[17264]:   File "/usr/share/ceph/mgr/mgr_util.py", line 6, in <module>
Dec 13 06:41:15 node12 ceph-mgr[17264]:     import bcrypt
Dec 13 06:41:15 node12 ceph-mgr[17264]:   File "/lib/python3/dist-packages/bcrypt/__init__.py", line 13, in <module>
Dec 13 06:41:15 node12 ceph-mgr[17264]:     from ._bcrypt import (
Dec 13 06:41:15 node12 ceph-mgr[17264]: ImportError: PyO3 modules do not yet support subinterpreters, see https://github.com/PyO3/pyo3/issues/576

See https://github.com/PyO3/pyo3/issues/576

hswong3i avatar Dec 13 '23 06:12 hswong3i

Hmm, on the one hand, if ceph really is using subinterpreters, there's nothing we can do.

On the other hand, the fact that this error is showing up only with certain version combinations suggestions there's a deeper bug here. I'm afraid I don't have a suggestion other than that we really need a minimal reproducer here, something smaller than all of ceph.

alex avatar Dec 13 '23 12:12 alex

Ceph really does use subinterpreters. It also used to work on my system (F39) after a patch to remove cryptography as a dependency, but now it's failing again with a larger update.

My suspicion is the check for multiple instances itself is/was somehow flawed and doesn't always go off (or used not to), but Ceph has always been using subinterpretrs.

Ceph bug: https://tracker.ceph.com/issues/63529 Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=2255688

marcan avatar May 14 '24 09:05 marcan

Yes. I have, in effect, vendored a rebuild of python-bcrypt with:

diff --git a/src/_bcrypt/Cargo.toml b/src/_bcrypt/Cargo.toml
index a9c7f7c..02317c8 100644
--- a/src/_bcrypt/Cargo.toml
+++ b/src/_bcrypt/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2018"
 publish = false

 [dependencies]
-pyo3 = { version = "0.20.0", features = ["abi3"] }
+pyo3 = { git = "https://git.st8l.com/luxolus/pyo3", tag = "v0.20.3-subint+1", features = ["abi3", "unsafe-allow-subinterpreters"] }
 bcrypt = "0.15"
 bcrypt-pbkdf = "0.10.0"
 base64 = "0.21.5"

https://git.st8l.com/luxolus/pyo3/commit/338c71d0ad10f7ae38b7b44e576d49b91ed20d99

Which is possible because this python module doesn't store Py objects in Rust statics. The dashboard remains broken, because other packages still use pyO3 modules, but the mgr's core functionality is operational.

bazaah avatar May 22 '24 19:05 bazaah

For reference, in case anyone's stumbling over this issue, adding sub-interpreter support in PyO3 is being worked on over here: https://github.com/PyO3/pyo3/issues/3451

The Ceph folks that commented here (hi again!) are already aware of this; just wanted to leave some breadcrumbs for others to follow in case anyone's interested in helping out as well.

Aequitosh avatar May 24 '24 11:05 Aequitosh

One possible work-around is to simply disable the error check that is causing this, and to allow unsafe operation. This is done in this commit: https://github.com/zer0def/pyo3/commit/eba5243197995f6b37bef491f36d5a1ad0ee03e3

I've made a collection of a small subset of the various distros and users affected by this bug; search engines show a bottomless network of discussion. https://github.com/pyca/cryptography/issues/12080

The final comment is this:

Subinterpreters have a long and checkered history in Python and projects that consume them ultimately need to either minimize their deps to only those who explicitly claim support or work with upstreams to create such support.

I conclude there are three or 4 solutions:

  • Convince python/crypto folks to stop using PyO3
  • Apply the PyO3 patch to allow unsafe operation
  • Rewrite Ceph to not use subinterpreters
  • Rewrite Ceph to not use python crypto
  • Find a corporation with development manager with budgetary disgression to hire a coder who can fix the underlying issue in PyO3
  • Convince the assorted distros (Debian, in my case) to downgrade to earlier versions where things worked.

All of these are unpleasant and distasteful solutions. Based on the quoted comment, I'm thinking that Ceph's use of python subinterpreters was a fundamental design flaw, and that meanwhile PyO3 is just broken and has been unwilling/unable to fix whatever design issue that they have with subinterpreters. It's been 14-15 months since this surfaced on the zillions of issue trackers and support forums, and there's been no forward progress. It's a halt-dead-stop blocker issue for ceph-dashboard, which apparently no one uses, based on general discussions on assorted forums.

linas avatar Dec 01 '24 23:12 linas

Hi guys. I am testing the new Ceph Squid version on ubuntu 24.04.1. The bug with ceph dashboard is still there. So still no way to make it work. There will be good news very soon I hope. THANKS. Capture d’écran du 2024-12-12 11-10-10

moula avatar Dec 12 '24 10:12 moula

Hi all!

Looks like this bug is still there and it affects me as well. Is there any plan to fix it?

Image

kpoos avatar Feb 13 '25 17:02 kpoos

You can follow the work on sub-interpreters at https://github.com/PyO3/pyo3/issues/3451. Are you interested in contributing?

alex avatar Feb 13 '25 17:02 alex