Hass OS on SSD crashes

Hello,
Yesterday I installed a HassOs (2021.12.4) on my RPI-4 (4Gb of RAM) on kingston SSD drive. The system successfully booted and working until today. The log file shows a lot of error regarding SQL.

Before booting HassOs i’ve updated RPI eeprom to allow boot from usb drives

Some of errors:

Logger: homeassistant.components.recorder
Source: components/recorder/__init__.py:940
Integration: Recorder (documentation, issues)
First occurred: 13:17:31 (279 occurrences)
Last logged: 14:38:31
Error in database connectivity during commit: Error executing query: (sqlite3.OperationalError) disk I/O error (Background on this error at: https://sqlalche.me/e/14/e3q8). (retrying in 3 seconds)
Logger: homeassistant.components.recorder
Source: components/recorder/__init__.py:963
Integration: Recorder (documentation, issues)
First occurred: 13:17:34 (278 occurrences)
Last logged: 14:38:27
SQLAlchemyError error processing event <Event time_changed[L]: now=2021-12-23T14:37:01.002018+02:00>: This connection is on an inactive transaction. Please rollback() fully before proceeding. (Background on this error at: https://sqlalche.me/e/14/8s2a)
SQLAlchemyError error processing event <Event time_changed[L]: now=2021-12-23T14:37:31.001136+02:00>: This connection is on an inactive transaction. Please rollback() fully before proceeding. (Background on this error at: https://sqlalche.me/e/14/8s2a)
SQLAlchemyError error processing event <Event time_changed[L]: now=2021-12-23T14:38:01.001942+02:00>: This connection is on an inactive transaction. Please rollback() fully before proceeding. (Background on this error at: https://sqlalche.me/e/14/8s2a)
SQLAlchemyError error processing event <Event time_changed[L]: now=2021-12-23T14:38:17.001634+02:00>: This connection is on an inactive transaction. Please rollback() fully before proceeding. (Background on this error at: https://sqlalche.me/e/14/8s2a)
SQLAlchemyError error processing event <Event time_changed[L]: now=2021-12-23T14:38:24.000903+02:00>: This connection is on an inactive transaction. Please rollback() fully before proceeding. (Background on this error at: https://sqlalche.me/e/14/8s2a)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 707, in _process_one_event_or_recover
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 874, in _process_one_event
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 937, in _commit_event_session_or_retry
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 963, 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 2361, in commit
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2560, in _do_commit
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 549, in _invalid_transaction
sqlalchemy.exc.PendingRollbackError: This connection is on an inactive transaction.  Please rollback() fully before proceeding. (Background on this error at: https://sqlalche.me/e/14/8s2a)

Before HassOs I had installation of HASS on RaspberryPi Os in docker container. Everything was installed on SD Card and there wasn’t any errors.

So I have question, does HassOs can be installed on SSD, or there limitation?

If you do not mind losing historical data, delete the db and restart the HA. A new one is created.

1 Like

I do not care about historical data, I just want that this work in future. After hard reset of RPI, HassOS works fine for 3 days

Hi there, I’m having the same problem, from around Christmas 2021.

At first I thought it was for the “unsupported” installation method (Home Assistant Supervised, but on Raspbian), so I changed it with Hassio (even if it was stable from around a year). It seemed stable at first, but it lasts 3-4 days without rebooting.

I can’t understand why this keeps happening, also because it’s usually stop running and the logs are inaccessible. The last time (now) I was able to check the log, and Google brought me here.

From other errors around, it looks like the file system become suddenly read-only… maybe it’s related to this? Hass.io filesystem suddenly changes to readonly

Logger: homeassistant.components.websocket_api.http.connection
Source: config.py:936
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 22:14:19 (1 occurrences)
Last logged: 22:14:19
[547412351056] [Errno 5] I/O error

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
  File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call
  File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
  File "/usr/src/homeassistant/homeassistant/components/hassio/__init__.py", line 586, in async_handle_core_service
  File "/usr/src/homeassistant/homeassistant/config.py", line 936, in async_check_ha_config_file
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 846, in exec_module
  File "<frozen importlib._bootstrap_external>", line 982, in get_code
  File "<frozen importlib._bootstrap_external>", line 1040, in get_data
OSError: [Errno 5] I/O error
Logger: aiohttp.server
Source: config.py:936
First occurred: 22:14:23 (1 occurrences)
Last logged: 22:14:23
Error handling request

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, 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 220, in forwarded_middleware
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, 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 181, in auth_middleware
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, 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
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 846, in exec_module
  File "<frozen importlib._bootstrap_external>", line 982, in get_code
  File "<frozen importlib._bootstrap_external>", line 1040, in get_data
OSError: [Errno 5] I/O error
Logger: homeassistant.util.file
Source: util/file.py:37
First occurred: 04:43:15 (51 occurrences)
Last logged: 22:11:55

    Saving file failed: /config/.storage/auth
    Saving file failed: /config/.storage/core.entity_registry

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/file.py", line 37, in write_utf8_file_atomic
  File "/usr/local/lib/python3.9/contextlib.py", line 119, in __enter__
  File "/usr/local/lib/python3.9/site-packages/atomicwrites/__init__.py", line 166, in _open
  File "/usr/local/lib/python3.9/site-packages/atomicwrites/__init__.py", line 183, in get_fileobject
  File "/usr/local/lib/python3.9/tempfile.py", line 332, in mkstemp
  File "/usr/local/lib/python3.9/tempfile.py", line 251, in _mkstemp_inner
OSError: [Errno 30] Read-only file system: '/config/.storage/tmpty57yvrm'