Error executing query: 'Session' object has no attribute 'get_transaction'

Hi,
everytime I start HA (core on a raspberry pi with dietpi) I get the following errors and the recorder is unable to start. How can I solve this?

HA-Version core-2021.5.4

configuration.yaml:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

binary_sensor:  
  - platform: ping
    host: 192.168.6.250
    name: PC
    scan_interval: 10

HA Logfile:

2021-05-16 14:37:09 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //mnt/dietpi_userdata/homeassistant/home-assistant_v2.db was shutdown cleanly
2021-05-16 14:37:09 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: 'Session' object has no attribute 'get_transaction'
2021-05-16 14:37:09 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup to sqlite:////mnt/dietpi_userdata/homeassistant/home-assistant_v2.db: 'Session' object has no attribute 'get_transaction' (retrying in 3 seconds)
Traceback (most recent call last):
File "/home/homeassistant/.pyenv/versions/3.8.8/lib/python3.8/site-packages/homeassistant/components/recorder/__init__.py", line 558, in _setup_recorder
return migration.get_schema_version(self)
File "/home/homeassistant/.pyenv/versions/3.8.8/lib/python3.8/site-packages/homeassistant/components/recorder/migration.py", line 47, in get_schema_version
return current_version
File "/home/homeassistant/.pyenv/versions/3.8.8/lib/python3.8/contextlib.py", line 120, in __exit__
next(self.gen)
File "/home/homeassistant/.pyenv/versions/3.8.8/lib/python3.8/site-packages/homeassistant/components/recorder/util.py", line 52, in session_scope
if session.get_transaction():
AttributeError: 'Session' object has no attribute 'get_transaction'
1 Like

Hi dear specialists out there, nobody who can help?