Upgrade to 0.21c causes exception

I saw this in the admin panel:
You are running version v0.20. The latest version is v0.21c.

So I started an upgrade. It seems to have been successful except this:

Installing Munin (system monitoring)...
cffi library '_openssl' has no function, constant or global variable named 'Cryptography_HAS_NPN_NEGOTIATED'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application.</p>
Traceback (most recent call last):
  File "management/ssl_certificates.py", line 807, in <module>
    provision_certificates_cmdline()
  File "management/ssl_certificates.py", line 450, in provision_certificates_cmdline
    status = provision_certificates(env, agree_to_tos_url=agree_to_tos_url, logger=my_logger, force_domains=force_domains, show_extended_problems=show_extended_problems)
  File "management/ssl_certificates.py", line 271, in provision_certificates
    import requests.exceptions
  File "/usr/local/lib/python3.4/dist-packages/requests/__init__.py", line 52, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
    import OpenSSL.SSL
  File "/usr/local/lib/python3.4/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/local/lib/python3.4/dist-packages/OpenSSL/rand.py", line 12, in <module>
    from OpenSSL._util import (
  File "/usr/local/lib/python3.4/dist-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 173, in <module>
    Binding.init_static_locks()
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 137, in init_static_locks
    cls._ensure_ffi_initialized()
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 124, in _ensure_ffi_initialized
    cls.lib = build_conditional_library(lib, CONDITIONAL_NAMES)
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 89, in build_conditional_library
    if not getattr(lib, condition):
AttributeError: cffi library '_openssl' has no function, constant or global variable named '
Cryptography_HAS_SET_ECDH_AUTO'

-----------------------------------------------
Your Mail-in-a-Box is running.

Please log in to the control panel for further instructions at:

Traceback (most recent call last):
  File "management/status_checks.py", line 977, in <module>
    ssl_certificates = get_ssl_certificates(env)
  File "/root/mailinabox/management/ssl_certificates.py", line 47, in get_ssl_certificates
    pem = load_pem(load_cert_chain(fn)[0])
  File "/root/mailinabox/management/ssl_certificates.py", line 767, in load_pem
    return load_pem_x509_certificate(pem, default_backend())
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/backends/__init__.py", line 71, in default_backend
    _default_backend = MultiBackend(_available_backends())
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/backends/__init__.py", line 28, in _available_backends
    "cryptography.backends"
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/backends/__init__.py", line 27, in <listcomp>
    for ep in pkg_resources.iter_entry_points(
  File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2308, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 52, in <module>
    from cryptography.hazmat.bindings.openssl import binding
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 173, in <module>
    Binding.init_static_locks()
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 137, in init_static_locks
    cls._ensure_ffi_initialized()
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 124, in _ensure_ffi_initialized
    cls.lib = build_conditional_library(lib, CONDITIONAL_NAMES)
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 89, in build_conditional_library
    if not getattr(lib, condition):
AttributeError: cffi library '_openssl' has no function, constant or global variable named 'Cryptography_HAS_SET_ECDH_AUTO'
https://88.198.125.222/admin

You will be alerted that the website has an invalid certificate. Check that
the certificate fingerprint matches:

D0:6E:4E:3C:B5:E9:66:16:08:54:E9:4B:13:01:9E:61:5C:96:D4:44

Then you can confirm the security exception and continue.

And then update finished.
When I go to system admin panel it just shows a dialog saying something went wrong.
Any suggestions on how to fix this?

Apologies, just noticed the answer in:

1 Like