public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v1 master ceph 0/2] Fix Ceph Squid Module Loading
@ 2025-07-16 17:39 Max R. Carrara
  2025-07-16 17:39 ` [pve-devel] [PATCH v1 master ceph 1/2] provide workaround for PyO3 ImportError Max R. Carrara
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Max R. Carrara @ 2025-07-16 17:39 UTC (permalink / raw)
  To: pve-devel

Fix Ceph Squid Module Loading - v1
==================================

The first patch provides a workaround for the PyO3 ImportError that's
being thrown by the `restful` Ceph mgr Python module upon import.
This fixes the following error:

    2025-07-16T17:40:40.932+0200 7c315bc77080  1 mgr[py] Loading python module 'restful'
    2025-07-16T17:40:41.220+0200 7c315bc77080 -1 mgr[py] Module not found: 'restful'
    2025-07-16T17:40:41.220+0200 7c315bc77080 -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/dist-packages/OpenSSL/__init__.py", line 8, in <module>
        from OpenSSL import SSL, crypto
      File "/lib/python3/dist-packages/OpenSSL/SSL.py", line 15, in <module>
        from cryptography import x509
      File "/lib/python3/dist-packages/cryptography/x509/__init__.py", line 7, in <module>
        from cryptography.x509 import certificate_transparency, verification
      File "/lib/python3/dist-packages/cryptography/x509/certificate_transparency.py", line 11, 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

    2025-07-16T17:40:41.222+0200 7c315bc77080 -1 mgr[py] Class not found in module 'restful'
    2025-07-16T17:40:41.222+0200 7c315bc77080 -1 mgr[py] Error loading module 'restful': (2) No such file or directory


The second patch fixes how the Ceph mgr looks up the NOTIFY_TYPES
attribute of the mgr Python modules' classes. This also happens to fix
the `mgr_module` Python module import failure. In total, this fixes
errors like the following:

    2025-07-16T17:40:41.222+0200 7c315bc77080  1 mgr[py] Loading python module 'selftest'
    2025-07-16T17:40:41.377+0200 7c315bc77080 -1 mgr[py] Module selftest has missing NOTIFY_TYPES member
    2025-07-16T17:40:41.377+0200 7c315bc77080 -1 mgr[py] Module not found: 'mgr_module'
    2025-07-16T17:40:41.377+0200 7c315bc77080 -1 mgr[py] AttributeError: type object 'Module' has no attribute 'NOTIFY_TYPES'
    
    2025-07-16T17:40:41.377+0200 7c315bc77080  1 mgr[py] Loading python module 'snap_schedule'
    2025-07-16T17:40:41.497+0200 7c315bc77080 -1 mgr[py] Module snap_schedule has missing NOTIFY_TYPES member
    2025-07-16T17:40:41.497+0200 7c315bc77080 -1 mgr[py] Module not found: 'mgr_module'
    2025-07-16T17:40:41.497+0200 7c315bc77080 -1 mgr[py] AttributeError: type object 'Module' has no attribute 'NOTIFY_TYPES'
    
    2025-07-16T17:40:41.497+0200 7c315bc77080  1 mgr[py] Loading python module 'stats'
    2025-07-16T17:40:41.636+0200 7c315bc77080  1 mgr[py] Loading python module 'status'
    2025-07-16T17:40:41.785+0200 7c315bc77080 -1 mgr[py] Module status has missing NOTIFY_TYPES member
    2025-07-16T17:40:41.785+0200 7c315bc77080 -1 mgr[py] Module not found: 'mgr_module'
    2025-07-16T17:40:41.785+0200 7c315bc77080 -1 mgr[py] AttributeError: type object 'Module' has no attribute 'NOTIFY_TYPES'

Note: These logs can be found inside the ceph-mgr logs in the
/var/log/ceph directory.

The commit messages of the supplied patches elaborate on further
details.

Summary of Changes
------------------

Max R. Carrara (2):
  provide workaround for PyO3 ImportError
  mgr: fix errors regarding module imports and NOTIFY_TYPES attributes

 ...ul-provide-workaround-for-PyO3-Impor.patch | 152 ++++++++++++++++++
 ...mport-by-making-NOTIFY_TYPES-in-py-m.patch |  56 +++++++
 patches/series                                |   2 +
 3 files changed, 210 insertions(+)
 create mode 100644 patches/0058-pybind-mgr-restful-provide-workaround-for-PyO3-Impor.patch
 create mode 100644 patches/0059-mgr-fix-module-import-by-making-NOTIFY_TYPES-in-py-m.patch

-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-16 20:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-16 17:39 [pve-devel] [PATCH v1 master ceph 0/2] Fix Ceph Squid Module Loading Max R. Carrara
2025-07-16 17:39 ` [pve-devel] [PATCH v1 master ceph 1/2] provide workaround for PyO3 ImportError Max R. Carrara
2025-07-16 17:39 ` [pve-devel] [PATCH v1 master ceph 2/2] mgr: fix errors regarding module imports and NOTIFY_TYPES attributes Max R. Carrara
2025-07-16 20:15 ` [pve-devel] applied-series: [PATCH v1 master ceph 0/2] Fix Ceph Squid Module Loading Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal