Home Assistant service failing to start after update to 2024.8

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version |
  • G_DIETPI_VERSION_CORE=9

G_DIETPI_VERSION_SUB=6

G_DIETPI_VERSION_RC=1

G_GITBRANCH=‘master’

G_GITOWNER=‘MichaIng’

  • Distro version | bookworm 1
  • Kernel version | Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
  • Architecture | armhf
  • SBC model | RPi 4 Model B (aarch64)
  • Power supply used | 5V 1A
  • SD card used | SanDisk ultra + SSD

Additional Information (if applicable)

Home Assistant

  • Was the software title installed freshly or updated/migrated?
    Update to 2024.8
  • Can this issue be replicated on a fresh installation of DietPi?
    Cannot test this at the moment.
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

  1. Updated to (and tried to reinstall the entire setup with (dietpi-software reinstall 157):
    Requirement already satisfied: homeassistant in ./.pyenv/versions/3.12.3/lib/python3.12/site-packages (2024.8.0)
  2. Homeassistant failing to start it’s service with the following errors:
File                                                                 │ 
│ "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/jwt/utils.py", line 7, in <module>          │ 
│ Aug 08 23:42:20 DietPi Home Assistant[15374]:     from cryptography.hazmat.primitives.asymmetric.ec import           │ 
│ EllipticCurve                                                                                                        │ 
│ Aug 08 23:42:20 DietPi Home Assistant[15374]:   File                                                                 │ 
│ "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/e │ 
│ c.py", line 11, in <module>                                                                                          │
│ Aug 08 23:42:20 DietPi Home Assistant[15374]:     from cryptography.exceptions import UnsupportedAlgorithm, _Reasons │ 
│ Aug 08 23:42:20 DietPi Home Assistant[15374]:   File                                                                 │ 
│ "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/cryptography/exceptions.py", line 9, in     │ 
│ <module>                                                                                                             │ 
│ Aug 08 23:42:20 DietPi Home Assistant[15374]:     from cryptography.hazmat.bindings._rust import exceptions as       │ 
│ rust_exceptions                                                                                                      │ 
│ Aug 08 23:42:20 DietPi Home Assistant[15374]: ImportError: libssl.so.1.1: cannot open shared object file: No such    │ 
│ file or directory                                                                                                    │ 
│ Aug 08 23:42:20 DietPi systemd[1]: home-assistant.service: Main process exited, code=exited, status=1/FAILURE 

Expected behaviour

  • Home Assistant service should be starting as usual

Actual behaviour

Homeassistant failing to start it’s service with the following errors:

File                                                                 │
│ "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/jwt/utils.py", line 7, in <module>          │
│ Aug 08 23:42:20 DietPi Home Assistant[15374]:     from cryptography.hazmat.primitives.asymmetric.ec import           │ 
│ EllipticCurve                                                                                                        │ 
│ Aug 08 23:42:20 DietPi Home Assistant[15374]:   File                                                                 │ 
│ "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/e │ 
│ c.py", line 11, in <module>                                                                                          │ 
│ Aug 08 23:42:20 DietPi Home Assistant[15374]:     from cryptography.exceptions import UnsupportedAlgorithm, _Reasons │ 
│ Aug 08 23:42:20 DietPi Home Assistant[15374]:   File                                                                 │ 
│ "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/cryptography/exceptions.py", line 9, in     │ 
│ <module>                                                                                                             │ 
│ Aug 08 23:42:20 DietPi Home Assistant[15374]:     from cryptography.hazmat.bindings._rust import exceptions as       │ 
│ rust_exceptions                                                                                                      │ 
│ Aug 08 23:42:20 DietPi Home Assistant[15374]: ImportError: libssl.so.1.1: cannot open shared object file: No such    │ 
│ file or directory                                                                                                    │ 
│ Aug 08 23:42:20 DietPi systemd[1]: home-assistant.service: Main process exited, code=exited, status=1/FAILURE 

Extra details

I’ve just recently migrated to bookworm so recent update of HA is rather unfortunate (just before todays update all was working fine). Would appreciate some pointers were to look / what to do. Reached a wall here.

Edit: I’ve migrated to bookworm through

bash <(curl -sSf 'https://raw.githubusercontent.com/MichaIng/DietPi/master/.meta/dietpi-bookworm-upgrade')

happy to take as a temporary solution downgrading to HA 2024.7 :slight_smile:

libssl1.1 package is available on Debian Buster and Bullseye only. On Debian Bookworm package would be libssl3. Therefore, a software that requires libssl1.1 is not able to run on Bookworm.

Did you already tried to reinstall HA? Maybe there is an old Python module from Bullseye that has not correctly updated.

dietpi-software reinstall 157

Thanks for looking into it!

I did that twice already - with same effect. Is it possible to update that specific package standalone only? Was thinking about

sudo -u homeassistant bash
. /home/homeassistant/pyenv-activate.sh
pip3 install <module> # Or whichever install/update you need to do

Or is this package OS wide and not HA specific?

Edit: an idea - maybe we could create a link to call libssl3 whenever libssl1.1 is required? How could I do that?

can you share the entire log pls.

And did you restart your system before running the reinstall?

I believe that I have fixed the issue, I’ve restored to my Bullseye backup and updated system again (with same result).

I’ve fixed the entire cryptography in pip by running the following:

root@DietPi:~# sudo -u homeassistant -H -s
homeassistant@DietPi:/root$ . /home/homeassistant/pyenv-activate.sh
homeassistant@DietPi:~$ pip uninstall cryptography
Found existing installation: cryptography 43.0.0
Uninstalling cryptography-43.0.0:
  Would remove:
    /home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/cryptography-43.0.0.dist-info/*
    /home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/cryptography/*
Proceed (Y/n)? y
  Successfully uninstalled cryptography-43.0.0
homeassistant@DietPi:~$ pip install --no-binary :all: cryptography

Took some time rebuild everything but now have HA running without any errors.

Cytat
can you share the entire log pls.

What exactly would you like to see, HA log?

I don’t need any logs if you have solved the issue.

1 Like

I had this same thing happen to my Friendly Arm running the Neo Processor ArmV7. Interestingly enough it didn’t happen to my ArmV8 processor device. Seems that there is a module in Home Assistant that was introduced (or reverted) that needs libssl.so.1.1. Debian 12 comes libssl.so.3. The way I fixed this is by putting two files “libcrypto.so.1.1” & “libssl.so.1.1” into “/usr/lib/arm-linux-gnueabihf”. Of course make sure that these files are built for your architecture and use the right path for it. Then restart HA. issue solved.

Just sharing in case anyone has an issue with a different disdribution.

That’s not really a solution to put old depreciated files back in place. Better to reinstall cryptography like @michalowy did.

I agree, but for some reason, my build didn’t fix the issue. Only adding those files. The files were from a back up of the same system.

maybe in your case it was another module and not cryptography

I stand corrected. I thought it had fixed the problem. It did fix Home Assistant not starting, but now my Apple TV integration is not starting. I following the build instructions and it built successfully this time. But now I am getting this error. I understand you’ll probably need alot more context, but just wondering if there different flags that I would need to build cryptography. I will also ask on Home Assistant forums.

  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.12/site-packages/pyatv/support/chacha20.py", line 4, in <module>
Aug 12 21:45:12 MagicCube Home Assistant[19919]:     from chacha20poly1305_reuseable import ChaCha20Poly1305Reusable as ChaCha20Poly1305
Aug 12 21:45:12 MagicCube Home Assistant[19919]:   File "src/chacha20poly1305_reuseable/__init__.py", line 21, in init chacha20poly1305_reuseable
Aug 12 21:45:12 MagicCube Home Assistant[19919]: AttributeError: module 'lib' has no attribute 'EVP_CIPHER_CTX_ctrl'

The Apple TV issue has nothing to do with cryptography. It seems to be a challenge of this particular module.

And yes, way more information from the build log is required. Always good to share the entire output and not just small parts.

There is an issue that is documented here and apparently there is a fix, but it seems that it hasn’t made it into HA yet. But the solution works if you update pyatv manually.