Corrupt database found - any advise?

It depends on what exactly got corrupted. Generally, I'd go with a previous backup.

How do I know what's been corrupted?

It contains all apps (including automations and app code), devices and device drivers. It doesn’t include files that are added through the file manager. Only the cloud backup include the z-wave database, but restoring the file backup leaves what’s there alone, so this doesn’t cause any issues.

I have done many soft resets and many restores on my main hub and have not had any issues (yet…). It’s scary the first time, not so much the 5th…. :wink:

2 Likes

Seems like so long ago now but I was doing soft resets 2-4 times a day when I needed to test different HubConnect configurations. Soft reset to a backup that has no HubConnect and install it, through soft reset to a config that had the most recent version and do the upgrade.

I haven't needed to do one very often but the practice of doing it 4 times in one day sure improves confidence. :slight_smile:

1 Like

After doing a soft reset I'm starting to see this alert again:

I assumed it was related to the ghost node that I can't find a way to delete. How do I confirm the root cause of this alert?

The only time I had a DB size issue I was also fighting a ghost node. May not have been related, but it sure felt like it. That being said, what are your events and states set to, and how do the device run time stats compare to that setting?

So events and states were set to 100 which I think is the default. I changed to 11 after reading this:

There are certainly a large db log:

Hopefully this stabalizes after going from 100->11 for event/state history

Things like weather, TVs, Roku, and things like that have lots of events, and they seem to create (falsely or not?) that database warning. Not picking on any particular app or device or driver here, but those are often very intensive things with lots of events in general and it can't be helped that they need lots of storage.

But storing needless events seems to make things sluggish and the hub run worse. Setting to 11, or even less for some apps, seems to really calm things down. In particular, I set weather to 1. Why do I need to keep days upon days of past weather events? Or TV stuff, isn't one or two of each event enough?

Before they gave us the ability to manage events in one of the last couple updates, I had hundreds upon hundreds of motion sensors events stored from a year previous! That was ridiculous to say the least. Wasted space at best. Thank goodness we can limit things now.

2 Likes

About 24 hours ago I changed both event and states to 11:

image

Yet my database keeps growing from yesterday:
image

I can only think it's related to that ghost node but I have no way to prove it.

When a database is growing out of control like this, it is probably an issue with the platform software. I believe @gopher.ny has identified an issue where the database engine fails to reuse space, thus causing it to grow out of control, and is working on a potential fix for an upcoming release. You should be able to simply backup your hub, and then restore it to resolve the issue. Or you can perform a soft reset on the hub.

1 Like

It seems like that would only be a temporary fix that would buy me a few days because same thing happened 3 days ago:

and I did perform a soft reset:

1 Like

Okay, then you may want to reach out to support@hubitat.com to see if @bobbyD and @gopher.ny can take a look at your hub.

2 Likes

Is there a thread about this?

It was a reply embedded in another thread that diverted off on a simliar subject to this.

1 Like

If your database keeps growing to 100's of megabytes, please schedule a daily reboot. Each reboot compacts database. There is a change in upcoming 2.2.9 that should fix the issue, or at least greatly reduce its occurrence.

3 Likes

Whilst not "official", I would also recommend @thebearmay 's Hub Info drivers to keep an eye on things over time. Personally I pump this info out to Influx / Grafana, but potentially HubiGraphs may still be an option... not sure..

2 Likes

Thank you. I scheduled a reboot every night at 3:30 AM and after checking today I don't see any growing db alerts. I will keep an eye on it.

Did this end up getting this addressed in the release? I don't recall reading anything about it in the release notes.

There were quite a few changes to address it specifically, yes. I haven't had any reports of it happening on 2.2.9 so far.

2 Likes

After updating to 2.2.9 i performed a database cleanup command and rebooted one additional time and my DB is stable and i have noticed that my available memory hasn't been dropping like a stone.
So id say it has been fixed

3 Likes