Error with X509_V_FLAG_CB_ISSUER_CHECK after upgrade to 2022.10.1

Hi,

Summer is over and I have finally again time for some HA maintenance and fiddeling.
I made an upgrade of ha-core in my venv (Python 3.9, Raspbian 10) with a bigger jump from like 2022.03 or .04 (unfortunately I can whether remember nor reconstruct the exact old version) to 2022.10.1.

It’s crashing now constantly showing a 500 error in the frontend and in the journal/logs the following error:

Oct 07 22:58:28 raspberrypi hass[8405]: 2022-10-07 22:58:28.430 ERROR (MainThread) [aiohttp.server] Error handling request
Oct 07 22:58:28 raspberrypi hass[8405]: Traceback (most recent call last):
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
Oct 07 22:58:28 raspberrypi hass[8405]:     resp = await request_handler(request)
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
Oct 07 22:58:28 raspberrypi hass[8405]:     resp = await handler(request)
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
Oct 07 22:58:28 raspberrypi hass[8405]:     return await handler(request)
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
Oct 07 22:58:28 raspberrypi hass[8405]:     return await handler(request)
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/forwarded.py", line 82, in forwarded_middleware
Oct 07 22:58:28 raspberrypi hass[8405]:     from hass_nabucasa import (  # pylint: disable=import-outside-toplevel
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/hass_nabucasa/__init__.py", line 15, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     from .auth import CloudError, CognitoAuth
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/hass_nabucasa/auth.py", line 8, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     import boto3
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/boto3/__init__.py", line 16, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     from boto3.session import Session
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/boto3/session.py", line 17, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     import botocore.session
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/botocore/session.py", line 30, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     import botocore.credentials
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/botocore/credentials.py", line 34, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     from botocore.config import Config
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/botocore/config.py", line 16, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     from botocore.endpoint import DEFAULT_TIMEOUT, MAX_POOL_CONNECTIONS
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/botocore/endpoint.py", line 22, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     from botocore.awsrequest import create_request_object
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/botocore/awsrequest.py", line 25, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     import botocore.utils
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/botocore/utils.py", line 33, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     import botocore.httpsession
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/botocore/httpsession.py", line 17, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     from urllib3.contrib.pyopenssl import orig_util_SSLContext as SSLContext
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/urllib3/contrib/pyopenssl.py", line 50, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     import OpenSSL.SSL
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/OpenSSL/__init__.py", line 8, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     from OpenSSL import crypto, SSL
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/OpenSSL/crypto.py", line 1556, in <module>
Oct 07 22:58:28 raspberrypi hass[8405]:     class X509StoreFlags(object):
Oct 07 22:58:28 raspberrypi hass[8405]:   File "/srv/homeassistant/lib/python3.9/site-packages/OpenSSL/crypto.py", line 1577, in X509StoreFlags
Oct 07 22:58:28 raspberrypi hass[8405]:     CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
Oct 07 22:58:28 raspberrypi hass[8405]: AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

Fits maybe to the following error I got during upgrade via pip?!

hass-nabucasa 0.54.0 requires cryptography<37.0,>=2.8, but you have cryptography 38 which is incompatible.

hass-nabucasa is not aiohttp.server, sure, but problems with SSL and the cryptography-package…?! A bit strange.
I tried out a downgrade of the cryptography-package to 36.0.2, but ha-core requires 37.0, so no solution.

Can somebody help? Or do I have to rollback to a backup and do smaller upgrade-steps? Or am I affected by a known bug/problem where I didn’t discovered the corresponding github-issue yet?

3 Likes

Hi, I had the same problem and tried by chance one of the answers of a stackoverflow-question.
(inside the homeassistant venv) I entered:

pip3 install pyOpenSSL --upgrade

And it updated from pyOpenSSL-20.0.1 to pyOpenSSL-22.1.0 and after a service restart, it worked again :slight_smile:
(no guarantee for success as I almost have no idea what I’m doing regarding those python packages^^)

edit: my upgrade step was not so big; I was coming from 2022.9.x (also can’t remember the exact number)

10 Likes

That worked, awesome :slight_smile:
A bit surprising that nobody else had this problem before and posted it here or somewhere else. Or it’s something special with our setup…whatever, thanks!

1 Like

Thanks for posting this solution Darktemp! I had this exact issue after trying to upgrade from 2022.9.7 to 2022.10.1 this morning. I had pretty much resigned myself to many days of no HA until I finally found your post and is solve the issue :slight_smile:

This worked for me too, thanks so much for sharing this!!