Version 0.21 is posted

I’ve just posted version 0.21 of Mail-in-a-Box.

The new version updates ownCloud, which may include security fixes, and makes some other smaller improvements. See the full changelog.

To upgrade, see the upgrade instructions.

Some users performing an update from an existing version have been encountering an error during and after upgrading that looks like:

... lots of stuff, then ...
AttributeError: cffi library 'openssl' has no function, constant or
global variable named 'Cryptography[something here]'

If during or after the update you encounter this, run:

sudo rm -rf /usr/local/lib/python3.4/dist-packages/cryptography*
sudo mailinabox

(These instructions are updated from my initial post — removing/re-installing pyOpenSSL does not seem to be necessary and caused problems for some. For posterity, my original instructions were: sudo apt-get -y purge python3-openssl && sudo rm -rf /usr/local/lib/python3.4/dist-packages/{OpenSSL,cryptography}* && sudo pip3 install pyOpenSSL && sudo mailinabox.)

5 Likes

I had similar problems on 2 out of 3 boxes. I had to do a few extra steps to get it to work:

pip3 uninstall pyopenssl
pip3 install --upgrade pyopenssl

This was only necessary on one box:

pip3 install --upgrade cryptography

My update is taking very long on

Installing Mail-in-a-Box system management daemon…

It’s been on that for over an hour.
Is that normal or is something going wrong?

@JoshData Trying to upgrade 0.20 dev-master to 0.21 dev-master and reports:

root@box:~/mailinabox# git pull
Already up-to-date.
  • System Status Checks still reports:

    :heavy_multiplication_x: A new version of Mail-in-a-Box is available. You are running version
    v0.20. The latest version is v0.21. For upgrade instructions, see
    https://mailinabox.email.

Is there a way to force dev-master upgrade?

Run git fetch first.

1 Like

That’s not normal. I would interrupt it and try again.

1 Like

after retrying to apply the update I got an error different from the listed above. After reinstalling the package “python3-openssl” the update worked fine for me :slight_smile:

1 Like

Thank you!

then, did It again by running:

cd mailinabox
git fetch
git pull
cd mailinabox
git checkout
setup/start.sh

The arrived to the need to run:

sudo apt-get -y purge python3-openssl
sudo rm -rf /usr/local/lib/python3.4/dist-packages/{OpenSSL,cryptography}*
sudo pip3 install pyOpenSSL
sudo mailinabox

At the end, following error reported (even everything looks Ok! at the admin panel):

updated DNS: OpenDKIM configuration
web updated
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 272, in provision_certificates
    import acme.messages
  File "/usr/local/lib/python3.4/dist-packages/acme/messages.py", line 4, in <module>
    from acme import challenges
  File "/usr/local/lib/python3.4/dist-packages/acme/challenges.py", line 9, in <module>
    import OpenSSL
ImportError: No module named 'OpenSSL'
-----------------------------------------------
Your Mail-in-a-Box is running.
Please log in to the control panel for further instructions at:

Is that last something to be worried about? Thanks in advance!

Looks like the same problem @pxl had. Perhaps try reinstalling the module?

1 Like

Followed the upgrade procedure from 0.20 and getting this error almost immediately after starting upgrade…

Public IP Address: 159.203.65.82
Mail-in-a-Box Version: v0.21

FAILED: add-apt-repository -y ppa:mail-in-a-box/ppa

Cannot add PPA: ‘ppa:mail-in-a-box/ppa’.
Please check that the PPA name or format is correct.

Now status page says reboot is needed and I’m afraid to cause any breakage by doing that.

Anyone run into this or know how to fix?

I got different error :frowning:
`Installing ownCloud (contacts/calendar)…

FAILED: sudo -u www-data php /usr/local/lib/owncloud/console.php app:disable firstrunwizard

ownCloud is not installed - only a limited number of commands are available

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command “app:disable” is not defined.
Did you mean this?
app:check-code


`

Disregard. Ran the upgrade command again after a few minutes and all went well.

Josh: Can you please remove my IP address above? And thanks for all the amazing work you put into MIAB.

I have new error now after Rebooting the VPS.

`updated DNS: OpenDKIM configuration
Traceback (most recent call last):
File “management/ssl_certificates.py”, line 807, in
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 272, in provision_certificates
import acme.messages
File “/usr/local/lib/python3.4/dist-packages/acme/messages.py”, line 4, in
from acme import challenges
File “/usr/local/lib/python3.4/dist-packages/acme/challenges.py”, line 9, in
import OpenSSL
ImportError: No module named ‘OpenSSL’


`

yes! you must install python3-openssl and run ‘mailinabox’ again, The full sequence that worked for me is:

apt-get update && apt-get upgrade -y
cd mailinabox
git fetch
git pull
setup/start.sh

Then needed to run, as @JoshData recommended earlier:

sudo apt-get -y purge python3-openssl
sudo rm -rf /usr/local/lib/python3.4/dist-packages/{OpenSSL,cryptography}*
sudo pip3 install pyOpenSSL
sudo mailinabox
  • But still with the same issue you are reporting here, then solved with:

    sudo apt-get install python3-openssl
    sudo mailinabox

  • Now all is correct!

Hope this helps (thanks to @michaelkroes & @pxl BTW for the given guidelines here )

5 Likes

Hi,
I’ve just upgraded to 0.21 from 0.20 and it seems to of broken my mail server. Reading comments above, I think I have a slight variation so I’m unsure which path to follow. He is the output from the terminal:

Installing Munin (system monitoring)…
cffi library ‘_openssl’ has no function, constant or global variable named ‘Cryptography_HAS_NPN_NEGOTIATED’

500 Internal Server Error

Internal Server Error

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.

Traceback (most recent call last): File "management/ssl_certificates.py", line 807, in 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 from .packages.urllib3.contrib import pyopenssl File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 47, in import OpenSSL.SSL File "/usr/local/lib/python3.4/dist-packages/OpenSSL/__init__.py", line 8, in from OpenSSL import rand, crypto, SSL File "/usr/local/lib/python3.4/dist-packages/OpenSSL/rand.py", line 12, in from OpenSSL._util import ( File "/usr/local/lib/python3.4/dist-packages/OpenSSL/_util.py", line 6, in from cryptography.hazmat.bindings.openssl.binding import Binding File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 207, in Binding.init_static_locks() File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 178, in init_static_locks cls._ensure_ffi_initialized() File "/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 165, 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 104, in build_conditional_library if not getattr(lib, condition): AttributeError: cffi library '_openssl' has no function, constant or global variable named 'Cryptography_HAS_SCRYPT'

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
ssl_certificates = get_ssl_certificates(env)
File “/home/ubuntu/mailinabox/management/ssl_certificates.py”, line 47, in get_ssl_certificates
pem = load_pem(load_cert_chain(fn)[0])
File “/home/ubuntu/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
for ep in pkg_resources.iter_entry_points(
File “/usr/local/lib/python3.4/dist-packages/pkg_resources/init.py”, line 2297, 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
from cryptography.hazmat.backends.openssl.backend import backend
File “/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/backends/openssl/backend.py”, line 48, in
from cryptography.hazmat.bindings.openssl import binding
File “/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py”, line 207, in
Binding.init_static_locks()
File “/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py”, line 178, in init_static_locks
cls._ensure_ffi_initialized()
File “/usr/local/lib/python3.4/dist-packages/cryptography/hazmat/bindings/openssl/binding.py”, line 165, 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 104, 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://52.220.62.133/admin

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

Thanks for the update. Mine upgraded without hitch.

I’m wondering if I could get away with downgrading to a 512MB server. I noticed the new lowered memory requirements mentioned in the release notes. Is anyone else considering this?

@deanzilla That’s the same issue as the one I mentioned at the top. Try the instructions in the original post?

Ok, I’ve followed them, and all good :slight_smile:

Just wanted to be sure first.

Thanks for your support

I upgraded too and owncloud went fine. Only some munin error:

“Installing Munin (system monitoring)…
[FATAL ERROR] Lock already exists: /var/run/munin/munin-update.lock. Dying.
at /usr/share/perl5/Munin/Master/Update.pm line 128.”

So, reboot and Im going to test it.
Big thank You :slight_smile:

The munin error happens every now and then.