[FIXED] Re: Certbot crash

From: Xavier Humbert <xavier_at_groumpf.org>
Date: Sat, 27 Jul 2024 06:55:12 UTC
Le 27/07/2024 08:29, Xavier Humbert a écrit :
> Le 27/07/2024 08:24, Xavier Humbert a écrit :
>> Hi,
>>
>> I'm always in trouble with my python applications, since I upgraded 
>> to python311.
>>
>> certbot crashes :
>>
>> [root@numenor ~]# certbot certificates
>> Objects/typeobject.c:4083: type_dealloc: Assertion "type->tp_flags & 
>> (1UL << 9)" failed
>> Enable tracemalloc to get the memory block allocation traceback
>>
>> object address  : 0x823702688
>> object refcount : 0
>> object type     : 0x8237251a8
>> object type name: type
>> object repr     : <refcnt 0 at 0x823702688>
>>
>> Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
>> Python runtime state: initialized
>>
>> Current thread 0x0000000827806000 (most recent call first):
>>   File "<frozen importlib._bootstrap>", line 241 in 
>> _call_with_frames_removed
>>   File "<frozen importlib._bootstrap_external>", line 1233 in 
>> create_module
>>   File "<frozen importlib._bootstrap>", line 573 in module_from_spec
>>   File "<frozen importlib._bootstrap>", line 676 in _load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1147 in 
>> _find_and_load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
>>   File 
>> "/usr/local/lib/python3.11/site-packages/cryptography/exceptions.py", 
>> line 9 in <module>
>>   File "<frozen importlib._bootstrap>", line 241 in 
>> _call_with_frames_removed
>>   File "<frozen importlib._bootstrap_external>", line 940 in exec_module
>>   File "<frozen importlib._bootstrap>", line 690 in _load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1147 in 
>> _find_and_load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
>>   File 
>> "/usr/local/lib/python3.11/site-packages/cryptography/hazmat/bindings/openssl/binding.py", 
>> line 15 in <module>
>>   File "<frozen importlib._bootstrap>", line 241 in 
>> _call_with_frames_removed
>>   File "<frozen importlib._bootstrap_external>", line 940 in exec_module
>>   File "<frozen importlib._bootstrap>", line 690 in _load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1147 in 
>> _find_and_load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
>>   File "/usr/local/lib/python3.11/site-packages/OpenSSL/_util.py", 
>> line 6 in <module>
>>   File "<frozen importlib._bootstrap>", line 241 in 
>> _call_with_frames_removed
>>   File "<frozen importlib._bootstrap_external>", line 940 in exec_module
>>   File "<frozen importlib._bootstrap>", line 690 in _load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1147 in 
>> _find_and_load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
>>   File "/usr/local/lib/python3.11/site-packages/OpenSSL/SSL.py", line 
>> 10 in <module>
>>   File "<frozen importlib._bootstrap>", line 241 in 
>> _call_with_frames_removed
>>   File "<frozen importlib._bootstrap_external>", line 940 in exec_module
>>   File "<frozen importlib._bootstrap>", line 690 in _load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1147 in 
>> _find_and_load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
>>   File "<frozen importlib._bootstrap>", line 241 in 
>> _call_with_frames_removed
>>   File "<frozen importlib._bootstrap>", line 1232 in _handle_fromlist
>>   File "/usr/local/lib/python3.11/site-packages/OpenSSL/__init__.py", 
>> line 8 in <module>
>>   File "<frozen importlib._bootstrap>", line 241 in 
>> _call_with_frames_removed
>>   File "<frozen importlib._bootstrap_external>", line 940 in exec_module
>>   File "<frozen importlib._bootstrap>", line 690 in _load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1147 in 
>> _find_and_load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
>>   File "/usr/local/lib/python3.11/site-packages/josepy/json_util.py", 
>> line 24 in <module>
>>   File "<frozen importlib._bootstrap>", line 241 in 
>> _call_with_frames_removed
>>   File "<frozen importlib._bootstrap_external>", line 940 in exec_module
>>   File "<frozen importlib._bootstrap>", line 690 in _load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1147 in 
>> _find_and_load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
>>   File "/usr/local/lib/python3.11/site-packages/josepy/__init__.py", 
>> line 40 in <module>
>>   File "<frozen importlib._bootstrap>", line 241 in 
>> _call_with_frames_removed
>>   File "<frozen importlib._bootstrap_external>", line 940 in exec_module
>>   File "<frozen importlib._bootstrap>", line 690 in _load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1147 in 
>> _find_and_load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
>>   File 
>> "/usr/local/lib/python3.11/site-packages/certbot/_internal/main.py", 
>> line 21 in <module>
>>   File "<frozen importlib._bootstrap>", line 241 in 
>> _call_with_frames_removed
>>   File "<frozen importlib._bootstrap_external>", line 940 in exec_module
>>   File "<frozen importlib._bootstrap>", line 690 in _load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1147 in 
>> _find_and_load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
>>   File "<frozen importlib._bootstrap>", line 241 in 
>> _call_with_frames_removed
>>   File "<frozen importlib._bootstrap>", line 1232 in _handle_fromlist
>>   File "/usr/local/lib/python3.11/site-packages/certbot/main.py", 
>> line 6 in <module>
>>   File "<frozen importlib._bootstrap>", line 241 in 
>> _call_with_frames_removed
>>   File "<frozen importlib._bootstrap_external>", line 940 in exec_module
>>   File "<frozen importlib._bootstrap>", line 690 in _load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1147 in 
>> _find_and_load_unlocked
>>   File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
>>   File "/usr/local/bin/certbot", line 5 in <module>
>>
>> Extension modules: _cffi_backend (total: 1)
>> Abort trap (core dumped)
>>
>> Any clue ?
>>
>> Thanks, and regards,
>>
>> Xavier
>>
> In fact all python applications (duplicity for example)  have the same 
> problem.
>
> This night, I rebuilded python and all the py311\* stuff
>
> Regards,
>
> Xavier
>
By digging into the error messages, I had to reinstall devel/py-cffi and 
security/py-cryptography and all errors vanished.

I still don't know what happened...

Xavier

-- 
Xavier HUMBERT - Unix/Win/MacOSX Sysadmin/Network Engineer
https://www.amdh.fr