History/Recorder Freezes after a few hours after upgrade to 107

Hello world!
First topic for me here and unfortunately it’s because I’m facing issues, I think whit the Recorder. Everything was working just fine until I upgraded to 0.107.0 and I’m now at 0.107.4 after a half dozen of restarts and tries without success.

image

Then I found this “open” topic but didn’t help me

The log doesn’t provide any useful info. I will wait until it happens again and I will post the fresh log if you need but in the meantime maybe some of you know what is causing the issue. Has anyone an idea of what could be freezing my Recorder?

Which kind of database are you running?
Set the logger for the recorder to debug.

logger:
  default: warn
  logs:
    homeassistant.components.recorder: debug

It’s most likely the device. I have a BME280 that does the same thing after a few days. I set an automation to restart the device nightly.

are you using external database?

I did actually switch to MariaDB last week but this is long standing and irrelevant to my suggestion.

1 Like

@typeonegative - I’m using a Rpi3 using the standard database.
@VDRainer - Ok, I will set the logger in that configuration and share it as soon as it happens again.
I also updated my tasmota devices from 8.1.0 to 8.2.0 this morning, so we’ll see if maybe that fixes it.

@DavidFW1960 - The sensors used to work perfectly, even for several weeks, without issues; I never ever needed to restart the tasmota devices, the HA or anything for a similar cause. But I would be curious to know why that happens to you, do you think it’s the sensor itself or the host?

Thanks to all for your replies!

Tasmota support said it was the sensor but I replaced the sensor and it still does it. The old one works fine in a different location as well. It could be WiFi as it’s weak in that spot.

Make sense.

Here we go again. Since last night it has happened twice and the only error about the recorder I could find is the following:


ERROR (SyncWorker_14) [homeassistant.components.recorder.util] Error executing query: (sqlite3.OperationalError) database is locked (Background on this error at: http://sqlalche.me/e/e3q8)

Googling the error message led me to this (@DavidFW1960 familiar?):


…and in more or less all the other posts related to this problem I could find I red a variation of this sentence:

“Ended up migrating the recorder from the default SQLite to MySQL”

  • Negatives: I don’t like to go for the easiest solution, especially without understanding the issue but I’m too novice to dig into this myself; I know nothing about databases, I’ll leave the fun to someone more expert.
  • Positives: Upgrading to MariaDB looks like a must that sooner or later I would have adopted anyway; I might as well start with it now, hoping it’ll solve this problem.

But it’s weird, don’t you think?

image

I did not increase the number of sensor or variables, I did not add any new sensor or installed any new custom component. It just happened after the upgrade to 107. I deleted the db and restarted a few times already and, unsuccessful, I later configured the recorder (and logbook) to exclude dozens of “signals” and that did not help a little.

recorder:
  purge_keep_days: 7
  purge_interval: 1
  commit_interval: 1
  exclude:
    domains:
      - automation
      - updater
      - group
      - media_player
      - zone
logbook:
  exclude:
    domains:
      - automation
      - updater
      - group
      - media_player
      - zone

I hope someone will understand the cause of this and release a fix in some upcoming version because I think it’s happening to a lot of people.

This is happening to me too after upgrading from 0.106 to 0.107.

I’m using MariaDB with the standard install on a Raspberry Pi 3. I’ve tried to uninstall MariaDB and start over with a new DB, but with the same result. It logs for a little while (seconds…) and then stops.

1 Like

If it started with 0.107 and no other changes, file a GitHub issue. Could be related to the work in PR #32596 though I did not look closely at that so maybe I’m wrong.

Alrighty, I think I will wait for a proper solution in this case.
Thanks for your sharing.

It seems like it’s fixed in 0.107.7: https://github.com/home-assistant/core/pull/33253

I saw, thanks!
I’ve updated all my posts around but this one ahah.
I’m just a bit concerned because it mentions only MariaDB and not the default one. I can only hope it’ll be an accidental fix for the default DB too.
Thanks everyone for the support, I’ll update this post after the 107.7 comes out.