Help in parsing Configuration Validation/error log entries, please

Hello, could someone point me in the direction of any documentation on how to parse the #$)(*& error logs? Sometimes (too often) they’re pretty bloody useless! Such as the following:

Logger: homeassistant.config
Source: config.py:437
First occurred: 10:32:01 PM (1 occurrences)
Last logged: 10:32:01 PM

Invalid config for [automation]: Expected a dictionary @ data['action'][0]['choose'][0]['conditions'][0]. Got None. (See /config/configuration.yaml, line 10).

This error seems to indicate an invalid config for a data: tag in one of my automations, but indicates line 10 in the /config/configuration.yaml file, which is completely inaccurate as that points to my groups include statement (which has worked perfectly fine for weeks, until today when I make more than one change in the automation, and now can’t figure out which it might be). The errors consistently point to the line that contains group: !include groups.yaml even when I re-arrange the entries to move that line somewhere else:The first few lines of my configuration.yaml file looks like this, and the groups.yaml file is perfectly fine and hasn’t been touched in ages, so I know for a fact that that file is not the problem.
image

The error comes and goes, as I’m debugging and creating automations. The automation that I have been working on (which does actually have the choose: section) begins somewhere around line 650 in the configuration.yaml file. Sometimes the errors are logical and point me to a realistic line and issue in the file. But much of the time they seem to be somewhat random and irritating. I’m guessing that positive numbers in the brackets ([2] for example) mean the 1st, 2nd, 3rd, etc., iteration of that particular part ([çhoose'][0][çonditions'][3] for instance, would mean the 3rd conditions entry, but what does [0] mean? Without any documentation on how to parse these cryptic messages, they’re useless and programming these automations is an extremely frustrating effort. Any direction or help would be greatly appreciated. Thnx in advance.

It actually points to the next line (automation.yaml) if the numbering starts at 0 instead of 1. Your text editor numbering starts counting lines at 1, not 0 though, hence the difference.

Still that’s not much use as it does not narrow down which line in automations.yaml.

However from the rest of the error we can see that it is a problem with the first action (starts counting at 0) of an automation and that action is a choose service and the issue is with the first condition of that choose service. It could not find a condition where it expected one.

So look through your automations with choose as the first action and check the first conditions of that choose action.

1 Like

Thank you for the reply, @tom_l. That does indeed help. And I did discover that I was missing a single quote at the end of a message segment (thought that would have been picked up by the syntax parsing engine, but I guess not). However, as you pointed out, with the numbering starting at 0, that indicates the include for my automations.yaml file, which is indicated on line 10. And that file is actually empty.

So since that file is empty, I would still presume the issue is with the automation: section in the configuration.yaml file. Which still results in an error message that is misleading, and at best frustrating. At least for noobs. It would be very helpful to have a documentation entry that describes how to parse error messages. That would make it SO much easier, especially for people who are learning how to navigate Home Assistant messages and configuration.

Thanks again for the response. Much appreciated… Without the community, I’m afraid we’d all be lost! :slight_smile:

Just for reference, I thought I would post my code to show how confusing the error message is, compared to the actual location of the issue…

image

So the automation checks a timer, that is using proximity to determine if a family member is headed home. If they are, and are within 5 miles of home, it sets a variable that is used to trigger the HVAC to adjust the climate to “at home” settings. But…if the timer expires (meaning that they maybe stopped somewhere on the way home, or drove past…then it will drop back into “away mode” and adjust the climate settings appropriately. The notify message (lines 683-685) is for illustrative purposes, and replaced my actual code.
Hint, the issue is on line 680 in the example… My confusion was that the error indicated “data”, and I was associating that with the data: tag for the notify service. But I think that was a misdirection on my part.