After a week or so I start getting database errors

I seem to have my HE running well and rarely get errors. But after about a week, I start getting database and SQL errors. I cannot figure out what causes them and they seem to just occur out of the blue and the hub never recovers until I reboot.

I don't want to put in a hub reboot scheduler without trying to take care of the issue but not sure where to begin with what is causing it. Anybody have any ideas? This started at 3:07AM this morning and kept going until about 10:15AM when I realized devices were slow, the app was throwing errors when trying to navigate to a dashboard, then I rebooted.

Thanks!

Try a soft reset and restore.

2 Likes

https://docs.hubitat.com/index.php?title=Soft_Reset

2 Likes

You are rebooting through the hub and not cycling the power, right?

1 Like

That is correct. I am only rebooting through the hub and not turning off the power.

1 Like

Thanks for the link! I have not seen this interface yet.

I have gone ahead and soft reset the hub and restored from a backup from when I rebooted this morning. I will keep an eye on it for the next week and report what happens. Thanks everybody for the input!

1 Like

Pay attention to whatever app 82 is during the next week. That seems to be showing up with errors the most in your log.

1 Like

Oooo! Thank you for pointing that out! I forgot I can click on that to see what it is. That is a rule machine rule that runs and uses the iPhone WiFi Presence Sensor that I got from the community. I will dig into that to see what could be up. Then again, 99 is an early issue too and that is my Hue Bridge Integration....

Custom apps and drivers are the low hanging fruit. Eleminate those as a potential cause first. Errors with Hue are likely going to be a result of another problem, not the cause unless something is wrong with your hue bridge or the integration install is corrupt, or as previously suggested, an overall database corruption from something :man_shrugging:t3: Hue causing the problem is extremely unlikely. Many of us, myself included use the Hue Integration with no such errors.

Not that custom code is inherently bad.. But, it doesn’t go through the same QC as HE official code.. And Hubitat Inc. can’t troubleshoot all the custom code out there.

2 Likes

Ooo.. This one has a runevery1minute.. And Uses asynchttp with a default timeout of 3 minutes..

This can get backlogged quick especially with multiple phones

Agreed. Not a finger pointing exercise. One person’s combination of apps and devices can result in unforeseen issues that don’t exist in a different combination of devices and apps.

This stuff can get complicated when you don’t stay on a ridged path. And I’m not saying you have to. I sure don’t, and I accept the risks that go with that too.

1 Like

I think this statement is a bit sweeping and would disagree with that.
Most of my apps are also run in long term beta before release, it’s pretty rare I get bug reports after release. (Usually, just feature requests)
95% of them are in constant use by me (that’s why I wrote them!)

Andy

3 Likes

Hello all! If you're using the iPhone Wifi Presence driver, please see the update here:

1 Like

Followup: what is your rule machine rule that's using the presence sensor? Is it just triggering an action based on the state of the sensor? Or is it forcing its own refreshes?

1 Like

Good question and, even though my setup is only a month and a half old, I kinda forgot what this one was doing. It is indeed forcing it's own refreshes...every 10 seconds....WiFi presence is critical to my system and routines (long story about broken trust in regards to geofences I have had in the past) and I sort of set this and forgot about it because it didn't seem to "harm" anything.

However, if this in fact the culprit, I definitely know how I can put a trigger in to set off the more frequent refresh/check for WiFi based on another device and then end after a minute or two. No reason at all to have it every 10 seconds every minute of every day...

I will check out your new update and get that implemented as well. Either way, I think the rule/task I have setup is not an efficient use of any resources and can definitely be made better as well as fit my needs.

Thanks everybody!!

My update sets the timeout at 10 seconds, and it has an option (you can I comment in the code) to have it automatically fire every 15.

1 Like

I have reviewed and put your update in place in my system. Looks like it is doing the job well and I was able to remove any modifications I had to it to fit my needs and the rule that was refreshing every 10 seconds since your new code pings every 15.

Thanks again for all your help and the update! I will continue to monitor for a week or so but seems like this is exactly what I needed.

1 Like

I got this little beauty of an error today. app:45 is the "Maker API" application. Is there anyway I can identify what the error is talking about?

I parsed out all the devices that I have based on Maker API but it doesn't come to 627 lines so assume that is not how it is being referenced: