Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some log warnings and errors are ambiguous for source #117025

Open
def1149 opened this issue May 7, 2024 · 2 comments
Open

Some log warnings and errors are ambiguous for source #117025

def1149 opened this issue May 7, 2024 · 2 comments

Comments

@def1149
Copy link

def1149 commented May 7, 2024

The problem

I have some warnings in my log that do not contain enough context information to locate the source of the error. This makes it impossible to determine who to report the warning to. See examples below. I've tediously checked all my scripts and templates and can't find any code that matches that in the log. I tried enabling debug for all integrations but the logger very quickly created hundreds of megabytes. Enabling debug one by one is tedious and time-wasting process for rarely occurring warnings or errors

The solution: All warnings and errors must provide sufficient context information to allow the user to locate the source of the problem quickly, efficiently, and accurately identify the source of the problem. A coding standard for handling error and warming logging and enforcement as part of QC needs to be created,

What version of Home Assistant Core has the issue?

2024.5.2

What was the last working version of Home Assistant Core?

??

What type of installation are you running?

Home Assistant OS

Integration causing the issue

??

Link to integration documentation on our website

No response

Diagnostics information

`
Logger: homeassistant.helpers.script
Source: helpers/script.py:824
First occurred: 10:47:23 AM (3 occurrences)
Last logged: 10:48:36 AM

Error in 'if[0]' evaluation: In 'template' condition: TypeError: '>' not supported between instances of 'int' and 'dict'

Logger: homeassistant.helpers.template
Source: helpers/template.py:2613
First occurred: 10:48:29 AM (8 occurrences)
Last logged: 10:48:47 AM

Template variable warning: 'update' is undefined when rendering '{{ iif(update, 'none', sound) }}'
Template variable warning: 'update' is undefined when rendering '{{ iif((update or sound == 'none'), 0, volume) }}
`

Example YAML snippet

N/A

Anything in the logs that might be useful for us?

above

Additional information

None

@joostlek
Copy link
Member

joostlek commented May 7, 2024

Both are template issues from the looks of it

@def1149
Copy link
Author

def1149 commented May 8, 2024

I finally found the source. These errors came from code created by a Blueprint!
Very tedious to find. I had to load the 'automation config', the code, from a trace of the BP automation and search for text.

As I said, ALL errors must provide sufficient origin context so the source can be easily and quickly identified. Cleary HA "knew" what automation was executing when the errors occurred but the error logger didn't capture and report that

I believe this is a bug in the error logger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants