Logger: homeassistant
Source: helpers/template.py:735
First occurred: 11:10:52 AM (206670 occurrences)
Last logged: 2:34:37 PM
So my log file is now 400MB (and growing) and it’s mostly the same error. And so I have to address this ASAP because large log files can and will crash HA.
Is that really necessary? Can’t there be some way of summarizing or implementing a counter rather than having the log file bloat for the same error every few seconds?
Restarting your Home Assistant will clean your logs and will give you some free space again.
The issue seems to be in your templates. I suggest you look in the logs and try to fix the issue, otherwise there would be no log. If it really annoys you, you can set the log to critical only. This I do not recommend, as the errors are there for a reason.
I am well aware how to deal with it at this point, unfortunately.
But sorry, there is absolutely no need for 200 thousand log messages in 3.5 hours taking up 400 MB, and for me to have to have a statistics sensor on the log file to alert me to restart my HA (which I do).
AN error, as in a SINGULAR error message, with some indicator that it’s ongoing, sure. This is not needed. And obscene that it WILL eventually crash the system.
If it triggers over 200.000 times within 4 hours, there is something which you might want to fix. You can also change the specific logging level of your template. It might help if you share your log. I can take a look at it if you want!
I think that the wth starter is aware of the proposed solution(s) but the thing is that no one keeps an eye on their system 24/7. We sadly need to sleep too. In that 8 hour that the system is unattended the log grows with 800mb in this case. All the same errors that could have been summerized by a counter or automatically suppressed after say 50 messages and only show up every X message after that.
I do understand your point. I leave my Home Assistant be for weeks sometimes. However, my log almost never exceeds 100mB. And I do not say this to brag, just for reference!
The fact that your template helper triggers so many logs, almost (200.000 / (4 * 60 * 60) = ~14 errors per second(!), means there is something you need to change. It also overflows the system and probably makes your Home Assistant run slower than it should.
Now back on your WTH. What would you like to see changed? You can already change what you want to display in the logs using the logger integration. I can understand the need for a better logging system. Something like Error XXX triggered X times. But I personally look at the times the error triggers, so I know where to fix it.
Why is there always somebody who has to “defend the brand” every time I bring this topic up? It’s crazy. If it doesn’t affect you, why be an obstructionist? This issue happens to me every few months.
In this case, it was a very minor automation to set an input text I didn’t even need anymore. So I deleted the automation. And for that, yes, I get log bloat, system slowdown, and instability. There are way better ways to handle this.
I’d rather leave a solution to the devs. They know what’s possible and surely can come up with something far better than I. But if you want a suggestion, here’s one – raise a repair. I’d make a configurable period, say, 10 errors within an hour. If it’s more than that, raise a repair and stop adding it to the log. If it drops to less than that, the repair can be auto dismissed. If you manually dismiss it and it happens again, the repair comes back. This is more visible, easier on the logs, and lets you know immediately (by reappearing) if you think you’ve fixed it but didn’t.
We have voice, AI, and all the rest, but we get a simple dump of logs that can cause cascading issues if not addressed. Come on, man.
…and while I’m complaining, this community…wow. I could’ve posted the actual issue elsewhere, and have a very low chance of getting help. I post in WTH (which is SUPPOSED to be for ideas/suggestions) and I get an offer of help on the issue and disbelief that there’s any systemic issue to address. SMDH.
It is not about defending the brand, but 206670 errors in 3.5 hours means there’s something really, really, really bad going on that is in need of way more fixing than the log. This is hugely exceptional, and in my opinion trying to protect from the consequences of that is a lost cause.
Also, the logs in the UI do show summarised errors and the counter, so it is there already. But what is asked, adding a counter in the text file, is kind of impossible. It would require not to append to the logs, but insert or update a counter at some point in the text file. That is hugely difficult and time consuming, not to mention that it would be impossible to log the timestamp. Tht is important information I would not want to lose.
No need to get personal. It’s like every post you make, you are pissed of about people reacting.
The solution is there, if you don’t want to use it, that’s on you. The fact that you do not like the solution has nothing to do with WTH.
All my intentions are there to help you. Your proposition of a solution is just not possible. Like I said, 15 errors per second is really, really bad like @Edwin_D writes.
I AM pissed off, because you react as if there isn’t a problem or any need for improvement, or that the solution is there (choosing between no log of the issue at all or 200k logs of the issue is NOT a solution), or the thinly veiled implication that it’s me doing something wrong. None of that is helpful in the least.
Then, you ask for a solution and I give one, and you ignore it. My suggestion still gives you 10 instances in the logs minimum before suppressing, which should more than enough to track it down.
This is not exceptional, it happens to me with regularity. That’s due to the nature of HA, which checks something repeatedly over time. Have a sensor that checks every minute, and something about that check goes wrong, right there is 60 logs an hour. It’s also not necessarily very bad. If it’s your security system or heating, that’d be bad. If it was like this case it was purely informational, I could have a repair and get to it when I get to it. Except the way it works now I can’t…if that issue goes on for very long, EVERYTHING goes down. That’s not acceptable to me, even if it is to you.
That is not true. Unless you specifically ask for it then Home assistant reacts on very specific changes. You specify when to trigger. So if you choose wisely, triggers fire only when needed. Even template triggers without clear entities to listen to trigger only once per second.
Maybe show the automations that you regularly have these problems with, so we can help you figure out why they fire tens of times a second, because that should not happen.
Things to avoid:
Trigger every xx time: While sometimes needed, usually there are better ways.
trigger on any change of an entity - Especially on numerical values. Specify what change you are interested in.
As far as I can tell, creating a WTH on rate limiting automations might be a better solution to your problem. I know of Home Automation systems that have it. If automations fire way too many times within a short period, they start ignoring triggers.
To give you an idea: I have 400 automations. When ordered on last executed, the 15th in the list fired half an hour ago, the top one now 4 minutes ago. So it is entirely possible to have automations fire only when needed.
Wrong. It’s not true for automations, but for many integrations that’s the way they work. Every one that is of a type of polling does that. Take for example last month in 2024.11, where I got thousands of errors because they hadn’t implemented cameras in the TP Link integration. Nothing to do with automations. Also, entirely not necessary.
If YOU want rate limiting of automations, put in your own WTH. I want improved error logging. Thanks.
But that’s just the thing. You don’t bring in new ideas. I asked you what you would like to see. But there was no reply. Also I pointed out that there is already a solution, which you don’t like.
In all honesty, please celebrate, what do you want to see in the logs? Give an example. Give me insights. Because saying it’s shit, not liking the solution and complaining that we are just bringing you down does not bring us closer to your frustration about the logs!
Like I said, all I am here for is help. No need to get personal.
LOL. This forum is for WTH ideas, for which you haven’t provided any. If you want to report me, do it already. I know you were too busy “helping” to read my suggestion.