Hello,
below I have share the details of my setup. I’m running HA on an ODROID n2+ with 64GB of storage. The recorder currently uses almost 34GB of that, which leads to a disk space usage ration of 98%. Not a good state for my production system to be in
I did try to purge the recorder in various flavors of the below but nothing happens.
action: recorder.purge
data:
keep_days: 1
repack: false
apply_filter: false
Is anyone out here experienced with the sqlite storage managed by HA and how I can cleanse it? I would be totally fine to delete all history and bring the database close to zero size. What is the best way to access the database directly and which tables would I want to delete or be careful around?
Thanks!
Edit: As suspected, the purge command errors out because of the full disk issue itself.
2024-10-09 19:32:12.472 ERROR (Recorder) [homeassistant.helpers.recorder] Error executing query
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
self.dialect.do_execute(
File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 924, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: database or disk is full
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/recorder.py", line 101, in session_scope
yield session
File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 2708, in rebuild_sqlite_table
session.execute(text(f"DROP TABLE {orig_name}"))
File "/usr/local/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2351, in execute
return self._execute_internal(
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2245, in _execute_internal
result = conn.execute(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1418, in execute
return meth(
^^^^^
File "/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
return connection._execute_clauseelement(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
ret = self._execute_context(
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
return self._exec_single_context(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 2353, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
self.dialect.do_execute(
File "/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 924, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database or disk is full
[SQL: DROP TABLE states]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
version |
core-2024.10.0 |
installation_type |
Home Assistant OS |
dev |
false |
hassio |
true |
docker |
true |
user |
root |
virtualenv |
false |
python_version |
3.12.4 |
os_name |
Linux |
os_version |
6.6.46-haos |
arch |
aarch64 |
timezone |
Europe/Berlin |
config_dir |
/config |
Home Assistant Community Store
GitHub API |
ok |
GitHub Content |
ok |
GitHub Web |
ok |
HACS Data |
ok |
GitHub API Calls Remaining |
5000 |
Installed Version |
2.0.1 |
Stage |
running |
Available Repositories |
1441 |
Downloaded Repositories |
74 |
Home Assistant Supervisor
host_os |
Home Assistant OS 13.1 |
update_channel |
stable |
supervisor_version |
supervisor-2024.10.0 |
agent_version |
1.6.0 |
docker_version |
26.1.4 |
disk_total |
56.6 GB |
disk_used |
54.2 GB |
healthy |
true |
supported |
true |
host_connectivity |
true |
supervisor_connectivity |
true |
ntp_synchronized |
true |
virtualization |
|
board |
odroid-n2 |
supervisor_api |
ok |
version_api |
ok |
installed_addons |
Mosquitto broker (6.4.1), Samba share (12.3.2), SSH Tunnel & Forwarding (1.2.1), Terminal & SSH (9.15.0), Studio Code Server (5.16.3), evcc (0.130.12), Rclone Backup (3.3.2) |
Dashboards
dashboards |
4 |
resources |
47 |
views |
12 |
mode |
storage |
Recorder
oldest_recorder_run |
23. Juni 2024 um 08:11 |
current_recorder_run |
9. Oktober 2024 um 18:23 |
estimated_db_size |
33722.29 MiB |
database_engine |
sqlite |
database_version |
3.45.3 |
Solcast PV Forecast
error |
failed to load: unknown |