Home Assistant causing dietpi to hung

Here is my journal:

root@DietPi:~# journalctl -u home-assistant
-- Journal begins at Sat 2025-06-21 02:29:40 AEST, ends at Sun 2025-06-22 12:55:34 AEST. --
Jun 21 02:29:48 DietPi systemd[1]: Started Home Assistant (DietPi).
Jun 21 09:16:05 DietPi Home Assistant[1622]: 2025-06-21 09:16:05.544 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
Jun 21 09:16:18 DietPi Home Assistant[1622]: 2025-06-21 09:16:18.736 WARNING (MainThread) [aiohttp_fast_zlib] zlib_ng and isal are not available, falling back to zlib, performance will be degraded.
Jun 21 09:16:21 DietPi Home Assistant[1622]: 2025-06-21 09:16:21.194 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //mnt/dietpi_userdata/homeassistant/home-assistant_v2.db was shutdown cleanly
Jun 21 09:16:22 DietPi Home Assistant[1622]: 2025-06-21 09:16:22.180 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=67 from 2025-06-13 08:22:12.992742)
Jun 21 09:16:27 DietPi Home Assistant[1622]: 2025-06-21 09:16:27.103 ERROR (ImportExecutor_0) [homeassistant.components.camera.img_util] Error loading libturbojpeg; Camera snapshot performance will be sub-optimal
Jun 21 09:16:27 DietPi Home Assistant[1622]: Traceback (most recent call last):
Jun 21 09:16:27 DietPi Home Assistant[1622]:   File "/home/homeassistant/.pyenv/versions/3.12.7/lib/python3.12/site-packages/homeassistant/components/camera/img_util.py", line 100, in __init__
Jun 21 09:16:27 DietPi Home Assistant[1622]:     TurboJPEGSingleton.__instance = TurboJPEG()
Jun 21 09:16:27 DietPi Home Assistant[1622]:                                     ^^^^^^^^^^^
Jun 21 09:16:27 DietPi Home Assistant[1622]:   File "/home/homeassistant/.pyenv/versions/3.12.7/lib/python3.12/site-packages/turbojpeg.py", line 300, in __init__
Jun 21 09:16:27 DietPi Home Assistant[1622]:     self.__find_turbojpeg() if lib_path is None else lib_path)
Jun 21 09:16:27 DietPi Home Assistant[1622]:     ^^^^^^^^^^^^^^^^^^^^^^^
Jun 21 09:16:27 DietPi Home Assistant[1622]:   File "/home/homeassistant/.pyenv/versions/3.12.7/lib/python3.12/site-packages/turbojpeg.py", line 967, in __find_turbojpeg
Jun 21 09:16:27 DietPi Home Assistant[1622]:     raise RuntimeError(
Jun 21 09:16:27 DietPi Home Assistant[1622]: RuntimeError: Unable to locate turbojpeg library automatically. You may specify the turbojpeg library path manually.
Jun 21 09:16:27 DietPi Home Assistant[1622]: e.g. jpeg = TurboJPEG(lib_path)
Jun 21 16:08:15 DietPi Home Assistant[1622]: 2025-06-21 16:08:15.737 ERROR (MainThread) [homeassistant.components.tplink.coordinator] Error fetching 192.168.8.101 data: Unable to connect to the device: 192.168.8.101:9999:
Jun 21 21:56:53 DietPi Home Assistant[1622]: 2025-06-21 21:56:53.957 ERROR (MainThread) [homeassistant.components.ipp.coordinator] Error fetching ipp data: Invalid response from API: Timeout occurred while connecting to IPP server.

After monthly update it is last few months never start again properly, I need to just reboot whole Odroid HC4.
I have HA installed natively not in doker.

Any suggetion please?

I think it is the fourth line down that gives some hints at the problem, no? Well there is also line eight which does not look good either, hmm.

Yeah, but I do not have any camera, and camera entities. And sqlite, I did not touch database at all.

Is it possible to fix it somehow?

It says that you can disable them, probably a startup option I guess or something in the settings, not sure. I do not use HA maybe someone else who is more familiar can help or query their forums perhaps would provide some insight.

1 Like

I don’t use HA either. But I know from testing that HA is able to detect components on the local network and tries to set up those devices. It looks like a TP-Link camera was connected to your network. Maybe you can ask in a HA forum if this camara integration can be disabled.

Thx, but I do not have Tp-link cameras at all, only tplink smart plugs, interesting, maybe some neighbor has one? Who knows. Anyway, I will ask on HA forum.

Actually I tried to instal turbojpg lib (GitHub - libjpeg-turbo/libjpeg-turbo: Main libjpeg-turbo repository) but getting error that there is no bullseye repo. Can you look at it and maybe direct me how to install it, please?

found this similar topic Home Assistant - Problems with USB Modbus Plugin - With Error-Log [solved] - #3 by Jappe

Awesome but I got error when tried instal turbojpg

E: Unable to locate package libjpeg-turbo

What is the reason , I have up to date dietpi?

this has nothing to do with DietPi. Name of the package depends a bit on your Debian version. I guess you are running Debian Bookworm, therefore try

apt install libjpeg62-turbo

I hope this is sufficient. If not, you may have to go with the development package libjpeg62-turbo-dev

Thanks I made it but the error is still there plus one more lib missing

Jun 27 10:12:31 DietPi Home Assistant[1625]: 2025-06-27 10:12:31.664 WARNING (MainThread) [aiohttp_fast_zlib] zlib_ng and isal are not available, falling back to zlib, performance will be degraded.
Jun 27 10:12:34 DietPi Home Assistant[1625]: 2025-06-27 10:12:33.998 ERROR (ImportExecutor_0) [homeassistant.components.camera.img_util] Error loading libturbojpeg; Camera snapshot performance will be sub-optimal
Jun 27 10:12:34 DietPi Home Assistant[1625]: RuntimeError: Unable to locate turbojpeg library automatically. You may specify the turbojpeg library path manually

But this error message is gone? Which package you installed now? Did you reboot your system?

That one’ apt install libjpeg62-turbo
reboot done too. This message is after reboot.

maybe this one in addition

Still there ;-(.


> type or paste code here

root@DietPi:~# journalctl -u home-assistant
-- Journal begins at Fri 2025-06-27 18:46:34 AEST, ends at Fri 2025-06-27 18:49:36 AEST. --
Jun 27 18:46:40 DietPi systemd[1]: Started Home Assistant (DietPi).
Jun 27 18:47:54 DietPi Home Assistant[1625]: 2025-06-27 18:47:54.879 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
Jun 27 18:48:07 DietPi Home Assistant[1625]: 2025-06-27 18:48:07.212 WARNING (MainThread) [aiohttp_fast_zlib] zlib_ng and isal are not available, falling back to zlib, performance will be degraded.
Jun 27 18:48:09 DietPi Home Assistant[1625]: 2025-06-27 18:48:09.052 ERROR (ImportExecutor_0) [homeassistant.components.camera.img_util] Error loading libturbojpeg; Camera snapshot performance will be sub-optimal
Jun 27 18:48:09 DietPi Home Assistant[1625]: Traceback (most recent call last):
Jun 27 18:48:09 DietPi Home Assistant[1625]:   File "/home/homeassistant/.pyenv/versions/3.12.7/lib/python3.12/site-packages/homeassistant/components/camera/img_util.py", line 100, in __init__
Jun 27 18:48:09 DietPi Home Assistant[1625]:     TurboJPEGSingleton.__instance = TurboJPEG()
Jun 27 18:48:09 DietPi Home Assistant[1625]:                                     ^^^^^^^^^^^
Jun 27 18:48:09 DietPi Home Assistant[1625]:   File "/home/homeassistant/.pyenv/versions/3.12.7/lib/python3.12/site-packages/turbojpeg.py", line 300, in __init__
Jun 27 18:48:09 DietPi Home Assistant[1625]:     self.__find_turbojpeg() if lib_path is None else lib_path)
Jun 27 18:48:09 DietPi Home Assistant[1625]:     ^^^^^^^^^^^^^^^^^^^^^^^
Jun 27 18:48:09 DietPi Home Assistant[1625]:   File "/home/homeassistant/.pyenv/versions/3.12.7/lib/python3.12/site-packages/turbojpeg.py", line 967, in __find_turbojpeg
Jun 27 18:48:09 DietPi Home Assistant[1625]:     raise RuntimeError(
Jun 27 18:48:09 DietPi Home Assistant[1625]: RuntimeError: Unable to locate turbojpeg library automatically. You may specify the turbojpeg library path manually.
Jun 27 18:48:09 DietPi Home Assistant[1625]: e.g. jpeg = TurboJPEG(lib_path)
root@DietPi:~#

maybe @MichaIng has additional ideas

I’m puzzled as everywhere on the Internet, including this topic, the instructions to get rid of this error are wrong.

Actually you need to install libturbojpeg0 (on Debian at least).

But it probably won’t fix the hanging.

1 Like

Yeah, annoying that HA logs do not differente between “I cannot find library X for feature Y that is never used on this instance and does not affect your HA in any way” and true errors. Actually I do not see any true error in the logs.

  • Custom integration HACS, yeah well, pretty well known integration, no idea why it is still labeled like that.
  • There are indeed faster alternatives than zlib. Since last DietPi version, we install the isal module by default. But aiohttp_fast_zlib functions either way, and it is just about extracting newly installed integrations, which might be some fractions of a second faster with isal or zlib_ng. However, you can add that to mute the warning, if you want:
    sudo -u homeassistant bash
    source /home/homeassistant/pyenv-activate.sh
    pip3 install isal
    exit
    
  • If the system of HA was somewhat hanging/crashing, and you needed to reboot or even power cycle, not uncommon that there was no clean SQLite “shutdown” flag, but does not necessarily mean that there is a problem with it either. I mean SQLite is not a database “server”. Once the database write is done, not really something that could go wrong. Even an ext4 filesystem corruption on hard power cut can be usually recovered from its journal.
  • The camera component even says, that missing libturbojpeg is a performance aspect, and of course for camera-related integrations which use this component only. Don’t ask me why this is even labelled as “ERROR”. libjpeg62-turbo is btw the same on all Debian version, despite the name seems to indicate some detailed versioning, this never changed in a decade :smile:.
    BUT: To make it even more confusing, this Python module seems to look for a different package:
    apt install libturbojpeg0
    
    EDIT: Ah, @urostor mentioned that already. Yeah, at first I also thought it was libjpeg62-turbo, only remembered another case when reading that installing the first did not help. Two JPEG libraries with “turbo” in their name, not something intuitive.
    They say it :slightly_smiling_face:: libjpeg-turbo | About / "libjpeg-turbo" != "TurboJPEG"
  • That some random device auto-detection throws loud errors is also unfortunate. I am no fans of such things anyway: if I want to pair a device, I configure it explicitly, and do not want any system to constantly search around and ping or even try to configure everything it finds.

Enough HA rant :smile:, great software, there are just a few things of principle I would design pretty much the opposite way round than HA does. But others may value exactly their design decisions.

But I don’t think any of the above is the reason for whichever problem you face. HA seems to actually run normal based on what can be seen in the logs, all just warnings and IMO falsely labelled non-errors.

Can you describe a bit more in detail what exactly happens, what you can only fix by rebooting the system?

1 Like

Thx guys,

After months of reading your rants :wink: about great HA, I installed that proper jpg lib, so my journal looks like now:

-- Journal begins at Wed 2025-07-02 19:06:13 AEST, ends at Wed 2025-07-02 19:12:36 AEST. --
Jul 02 19:06:23 DietPi systemd[1]: Started Home Assistant (DietPi).
Jul 02 19:07:39 DietPi Home Assistant[1626]: 2025-07-02 19:07:39.060 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
Jul 02 19:07:52 DietPi Home Assistant[1626]: 2025-07-02 19:07:52.020 WARNING (MainThread) [aiohttp_fast_zlib] zlib_ng and isal are not available, falling back to zlib, performance will be degraded.

Hanging maybe is not the right way. I cannot go to weblink Home Assistant myip:8123/lovelace/0) as usual (I use only on internal network). I cannot load Mobile one too on my android phone.

HC4 is getting slightly warmer as HA is using resources about 10% constantly.
I can log in to Dietpi terminal and actually not system restart HA is enough to get it accessible.

Only monthly updated is doing that so there is something which is not right after update is performed.

But the parent UI myip:8123 works? Probably more an issue with something shown on your custom dashboard, not working anymore with recent HA version or so :thinking:. But that should throw an error in the logs, when/after access fails.

Is it the HA main process or some child process? Maybe debug logs can give some hint: Troubleshooting your configuration - Home Assistant