home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.79k stars 30.49k forks source link

Home-assistant stops viewing energy usage #124391

Closed ifrenken closed 1 month ago

ifrenken commented 2 months ago

The problem

Sinds several days home-assistant stops viewing energy usage somewhere between 4-5 am. So the dashboard stays empty until I reboot the system and then it fills up again. Also I not notice that some integrations are not working anymore, also until the system is rebooted. This all started August 18, after I ran an update.

What version of Home Assistant Core has the issue?

core-2024.8.2

What was the last working version of Home Assistant Core?

core-2024.8.0

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

joostlek commented 2 months ago

Please provide more information about the system, integration, screenshots, logs

ifrenken commented 2 months ago

Here is the logging from this night included home-assistant_2024-08-23T06-24-07.710Z.log

ifrenken commented 2 months ago

Please provide more information about the system, integration, screenshots, logs

I have added a log file, what do you need more?

ifrenken commented 2 months ago

Logger: homeassistant.components.recorder.migration Source: components/recorder/migration.py:2696 integration: Recorder (documentation, issues) First occurred: 1:04:50 PM (1 occurrences) Last logged: 1:04:50 PM

Error recreating SQLite table states 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/components/recorder/migration.py", line 2696, 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)

joostlek commented 2 months ago

database or disk is full

ifrenken commented 2 months ago

System Information

version core-2024.8.3
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 x86_64
timezone Europe/Amsterdam
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok HACS Data | ok GitHub API Calls Remaining | 4988 Installed Version | 2.0.0 Stage | running Available Repositories | 1458 Downloaded Repositories | 18
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 13.1 -- | -- update_channel | stable supervisor_version | supervisor-2024.08.0 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 48.5 GB disk_used | 41.8 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | kvm board | ova supervisor_api | ok version_api | ok installed_addons | File editor (5.8.0), Home Assistant Google Drive Backup (0.112.1), Let's Encrypt (5.1.1), Log Viewer (0.17.0), Node-RED (18.0.5), Samba share (12.3.2), Terminal & SSH (9.14.0), SNMP Server (1.0.0), AirCast (4.2.1), Zigbee2MQTT (1.39.1-1), Mosquitto broker (6.4.1), Studio Code Server (5.15.0), Whisper (2.1.2), Piper (1.5.2), ESPHome (2024.8.0), Matter Server (6.4.1), Samba Backup (5.2.0)
Dashboards dashboards | 6 -- | -- resources | 7 views | 14 mode | storage
Recorder oldest_recorder_run | June 28, 2024 at 8:03 AM -- | -- current_recorder_run | August 26, 2024 at 12:49 PM estimated_db_size | 10523.40 MiB database_engine | sqlite database_version | 3.45.3
Sonoff version | 3.7.3 (e240aaf) -- | -- cloud_online | 0 / 13 local_online | 7 / 7
ifrenken commented 2 months ago

So as you can see I have free space.

joostlek commented 2 months ago

You need more free space. The database is trying to do a migration and you need at least double the database size free

ifrenken commented 2 months ago

So the DB size is around 10 GB, so I need 20 GB free. Could this also be my issue that in the morning I have those failures?

joostlek commented 2 months ago

I think it will probably run that code around that time

ifrenken commented 1 month ago

I resized the disk and with enough free space it solved the issue. Now running without any problems. Thanks for your help!