HomeAssistant docker crash at least once a day

I have at the moment the PRoblem that home asssitant Docker freezes.
OMV 7 on Debian 12

docker-compose:

homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:latest"
    volumes:
        - /media/wichtig/server/smarthome/homeassistant/config:/config
        - /srv/dev-disk-by-uuid-7c4edeed-cf85-4693-b085-3cf0d92a7284:/config/backups
        - /etc/localtime:/etc/localtime:ro
        - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    privileged: true
    network_mode: host

sudo docker logs homeassistant (last hour)

2024-04-11 20:46:36.394 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:46:48.396 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:47:00.396 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:47:12.397 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:47:24.398 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:47:36.399 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:47:48.400 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:47:50.541 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Exception on post: Cannot connect to host 192.168.2.150:8088 ssl:default [Connect call failed ('192.168.2.150', 8088)]
2024-04-11 20:47:50.541 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Unable to retrieve HUB id
2024-04-11 20:48:00.400 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:48:06.382 ERROR (Recorder) [homeassistant] Error doing job: Unclosed client session
2024-04-11 20:48:12.401 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:48:24.401 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:48:36.402 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:48:48.403 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:49:00.403 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:49:10.977 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Exception on post: Cannot connect to host 192.168.2.150:8088 ssl:default [Connect call failed ('192.168.2.150', 8088)]
2024-04-11 20:49:10.978 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Unable to retrieve HUB id
2024-04-11 20:49:12.404 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:49:24.406 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:49:36.407 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:49:46.390 ERROR (Recorder) [homeassistant] Error doing job: Unclosed client session
2024-04-11 20:49:48.407 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:50:00.408 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:50:12.408 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:50:24.409 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:50:31.191 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Exception on post: Cannot connect to host 192.168.2.150:8088 ssl:default [Connect call failed ('192.168.2.150', 8088)]
2024-04-11 20:50:31.192 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Unable to retrieve HUB id
2024-04-11 20:50:34.623 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session
2024-04-11 20:50:36.415 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:50:48.416 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:51:00.416 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:51:12.416 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:51:24.417 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:51:36.419 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:51:48.420 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:51:51.578 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Exception on post: Cannot connect to host 192.168.2.150:8088 ssl:default [Connect call failed ('192.168.2.150', 8088)]
2024-04-11 20:51:51.579 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Unable to retrieve HUB id
2024-04-11 20:51:51.653 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session
2024-04-11 20:52:00.420 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:52:12.421 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:52:24.422 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:52:36.423 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:52:48.425 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:53:00.425 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:53:11.762 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Exception on post: Cannot connect to host 192.168.2.150:8088 ssl:default [Connect call failed ('192.168.2.150', 8088)]
2024-04-11 20:53:11.762 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Unable to retrieve HUB id
2024-04-11 20:53:12.426 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:53:15.315 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session
2024-04-11 20:53:24.427 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:53:36.431 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:53:48.432 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:54:00.433 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:54:12.434 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:54:24.435 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:54:31.938 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Exception on post: Cannot connect to host 192.168.2.150:8088 ssl:default [Connect call failed ('192.168.2.150', 8088)]
2024-04-11 20:54:31.938 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Unable to retrieve HUB id
2024-04-11 20:54:35.030 ERROR (Recorder) [homeassistant] Error doing job: Unclosed client session
2024-04-11 20:54:36.437 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:54:48.438 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:55:00.438 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:55:12.439 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:55:24.440 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:55:36.441 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:55:48.441 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:55:52.147 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Exception on post: Cannot connect to host 192.168.2.150:8088 ssl:default [Connect call failed ('192.168.2.150', 8088)]
2024-04-11 20:55:52.147 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Unable to retrieve HUB id
2024-04-11 20:55:53.563 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session
2024-04-11 20:56:00.442 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:56:12.443 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:56:24.444 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:56:36.444 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:56:48.445 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:57:00.446 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:57:12.448 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:57:12.461 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Exception on post: Cannot connect to host 192.168.2.150:8088 ssl:default [Connect call failed ('192.168.2.150', 8088)]
2024-04-11 20:57:12.461 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Unable to retrieve HUB id
2024-04-11 20:57:14.184 ERROR (Recorder) [homeassistant] Error doing job: Unclosed client session
2024-04-11 20:57:24.449 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:57:36.451 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:57:48.451 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:58:00.453 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:58:12.453 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:58:24.454 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:58:32.847 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Exception on post: Cannot connect to host 192.168.2.150:8088 ssl:default [Connect call failed ('192.168.2.150', 8088)]
2024-04-11 20:58:32.847 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Unable to retrieve HUB id
2024-04-11 20:58:35.168 ERROR (SyncWorker_20) [homeassistant] Error doing job: Unclosed client session
2024-04-11 20:58:36.456 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:58:48.457 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:59:00.457 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:59:12.458 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:59:24.459 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:59:36.460 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:59:48.460 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 20:59:53.334 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Exception on post: Cannot connect to host 192.168.2.150:8088 ssl:default [Connect call failed ('192.168.2.150', 8088)]
2024-04-11 20:59:53.335 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.2.150: Unable to retrieve HUB id
2024-04-11 20:59:54.421 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session
2024-04-11 21:00:00.274 WARNING (Recorder) [homeassistant.components.recorder.db_schema] State attributes for sensor.vorhop_hourly exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored
2024-04-11 21:00:00.461 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 21:00:12.462 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 21:00:24.463 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 21:00:36.463 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2024-04-11 21:00:48.464 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12

Portainer shows it as running


(4 hours before was the last crash…)

Then I have to restart homeassistant and it’s working again.

## System Information

version | core-2024.4.1
-- | --
installation_type | Home Assistant Container
dev | false
hassio | false
docker | true
user | root
virtualenv | false
python_version | 3.12.2
os_name | Linux
os_version | 6.1.0-18-amd64
arch | x86_64
timezone | Europe/Berlin
config_dir | /config

<details><summary>Home Assistant Community Store</summary>

GitHub API | ok
-- | --
GitHub Content | ok
GitHub Web | ok
GitHub API Calls Remaining | 4889
Installed Version | 1.34.0
Stage | running
Available Repositories | 1410
Downloaded Repositories | 19

</details>

<details><summary>Dashboards</summary>

dashboards | 8
-- | --
resources | 11
views | 8
mode | storage

</details>

<details><summary>Recorder</summary>

oldest_recorder_run | 3. April 2024 um 09:54
-- | --
current_recorder_run | 11. April 2024 um 21:19
estimated_db_size | 1888.96 MiB
database_engine | sqlite
database_version | 3.44.2

</details>

Have you tried

ha supervisor repair 

HomeAssistant docker

This is part of my docker compose for home assistant

  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    devices:
      - /dev/serial/by-id/usb-Silicon_Labs_slae.sh_cc2652rb_stick_-_slaesh_s_iot_stuff_00_12_4B_00_23_90_C7_F4-if00-port0
    environment:
      - TZ=Europe/Zagreb
    security_opt:  
      - no-new-privileges
    volumes:
      - /opt/homeassistant/config:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
      - /var/run/docker.sock:/var/run/docker.sock
    depends_on:
      - mosquitto
      - influxdb
    stop_grace_period: 60s
    restart: always

Maybe you are missing docker.sock in your volume. But maybe, not sure.
Mine is not crashing. When it was, it was a hardware problem. Just replaced old comp with another old comp and everything went back to normal.

1 Like

perhaps another info:
Home Assistant Docker was running finde for more than 12 months.

I posted my config that works without any crashing. I don’t say that you done something wrong with you config, but you can spot some differences. You can try mine, but if it continue to crash than you probably have some hardware issue. That was in my case.
The same config different computers. And I was facing the same problem as you did. Random crashes at least once a day.

What is 192.168.2.150:8088?

If it’s your db you need to verify what’s up with that connection. Also, if db is in docker you should be Connecting thru docker not hostip:dbport

EDIT
It look like it is harmony hub?
Still need to find out why connection is poor and may remove Integration to see if HA continue crash

Yeah it’s a harmony hub which is I suspect witched off at the moment.
It’s like this for months.

I made a docker pull last yesterday and will look if that will change anything…

I have been having crashing daily sometimes hourly sometimes instantly after a reboot. Random times per day and i cant work out from the logs whats up, basically the 8123 port just dies and then it doesnt accept any connections from anything.

Its been this way since that latest update.

Im running in docker and i also use harmony integration. Removing that would impact some tv automations i have.

When you say that “8123 just dies”, where are you seeing that? Does the browser say “Connection lost: Reconnecting”?

If you pull the docker logs, does it show the container actually dying? Not the HA logs, but the actual docker logs.

No the container remains online but unhealthy - the container has a health check on port 8123 which is inaccessible when it crashes.

It normally happens when im no where near a computer so trying to review the logs on mobile is tricky to fully understand whats happening.

all ive done so far is use uptime kuma to ping me when its down so i can reboot. Its crashed 3 times today already.

To me that sounds like something in your docker environment is at fault. If it crashes and you can capture the docker logs, that would be helpful.

Do you restart or stop/start the stack?

Restart only does not always correct problems.

You mean the logs for the docker service or the logs relating to the container?

Container logs just appear to be the HA logs from what I have seen.

Since disabling the harmony integration I haven’t had a crash however this means nothing.

I will look to clear out my logs and try and catch when it crashes.