Alert - Your database is growing

@gopher.ny I am almost positive this does happen like this. I had the exact same thing happen when migrating to a C7 from C5. I had failed pair, then a humungous database almost immediately afterwards. I thought it was just me, so I didn't say anything at the time. It was long enough ago I don't think I can give more details other than I was doing a conventional inclusion, not SmartStart.

Thank you for the clue - I'll try it out/examine the code today.

1 Like

@gopher.ny i would have to agree with this too. A thunderstorm power outage caused several Jasco switches to fail a few weeks ago and I was replacing them on Wed afternoon with warranty replacements. One was giving me pairing troubles and I finally got it paired and didn’t think anything of it. Yesterday I noticed my C7 Zwave hub warning me that the database was growing. I didn’t do anything knowing my hub was scheduled to auto reboot over night. Warning is now gone after reboot. File size of actual downloaded backup wasn’t any bigger than previous nights.

2 Likes

I would like to share my own recent discoveries behind the database alert. A few weeks ago I paired a Danalock Z-Wave lock with S2. The first few days things seemed to be ok. The HE is in my vacation home, so I didn´t monitor it constantly. Then I arrived yesterday to find that my Z-Wave network was unresponsive and a DB alert for ~800Mb.

A restart did lower the DB, but the Z-Wave was still unresponsive / not working. I had to shut down the HE and remove power for 30 seconds and upon restart my Z-Wave started working.. but only for a few hours and then DB had grown and Z-Wave was unresponsive.

This morning, I unpaired the Danalock, shutdown the HE and removed power. Powered it back on and now, several hours later it is working fine. My DB is down to 110 Mb, which is still high, but I do have some apps and drivers logging errors so I am combing through those to lower the noise.

So, in my case, for now, I believe that removing the Danalock did the trick. I have read several threads about S2 devices causing issues, especially locks. I still have one S2 device, a Fibaro Implant, and I am not seeing any issues with that.

I am seeing some oddities here as well. I got the alert the other day and just rebooted, which fixed it. Now it seems to just start randomly creeping up.

Not sure if it is related but today one of my devices I was working with suddenly lost all its info from the "Data" section including the S2 info so now the hub isn't talking to it. I checked my graph and my DB is creeping up again. Rebooted but still the device wont talk to me. I think I will have to do a factory reset and replace on the device to get it back. I am testing a new driver which uses a pretty large @Field Map for all the parameter settings but none of the other devices are having issues.

Broken Device

Similar Device:

When you look at the DB + Free Mem + CPU it all lines up... (The spike in free mem is reboots)


It seems I spoke to soon. My Z-Wave is simply not working now, and my DB is up to 560MB. The only way for me to get my Z-Wave back up and running is via shutdown, power off and restart, and then it will work for some unknown time.

I must say, that all of these devices (bar the Danalock) were connected to my C4 and that was happily chugging along without any of these issues. I even had some devices which I used for holidays only and I never even unpaired them and things were fine despite that. They then were able to come in again to the Mesh when I plugged them in, similar to Zigbee.

I do have a few apps which are consuming a lot in the DB, but those also ran well on the C4, and in the grand scheme of things the percentage is not high. All other automations outside of Z-Wave seem to work as expected (i.e. Zigbee, web services etc.)

Screenshot

I am hoping that there will be some fixes for this in 2.2.9. I wonder when that will be released. Any idea on that @gopher.ny ?

Edit: Let me add, I know that my Z-Wave is down because a Z-Wave repair will fail on all devices (cannot reach them).

Hello there, quick question : how do you access the graphs you posted screenshots of ? Thanks.

Its not part of Hubitat. Those shown are from Grafana. It is a little tricky to setup, you need some sort of a server (old PC or a RPi). The event data flows from Hubitat > Node-Red > InfluxDB2, and then Grafana pulls the data from the InfluxDB.

@gopher.ny not sure if this is helpful at all, but seems since my last reboot I have some sort of a runaway process again building the DB. Before the last reboot it was stable for a few days. I rebooted yesterday because I accidentally locked up the zwave radio by sending a bunch of commands to an unplugged device I was testing.

I will let it simmer in case you want me to get any other info and reboot it later today if I dont hear anything.

Is this useful? Only other thing I could think to include.

Looks like hourly database cleanup isn't running. There is a change to upcoming 2.2.9 that should fix this. I'm still not sure how z-wave radio and database growth are related, but there certainly is a correlation. Please reboot it whenever, I'll check the hub after a reboot.

2 Likes

Rebooted, the runtime stats page looks almost the same but the DB dropped from around 240 down to 9Mb. Maybe I don't understand the runtime stats but I would expect if the old stuff got purged it would be lower? I am going to try setting the history lower and see what happens. I have anything I want logging to another database anyway so I dont need it in HE for much.

Try running this app against a selected attribute on a device

https://raw.githubusercontent.com/thebearmay/hubitat/main/apps/eventStateDisplay.groovy

It will generate a list of all Events and/or States for that attribute that are currently on the hub. I suspect that the counts on the runtime stats may not always get reset during the hourly cleanup - I have one device that is showing almost 11K states, with retention set to 11, and arround 50 attributes (weather device); when I list out all of the states for an attribute I generally end up with less than 15. (uptime is a good attribute to run against on a Hub Information device)

1 Like

That's a handy little app, thanks. One device really stands out in my list, its a device that as been marked disabled and disconnected for a while but I just never excluded it. The states count seems to be right, 7, but the state size... not sure what this means exactly, Seems odd that it is so high for this device though unless it has something to do with the driver being used?

That is interesting, might go into the device and see what it is still storing - I believe it should approximately be the sum of the attributes size * number of states.

This unbounded database growth here results from database engine not reusing empty space in the file. I've made changes to 2.2.9 to hopefully do away with it...

7 Likes

Just wanted to add one more thing if it helps. I think it is happening after a fresh boot from a full shut down. I did that yesterday evening and did not reboot again afterwards and now saw the DB was growing overnight. I can see on my chart the couple of normal reboots I did yesterday it looks stable between those then after the full shut down it went back to growing. I just did a normal reboot a few minutes ago and now it is back to normal and seems stable. I don't normally reboot or shut down this often but I have been messing with some things recently to prompt it.

DB Size and Free Mem

2 Likes

I report this in case it is helpful. I am not an expert so this may be nonsense.

My database has been very stable at under 50 Mb despite having almost 200 "devices" including virtual devides.

This morning my database was about 1,450 Mb.

Two things happened.

  1. I posted that everything was working perfectly.

  2. I had two breakers turned off for about 15 hours while I was installing a new bathroom exhaust fan. This cut the power to at least eight Z-Wave devices including two dedicated repeaters.

I expect that my Z-Wave network was screaming in agony.

Perhaps that had something to do with it?

I restored power and did a shut down, power off, restart maneuver and all is well.

Shouldn't have done that, you jinxed it!

@gopher.ny, here is yet another Zwave causing database growth. Maybe this will help to track this down?

1 Like

Correlates to a few posts up…

1 Like

In case anyone is wondering why it took 15 hours to upgrade a bathroom exhaust fan there was a natural gas line to the heater directly above the fan location and I didn't use attic access. :grimacing:

2 Likes