AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'

I’m trying to request a Lets Encrypt cert for a new subdomain and I get this error

Traceback (most recent call last):
  File "/bin/letsencrypt", line 33, in <module>
    sys.exit(load_entry_point('certbot==1.21.0', 'console_scripts', 'certbot')())
  File "/bin/letsencrypt", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/certbot/main.py", line 2, in <module>
    from certbot._internal import main as internal_main
  File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 17, in <module>
    import josepy as jose
  File "/usr/lib/python3/dist-packages/josepy/__init__.py", line 43, in <module>
    from josepy.json_util import (
  File "/usr/lib/python3/dist-packages/josepy/json_util.py", line 14, in <module>
    from OpenSSL import crypto
  File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1579, in <module>
    class X509StoreFlags(object):
  File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1598, in X509StoreFlags
    NOTIFY_POLICY = _lib.X509_V_FLAG_NOTIFY_POLICY
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'. Did you mean: 'X509_V_FLAG_EXPLICIT_POLICY'?
SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Usermin version 2.102
Virtualmin version 7.20.2
Theme version 21.20.7
Apache version 2.4.52
Package updates All installed packages are up to date

this look similar. No one else has posted so maybe you installed something that may have caused a issue.

Hmm strange, I don’t think I have installed anything.
I’ll see if I can update PyOpenSSL

hmmm…

root@localhost:~# python3 -m OpenSSL
Traceback (most recent call last):
File “/usr/lib/python3.10/runpy.py”, line 187, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.10/runpy.py”, line 146, in _get_module_details
return _get_module_details(pkg_main_name, error)
File “/usr/lib/python3.10/runpy.py”, line 110, in _get_module_details
import(pkg_name)
File “/usr/lib/python3/dist-packages/OpenSSL/init.py”, line 8, in
from OpenSSL import crypto, SSL
File “/usr/lib/python3/dist-packages/OpenSSL/crypto.py”, line 1579, in
class X509StoreFlags(object):
File “/usr/lib/python3/dist-packages/OpenSSL/crypto.py”, line 1598, in X509StoreFlags
NOTIFY_POLICY = _lib.X509_V_FLAG_NOTIFY_POLICY
AttributeError: module ‘lib’ has no attribute ‘X509_V_FLAG_NOTIFY_POLICY’. Did you mean: ‘X509_V_FLAG_EXPLICIT_POLICY’?

fixed it with this;

Seems like it was still broken/freshly broken on Ubuntu 22.04.5

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.