Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 955801

Summary: sys-cluster/ceph-19.2.2-r1 python error in one of mgr modules after upgrade to python 3.13
Product: Gentoo Linux Reporter: ev
Component: Current packagesAssignee: Patrick McLean <chutzpah>
Status: CONFIRMED ---    
Severity: normal CC: cluster, ev, patrick
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=920906
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 955650    
Attachments: energe --info sys-cluster/ceph

Description ev 2025-05-10 21:22:16 UTC
Created attachment 928424 [details]
energe --info sys-cluster/ceph

I've upgraded my ceph test system from 19.2.2 to 19.2.2-r1 and discovered that one of mgr python is broken again.

2025-05-10T22:57:52.315+0200 7effc8c63100  1 mgr[py] Loading python module 'restful'
2025-05-10T22:57:52.438+0200 7effc8c63100 -1 mgr[py] Module not found: 'restful'
2025-05-10T22:57:52.438+0200 7effc8c63100 -1 mgr[py] Traceback (most recent call last):
  File "/usr/share/ceph/mgr/restful/__init__.py", line 1, in <module>
    from .module import Module
  File "/usr/share/ceph/mgr/restful/module.py", line 22, in <module>
    from OpenSSL import crypto
  File "/lib/python3.13/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import SSL, crypto
  File "/lib/python3.13/site-packages/OpenSSL/SSL.py", line 15, in <module>
    from cryptography import x509
  File "/lib/python3.13/site-packages/cryptography/x509/__init__.py", line 7, in <module>
    from cryptography.x509 import certificate_transparency, verification
  File "/lib/python3.13/site-packages/cryptography/x509/certificate_transparency.py", line 8, in <module>
    from cryptography.hazmat.bindings._rust import x509 as rust_x509
ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process


Error ENOENT: module 'restful' reports that it cannot run on the active manager daemon: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process (pass --force to force enablement)
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-10 21:24:43 UTC
Dupe of bug 920906? I don't think the 19.2.2 vs 19.2.2-r1 is it, I think it's more likely something else changed?

*** This bug has been marked as a duplicate of bug 920906 ***
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-10 21:27:00 UTC
If downgrading only ceph really works, then...

 $ diff -u ceph-19.2.2.ebuild ceph-19.2.2-r1.ebuild
--- ceph-19.2.2.ebuild  2025-05-09 11:12:00.907644326 +0100
+++ ceph-19.2.2-r1.ebuild       2025-05-09 11:12:00.907644326 +0100
@@ -3,7 +3,7 @@

 EAPI=8

-PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_COMPAT=( python3_{10..13} )
 LUA_COMPAT=( lua5-{3..4} )

 inherit check-reqs bash-completion-r1 cmake flag-o-matic lua-single \
@@ -241,6 +241,10 @@
        "${FILESDIR}/ceph-19.2.1-exporter.patch"
        "${FILESDIR}/ceph-19.2.1-isa-l.patch"
        "${FILESDIR}/ceph-19.2.1-quiet-stringop-truncation.patch"
+       "${FILESDIR}/ceph-19.2.2-py313-1.patch"
+       "${FILESDIR}/ceph-19.2.2-py313-2.patch"
+       "${FILESDIR}/ceph-19.2.2-py313-3.patch"
+       "${FILESDIR}/ceph-19.2.2-gcc15.patch"
 )

 check-reqs_export_vars() {

But please verify that.
Comment 3 ev 2025-05-11 07:44:38 UTC
I don't know if that's a duplicate of 920906

bug 920906 hasn't been an issue for me for a long time on 19.2.1 and 19.2.2. I assumed it was resolved. I can enabled mgr module dashboard and restful on my 19.2.2 cluster without issues.

Both ceph clusters (main and test) have the same bcrypt and cryptography versions.
dev-python/cryptography-44.0.2
dev-python/bcrypt-4.3.0

I'll try to recompile and test 19.2.2-r1 without these 4 patches since I can't just reinstall old binpkg because of python_compat
Comment 4 ev 2025-05-11 12:10:02 UTC
I've tried to recompile sys-cluster/ceph-19.2.2-r1 without new patches but it doesn't compile.

I've compiled sys-cluster/ceph-19.2.2-r1 with all 3 patches but for python 3.12 (USE=python_targets_python3_12)

And on python 3.12 mgr works just fine and module restful just works.

Example from the log 
2025-05-11T14:07:53.472+0200 7f93dd4de100  1 mgr[py] Loading python module 'selftest'
2025-05-11T14:07:53.526+0200 7f93dd4de100 -1 mgr[py] Module selftest has missing NOTIFY_TYPES member
2025-05-11T14:07:53.526+0200 7f93dd4de100  1 mgr[py] Loading python module 'rgw'
2025-05-11T14:07:53.646+0200 7f93dd4de100 -1 mgr[py] Module rgw has missing NOTIFY_TYPES member
2025-05-11T14:07:53.646+0200 7f93dd4de100  1 mgr[py] Loading python module 'restful'
2025-05-11T14:07:53.792+0200 7f93dd4de100  1 mgr[py] Loading python module 'rbd_support'
2025-05-11T14:07:53.866+0200 7f93dd4de100 -1 mgr[py] Module rbd_support has missing NOTIFY_TYPES member
2025-05-11T14:07:53.866+0200 7f93dd4de100  1 mgr[py] Loading python module 'prometheus'
2025-05-11T14:07:54.042+0200 7f93dd4de100 -1 mgr[py] Module prometheus has missing NOTIFY_TYPES member
2025-05-11T14:07:54.042+0200 7f93dd4de100  1 mgr[py] Loading python module 'progress'

Could you reconsider un-resolving this bug? It seems to be specific to this python 3.13 upgrade.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-11 12:22:11 UTC
Mysterious. Thanks for poking.
Comment 6 ev 2025-05-11 13:13:36 UTC
I'm sorry, I've made a mistake.

I've actually compiled and tested 19.2.2 not 19.2.2-r1 on python 3.12

Now I've actually compiled 19.2.2-r1 on python 3.12 still has this issue.
The issue is probably caused my 4 new patches in 19.2.2-r1

error
ceph mgr module enable restful
Error ENOENT: module 'restful' reports that it cannot run on the active manager daemon: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process (pass --force to force enablement)
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-13 02:07:09 UTC
(In reply to ev from comment #6)
> I'm sorry, I've made a mistake.
> 
> I've actually compiled and tested 19.2.2 not 19.2.2-r1 on python 3.12
> 
> Now I've actually compiled 19.2.2-r1 on python 3.12 still has this issue.
> The issue is probably caused my 4 new patches in 19.2.2-r1
> 
> error
> ceph mgr module enable restful
> Error ENOENT: module 'restful' reports that it cannot run on the active
> manager daemon: PyO3 modules compiled for CPython 3.8 or older may only be
> initialized once per interpreter process (pass --force to force enablement)

Can you look at which patch causes it?