Alert - Your database is growing

This is definitely the case, it was stable for 6 days then I did a full shut down yesterday, totally forgot about this issue. Now this morning the DB is showing it is at 132. Going to do a regular reboot and it should go back to normal again.

1 Like

My hub is pretty streamlined, I have no rules as I use Node-Red for that. I run only HE apps that are needed to get the basic functionality I need (MakerAPI, Lock Code Manager, Groups and Scenes and Zone Motion Controller)

Hub will run great until free memory starts getting low and then it will start doing weird things like shutting the zigbee radio off, this normally takes about 6-8 days. To date that has not been a problem as I monitor the memory from Node-Red and when it reaches close to the critical point I determined, I have Node-Red setup to issue a reboot command. This has worked great for the last 12+ months.

Recently I upgraded from 2.2.7.126 to 2.2.8.156 doing a soft reset after the upgrade and restoring from a local backup. Everything runs great, however when it depletes the free memory and reboots things get weird. Within 2-3 hours I will start getting notifications from Node-Red that the database is growing (I monitor the db size as well). If not rebooted it will continue to grow until the hub starts going crazy (lose zigbee, stops responding etc. ). A reboot simply starts the same process over, I have tried the double reboot as well but no luck there either. A soft reset and restore always gets it back to normal.

I reverted back to 2.2.7.126 and all is well again as I do not have any issues with rebooting causing the db growth.

Just another observation and oddity to ponder.

@gopher.ny I think I need your help.

I migrated from C5 to C7 this week and the C7 database keeps growing till the hub dies. I have (several times) downloaded a backup, run soft reset, restored the backup. Did that this morning. I checked the db size after that and it was 42. In 3 hours it has grown to 349.

I read through this post and tried setting the event and state history to 10 followed by db cleanup. Then I saw your post saying set them to 11 - which I have now done, followed by cleanup then reboot. It is now at 6 - but I'm afraid it is going to continue filling and crashing. Is there anything else I can do, or can you take a look?

This issue is not related to event/device history size. It should be addressed (or at least greatly reduced) in upcoming 2.2.9 update. Sorry about that...

Please schedule a daily reboot using Rule Machine or a community rebooter app in the meantime. Database gets compacted on every reboot; if it starts growing, a reboot will bring it back to the baseline.

@gopher.ny
Yikes! I will have to reboot about 4x daily - I saw it over 3GB a couple times yesterday then it becomes non-responsive and power off/on leaves the hub with "corrupt database" which then requires another round of soft reset and db restore then reboot.

Couple questions, if I may. What are the "default" settings for events and state history?

Why did this issue only happen to me after migration from C5 to C7?

What is being fixed in 2.2.9 that fixes this?

It's growing that fast after a reboot?

100 for both in 2.2.8 if starting from an empty database. That will decrease to 20 in 2.2.9.

The growth issue appears to be triggered by database access while it's being compacted. 2.2.9 prevents that from happening.

Well I've been doing a bunch of stuff. In addition to migrating from C5 to C7 I have also been moving to local control for my 2 GDO - so changing rules to try to get that working as expected. I've also had to reset most cloud integrations and I've been fixing things as I see them since I started the migration. So the growth could be related to all the changes I'm making in addition to whatever it's doing that makes it grow.

I rebooted 3 hours ago and dbSize has gone from 6 to 36 in 3 hours... not even close to the growth I saw yesterday. Part of the problem was I restored it, made a bunch of changes, then it crashed before I had the opportunity to backup and after soft reset routine I had to make all my changes again.

Will 2.2.9 "change" the setting to 20 regardless of where it is now? i.e. if folks have it at 5 or 10 will it jump to 20? or if folks have it at 200 will it jump to 20? or is it just if it is currently "at default"?

That's normal.

No.

1 Like

@DarellCraighead, the fix for me has been after a power off and cold boot, to then do a standard reboot from the UI. Once I do a regular reboot it is stable indefinitely. Mine has been stable under 40Mb for the past 7 days and I have only rebooted once in that time.

Yeah, problem is, after the cold power off my database shows corrupted and no option to get to the settings/reboot page. :frowning:

Can you get to port 8081, i.e. http://yourHubIP:8081 ?

Is that after the DB gets so large that it crashes the hub? After you get it restored and working, right away try doing a full power down, unplug for a minute then power up. Once you can get to the UI again, do a reboot. Mine has never gotten to the point where it crashed the hub, I have noticed well before that point.

Unless there is something else going on for other people causing the problem, but for me after a reboot the database is perfectly stable. I have my Max Event and State Days set to 60, and most devices Event / State history set to 100/30.

So my hub has crashed a few times in the last fortnight and I didn't think anything of it and just restarted once and cold rebooted once.

This evening I came home and nothing was working again, only to try and load the web interface and get tons of 404 errors with SQL code displayed. In amongst that I saw an error about database size so found this post.

I managed to get the reboot to work through the diagnostic interface, though now I get a constant error about corrupted database no matter what I do.

Does this now mean Im foobar? How common is this error? I guess there is a bug at the moment...

(I'm running the latest version, though no idea why I installed it a few weeks ago given I haven't changed any settings on my hub in the last few months)

Corrupt databases happen occasionally. You will want to:

  1. Download your latest backup via the diagnostic interface (just in case).
  2. Soft reset your hub
  3. Once on the reset hub, go to the backup/restore screen and download another copy of your latest backup (assuming you can).
  4. Restore the backup of your database via the downloaded file (rather than from the file on the hub - I understand it will help repair the DB that way)
1 Like

Agreed. My issue was after it crashed, pulled power for 1 minute and booted - the UI loaded to the "corrupt database" screen. From there I was able to go to the maintenance page and do a soft reset, reboot, restore database, and reboot again - that got me up and running at least.

Problem was, my database kept growing FAST. In 6 hours I saw it jump to 3513m at one point and then it crashed again. This happened several times over a couple of days. In the last round I tried changing the event/state history to 10 and added database cleanup (which should have already happened after reboot). After that I captured what I think was the smallest and cleanest backup of the database and iirc I ran through the soft reset once more and I have been stable since. DB currently at 47.

I think I just got trapped with the problem in 2.2.8 that causes the db to grow - AND I decided to migrate from C5 to C7 and things really went sideways. Pretty sure I'm good on this front for now. Just have to go back and fix my GDO routines a bit more now.

Add me to this database growing issue. I too am migrating off of Vera and on to HE. I'm only doing 2-3 Z-Wave devices at a time though, every 3-4 days. No rules, on either Vera or HE. I am running MSR for all that. Anyway, I was in the same issue DarellCraighead was. A reboot caused the DB corruption error message. It would not take my restore from the UI. Giving me a 500 error. Luckily I had opened the Backup link in a new tab. Pointed to my local copy and hit restore. This was all Friday afternoon when my DB was 2590. After a 30 minute scare, it came back to life and appeared normal. Today, 2 days later, its now 1025 and growing. When is 2.2.9 planned to be coming out?

EDIT: This round a reboot didn't clear the message. I shutdown the hub, unplugged for 30+ seconds, and plugged it back in. The message is now gone. Is there a way I can watch the DB without having to have extra tools or apps? (New to HE still)

EDIT: 17 hours later, the alert is back and my DB is 603.

Download a fresh backup.
Do a Soft Reset from http://HUBIP:8081.
Restore from backup.
Shut down then remove power > 1 minute.
Power back up.
** Initiate a restart from the UI **. This step seems to be key to the DB not exploding again.

After doing all those steps my hub has stabilized.

You can monitor your DB size using [RELEASE] Hub Information Driver - Developers - Hubitat

It creates a new device you can monitor from. Make sure you enable
Screen Shot 2021-09-27 at 10.26.24 AM

And hit initialize - then give it a minute or two to report.

1 Like

Just to confirm, the restart from the UI, and the restore, is all done from the Diags screen on port 8081?
Or is the restore done from the Diags page and the restart is via the general WebUI with the Reboot Hub link?

I have never had mine get so bad I had to soft reset, but every time I have to power down and boot back up I have been following it up with a reboot using the "Reboot Hub" link from the regular admin UI on the settings page. That's what has been working for me. If I don't do the reboot then the DB grows at a constant rate until I do the reboot, at which time it normalizes and stays stable.

2 Likes

After the Soft Reset I was able to all the remaining steps from the regular UI