Error during upgrade to v0.23a

Has anyone else seen the error pasted at the bottom of this post when attempting to upgrade from v0.21 to v0.23a?

The only impact I’ve found so far is that the admin web interface is broken (see screenshot below). The box still seems to be sending and receiving mail and round cube is functioning.

Installing Munin (system monitoring)...
cffi library '_openssl' has no function, constant or global variable named 'Cryptography_HAS_MEM_FUNCTIONS'<!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 803, in <module>
    provision_certificates_cmdline()
  File "management/ssl_certificates.py", line 446, 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 265, in provision_certificates
    import requests.exceptions
  File "/usr/local/lib/python3.4/dist-packages/requests/__init__.py", line 78, in <module>
    from urllib3.contrib import pyopenssl
  File "/usr/local/lib/python3.4/dist-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 156, 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 84, in build_conditional_library
    if not getattr(lib, condition):
AttributeError: cffi library '_openssl' has no function, constant or global variable named 'Cryptography_HAS_DTLS'

-----------------------------------------------

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 993, in <module>
    ssl_certificates = get_ssl_certificates(env)
  File "/root/mailinabox/management/ssl_certificates.py", line 46, in get_ssl_certificates
    pem = load_pem(load_cert_chain(fn)[0])
  File "/root/mailinabox/management/ssl_certificates.py", line 763, 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 15, in default_backend
    from cryptography.hazmat.backends.openssl.backend import backend
  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 49, in <module>
    from cryptography.hazmat.bindings.openssl import binding
  File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 156, 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 84, in build_conditional_library
    if not getattr(lib, condition):
AttributeError: cffi library '_openssl' has no function, constant or global variable named 'Cryptography_HAS_EVP_PKEY_DHX'
https://<my-box-ip-address>/admin

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

<my-box-fingerprint>

Then you can confirm the security exception and continue.

Check if those ones could help you: Version 0.21 is posted and v0.21c Release - Fixes Python package installation issue

Thanks for the pointers. Running sudo rm -rf /usr/local/lib/python3.4/dist-packages/cryptography* before retrying the upgrade solved the problem.

Hello,
I’m having this very same issue, but had no errors during upgrade. Munin is runing properly if i hit the link, but nothing else is working. As mt_hall everything else is working properly.
The only error i have found is, when starting management/daemon.py manually, and try to log into admin web:

Can anyone help ?
Ty.

Looks like the download of the assets failed during the setup. Did the setup give any errors? Could you try rerunning the setup?

No errors at all. I ran two setups more to be sure.

Can you run ls /usr/local/lib/mailinabox/vendor/assets/*

Hello,
I made a rollback (VM) and fired upgrade again. This is the only error so far:

The management daemon refused access. The API key file may be out of sync. Try ‘service mailinabox restart’.

When trying to restart the daemon manually got this:

It seems the stored PID is not the same as it should:

So I rolled back again, edited the file with the PID, wrote the proper one and launched setup again. This time no errors and finally in 0.23a.
Thanks all.