Regulary Crashes of HA OS

Hi
I have installed

  • Installationsmethode: Home Assistant OS
  • Core: 2025.6.1
  • Supervisor: 2025.05.5
  • Operating System: 15.2
  • Frontend: 20250531.3

On a Raspberry PI 5 since several month. It is installed on a NVMe-Disk, so no SSD-Card for booting.

Since some days it is no more working after some days. I can not connect, ping is still replying, so it seems to be on the network, but also ssh is no more working.
I have no screen on it.

Then I have to reboot it and mostly it recovers after first reboot again, today I had to reboot it twice.

When I try go check the logs, I can not see any errorrs which could be the reason. The device is not extremly hot, I have a monitor which shows me cpu temperature, it is never more than 51°C before the crash:

Last crash seems to be this morning 4:35, but in the logs there is nothing:

Jun 18 02:42:21 homeassistant systemd-resolved[528]: Clock change detected. Flushing caches.
Jun 18 02:42:21 homeassistant audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=unconfined msg='unit=systemd-timesyncd comm="systemd" e
Jun 18 02:42:21 homeassistant systemd-time-wait-sync[634]: adjtime state 5 status 40 time Wed 2025-06-18 02:42:21.496805 UTC
Jun 18 02:42:21 homeassistant systemd-timesyncd[635]: System clock time unset or jumped backwards, restored from recorded timestamp: Wed 2025-06-18 02:42:21
Jun 18 02:42:21 homeassistant systemd[1]: Started Network Time Synchronization.
Jun 18 02:42:21 homeassistant systemd[1]: Reached target System Time Set.
Jun 18 20:36:21 homeassistant systemd-time-wait-sync[634]: adjtime state 0 status 2000 time Wed 2025-06-18 20:36:21.755677 UTC
Jun 18 20:36:21 homeassistant systemd-resolved[528]: Clock change detected. Flushing caches.
Jun 18 20:36:21 homeassistant systemd-timesyncd[635]: Contacted time server 162.159.200.123:123 (time.cloudflare.com).
Jun 18 20:36:21 homeassistant systemd-timesyncd[635]: Initial clock synchronization to Wed 2025-06-18 20:36:21.755616 UTC.
Jun 18 20:36:21 homeassistant systemd[1]: Finished Wait Until Kernel Time Synchronized.
Jun 18 20:36:21 homeassistant audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=unconfined msg='unit=systemd-time-wait-sync comm="syste
Jun 18 20:36:21 homeassistant systemd[1]: Reached target System Time Synchronized.

what could be the reason or where can I find more logs?

Thanks for your help.
Lukas

Start here.

Thanks for that, I tried to access the logs, but how can I access to the \config folder? I am connected by ssh, but can not find that folder

In Core Log I see following errors:

Error setting up platform file
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 112, in async_setup_platform
    raise HomeAssistantError("Invalid notify platform.")  # noqa: TRY301
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant.exceptions.HomeAssistantError: Invalid notify platform.

Logger: py.warnings
Quelle: components/tesla_fleet/__init__.py:8
Erstmals aufgetreten: 18. Juni 2025 um 23:21:44 (10 Vorkommnisse)
Zuletzt protokolliert: 18. Juni 2025 um 23:21:44

/usr/local/lib/python3.13/site-packages/google/protobuf/runtime_version.py:98: UserWarning: Protobuf gencode version 5.29.2 is exactly one major version older than the runtime version 6.31.1 at vehicle.proto. Please update the gencode to avoid compatibility violations in the next runtime release. warnings.warn(
/usr/local/lib/python3.13/site-packages/google/protobuf/runtime_version.py:98: UserWarning: Protobuf gencode version 5.29.2 is exactly one major version older than the runtime version 6.31.1 at vcsec.proto. Please update the gencode to avoid compatibility violations in the next runtime release. warnings.warn(
/usr/local/lib/python3.13/site-packages/google/protobuf/runtime_version.py:98: UserWarning: Protobuf gencode version 5.29.2 is exactly one major version older than the runtime version 6.31.1 at keys.proto. Please update the gencode to avoid compatibility violations in the next runtime release. warnings.warn(
/usr/local/lib/python3.13/site-packages/google/protobuf/runtime_version.py:98: UserWarning: Protobuf gencode version 5.29.2 is exactly one major version older than the runtime version 6.31.1 at managed_charging.proto. Please update the gencode to avoid compatibility violations in the next runtime release. warnings.warn(
/usr/local/lib/python3.13/site-packages/google/protobuf/runtime_version.py:98: UserWarning: Protobuf gencode version 5.29.2 is exactly one major version older than the runtime version 6.31.1 at universal_message.proto. Please update the gencode to avoid compatibility violations in the next runtime release. warnings.warn(

Logger: homeassistant.components.influxdb
Quelle: components/influxdb/__init__.py:594
Integration: InfluxDB (Dokumentation, Probleme)
Erstmals aufgetreten: 18. Juni 2025 um 23:57:53 (1 Vorkommnis)
Zuletzt protokolliert: 18. Juni 2025 um 23:57:53

Cannot connect to InfluxDB due to '{"error":"timeout"}'. Please check that the provided connection details (host, port, etc.) are correct and that your InfluxDB server is running and accessible.

Logger: homeassistant.components.recorder.core
Quelle: components/recorder/core.py:907
Integration: Recorder (Dokumentation, Probleme)
Erstmals aufgetreten: 18. Juni 2025 um 23:58:13 (1 Vorkommnis)
Zuletzt protokolliert: 18. Juni 2025 um 23:58:13

SQLAlchemyError error processing task CommitTask()
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 907, in _process_one_task_or_event_or_recover
  File "/usr/src/homeassistant/homeassistant/components/recorder/tasks.py", line 295, in run
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 1206, in _commit_event_session_or_retry
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 1232, in _commit_event_session
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/orm/session.py", line 2365, in execute
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/orm/session.py", line 2241, in _execute_internal
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/orm/session.py", line 2110, in _connection_for_bind
  File "<string>", line 2, in _connection_for_bind
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/orm/state_changes.py", line 103, in _go
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/orm/session.py", line 996, in _raise_for_prerequisite_state
sqlalchemy.exc.InvalidRequestError: This session is in 'prepared' state; no further SQL can be emitted within this transaction.

Logger: homeassistant.components.recorder.core
Quelle: components/recorder/core.py:899
Integration: Recorder (Dokumentation, Probleme)
Erstmals aufgetreten: 18. Juni 2025 um 23:58:13 (1 Vorkommnis)
Zuletzt protokolliert: 18. Juni 2025 um 23:58:13

Unrecoverable sqlite3 database corruption detected: (sqlite3.DatabaseError) database disk image is malformed [SQL: SELECT states_meta.metadata_id, states_meta.entity_id FROM states_meta WHERE states_meta.entity_id IN (?)] [parameters: ('sensor.feuchte_absolut_g_kg',)] (Background on this error at: https://sqlalche.me/e/20/4xp6)
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1964, in _exec_single_context
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/default.py", line 945, in do_execute
sqlite3.DatabaseError: database disk image is malformed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 899, in _process_one_task_or_event_or_recover
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 1046, in _process_one_event
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 1141, in _process_state_changed_event_into_session
  File "/usr/src/homeassistant/homeassistant/components/recorder/table_managers/states_meta.py", line 63, in get
  File "/usr/src/homeassistant/homeassistant/components/recorder/table_managers/states_meta.py", line 113, in get_many
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 188, in execute_stmt_lambda_element
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/orm/session.py", line 2365, in execute
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/orm/session.py", line 2251, in _execute_internal
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/orm/context.py", line 306, in orm_execute_statement
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1416, in execute
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/sql/lambdas.py", line 597, in _execute_on_connection
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1638, in _execute_clauseelement
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1843, in _execute_context
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1983, in _exec_single_context
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 2352, in _handle_dbapi_exception
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1964, in _exec_single_context
  File "/usr/local/lib/python3.13/site-packages/sqlalchemy/engine/default.py", line 945, in do_execute
sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) database disk image is malformed
[SQL: SELECT states_meta.metadata_id, states_meta.entity_id 
FROM states_meta 
WHERE states_meta.entity_id IN (?)]
[parameters: ('sensor.feuchte_absolut_g_kg',)]
(Background on this error at: https://sqlalche.me/e/20/4xp6)

Logger: homeassistant.components.recorder.util
Quelle: components/recorder/util.py:307
Integration: Recorder (Dokumentation, Probleme)
Erstmals aufgetreten: 18. Juni 2025 um 23:58:13 (1 Vorkommnis)
Zuletzt protokolliert: 18. Juni 2025 um 23:58:13

The system will rename the corrupt database file //config/home-assistant_v2.db to //config/home-assistant_v2.db.corrupt.2025-06-18T21:58:13.361272+00:00 in order to allow startup to proceed

Logger: homeassistant.components.recorder.core
Quelle: components/recorder/core.py:1208
Integration: Recorder (Dokumentation, Probleme)
Erstmals aufgetreten: 18. Juni 2025 um 23:58:10 (890 Vorkommnisse)
Zuletzt protokolliert: 00:40:08

Error in database connectivity during commit: Error executing query: (sqlite3.OperationalError) disk I/O error (Background on this error at: https://sqlalche.me/e/20/e3q8). (retrying in 3 seconds)
Error in database connectivity during commit: Error executing query: (sqlite3.OperationalError) unable to open database file (Background on this error at: https://sqlalche.me/e/20/e3q8). (retrying in 3 seconds)

I am really lost here…it seems to be a bigger problem…

in logged in ssh I see after every command:

Input/output error

could it be a disk error? How to fix it, hopefully without reinstallation, it is to much work for me…

It’s complaining of database corruption. You will need to either 1 blow away and start over with a new dB (if there’s nothing Important) or 2)fix it.

I am not a dB person fixingvit it beyond my skilset.

Why it corrupted??? No clue is it your disk. Also can’t tell.

But after Restart now since 19 hours no more errors in the logs about the database, so it seems to be ok? It is mostly running some days, I will see how long now.

I suggest taking a full backup and downloading it to a second computer while you have a chance. If the disk is slowly failing, then you likely have limited time and it is possible you could create a backup before it dies.

After that, I would start by installing smartmontools and calling smartctl to review your SSD S.M.A.R.T. data. If you don’t know how to do this, I have a blog post you can read where I intentionally stress test (and sometimes cause failure in) drives when I first purchase them.

Followed by investigating the filesystem starting with an integrity check (fsck).

Thanks, but I can not install
apt-get install smartmontools
-sh: apt-get: not found

HAOS is not Debian based. Hopefully someone who uses HAOS can help you with that. My article is not specific to home assistant.

Assuming you already took your backup, another option is to disconnect the drive and plug it into a secondary computer that has tools to read the S.M.A.R.T. data.

Beyond that I don’t think I can help further other than providing general direction of what I would do.