HA unstable, failed to call supervisor / addons - not able to restart HA

Hello all,

I’m very happy with my switch from Homey to Home Assistant with endless possibilities in frontend, dashboarding and all other extra functions!

However, since a couple of weeks my Home Assistent is not stable, and stops working (partly) withing 24 hours.

My Hardware:

  • Raspberry Pi 4B - 8GB RAM
  • SSD Kingston SA400S3 (480 GB) - USB 3.0
  • ConBee II Zigbee USB - USB 2.0
  • Official Power supply from Raspberry Pi
  • P1 Smart Meter USB connected for Utilities - USB 2.0
  • Connected via UTP cable

Installed Add-ons:

Installed HACS - Integrations:

  • Miele Integration
  • Fully Kiosk Browser
  • Afvalinfo
  • Variables+History
  • Eufy Security

Installed HACS - Frontend:

  • Multiple Entity Row
  • Lightalarm Card
  • Button-card
  • Time Picker Card
  • Mini Media Player
  • mini-graph-card
  • simple Thermostat
  • timer bar card

What I’ve tried so far:

  • Changed to other power supply
  • removed the P1 USB cable
  • used backups from before the crashes
  • downgraded the supervisor / core
  • removed non essential HACS addons
  • Moved from the standard recorder to MariaDB and limited what is recorded
  • Moved the Pi (very happy with the storage:

What happens:

  • The errors / stalling of the system happens randomly, in general when i’m NOT using the frontend (like during the night, or after a whole days of work on my Grafana Dashboard).
  • When the crash happens, I see in the frontend that my Zigbee Devices are not working any more (unaivalable)
  • other devies, such as Tuya or Shelly are still working (in the frontend as the real switching of the light).
  • When I go to Supervisor, it doesn’t load
  • When I go to Configuration and check config it says: Config not found
  • When I press reboot / restart HA, I get an error (nothing happens)
  • the only thing that helps and works is pulling the power and reconnecting after a while, everything boots up normally

image

The errors I’m able to retrieve in the “zombie state” as they come-in:

Logger: dsmr_parser.clients.protocol
Source: /usr/local/lib/python3.9/site-packages/dsmr_parser/clients/protocol.py:124
First occurred: 17:28:31 (1 occurrences)
Last logged: 17:28:31

disconnected due to exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/serial_asyncio/__init__.py", line 114, in _read_ready
  File "/usr/local/lib/python3.9/site-packages/serial/serialposix.py", line 595, in read
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

-------------

Logger: homeassistant.components.recorder
Source: components/recorder/__init__.py:924
Integration: Recorder (documentation, issues)
First occurred: 17:28:34 (1 occurrences)
Last logged: 17:28:34

SQLAlchemyError error processing event <Event time_changed[L]: now=2021-12-07T17:27:41.002357+01:00>: Can't reconnect until invalid transaction is rolled back. (Background on this error at: https://sqlalche.me/e/14/8s2b)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 697, in _process_one_event_or_recover
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 835, in _process_one_event
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 898, in _commit_event_session_or_retry
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 924, in _commit_event_session
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 1428, in commit
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 836, in commit
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2330, in commit
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2529, in _do_commit
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 532, in _invalid_transaction
sqlalchemy.exc.PendingRollbackError: Can't reconnect until invalid transaction is rolled back. (Background on this error at: https://sqlalche.me/e/14/8s2b)

-------------

Logger: homeassistant.components.hassio
Source: components/hassio/__init__.py:557
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 17:29:03 (1 occurrences)
Last logged: 17:29:03

Can't read Supervisor data:

-------------

Logger: homeassistant.components.influxdb
Source: components/influxdb/__init__.py:575
Integration: InfluxDB (documentation, issues)
First occurred: 17:29:11 (1 occurrences)
Last logged: 17:29:11

Cannot connect to InfluxDB due to 'b'{"error":"engine: error writing WAL entry: write /data/influxdb/wal/homeassistant/autogen/25/_00006.wal: read-only file system"}\n''. Please check that the provided connection details (host, port, etc.) are correct and that your InfluxDB server is running and accessible.

-------------

Logger: homeassistant.components.hassio.handler
Source: components/hassio/handler.py:230
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 17:29:03 (8 occurrences)
Last logged: 17:30:33

/store return code 500
/supervisor/info return code 500
/addons return code 500

---------------

Logger: homeassistant.components.hassio
Source: components/hassio/websocket_api.py:109
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 17:29:06 (6 occurrences)
Last logged: 17:30:33

Failed to to call /supervisor/info -
Failed to to call /addons -
Failed to to call /store -

---------------

Logger: aiohttp.server
Source: config.py:936
First occurred: 17:30:52 (1 occurrences)
Last logged: 17:30:52

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 92, in forwarded_middleware
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 138, in auth_middleware
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
  File "/usr/src/homeassistant/homeassistant/components/config/core.py", line 29, in post
  File "/usr/src/homeassistant/homeassistant/config.py", line 936, in async_check_ha_config_file
ImportError: cannot import name 'check_config' from 'homeassistant.helpers' (/usr/src/homeassistant/homeassistant/helpers/__init__.py)

If you are still using a SDcard, then that might be faulty.

Hi WallyR, no I’m using a SSD. I did check the SSD for faults using my Windows machine:


image

Just took a look on some of your errors and it seems that you have an invalid transaction that is the direct cause of one of the errors.
One or two of the other errors looks like they are derived from that DB error too, so maybe its a DB error or an error within your DB client.

1 Like

Any suggestions to how to solve the DB error? Go back to the HA-standard Database? I’m using MariaDB because I also noticed errors relating to the DB. I also excluded a lot of domains and entities from the Recorder to relieve the load on the database.

You need to make a call to rollback, something like db.session.rollback() maybe?
The question is what interface you have access to for this.
I am not that much into databases on HA, so I can’t really say what is possible interfaces to use.

I’ve switched from SSD to a SD card, used the latest backup (of the confirguration on the SSD), and is now running smoothly for a couple of days…

About a week ago I went back from SD to SSD. I formated the SSD card (slow) through Windows, and reinstalled HA and reloaded the latest backup from the SD card. Now everything is running very smoothly without errors or instability of the system as a whole!

Hello, if this happens to anyone else, just follow the steps below. It’s a little time consuming, but it’s worth it.

If you run it in your machine’s terminal, execute the following:

docker exec -it hassio_cli /bin/bash

ha su repair

ha core update

ha core rebuild

If you run it in the HA terminal, you don’t need to use the “docker exec -it hassio_cli /bin/bash”

1 Like

@gonzalezryan, thank you!
I’m also had same error “Integration: Home Assistant Supervisor (documentation, issues) Failed to to call /addons -” in log, and many others.
Beside that, CPU load was almost 100% at i7…

Now error log is empty, HA is working stable. Thank you again!