How to debug valid configuration

Hi,

I got some strange fail, checking my configuration at it reports as valid, but immediately notification sent that automation and script cannot be loaded:

looking into the log and all i got:

2021-08-27 12:46:49 ERROR (MainThread) [homeassistant.config] Invalid config for [script]: expected a dictionary. Got OrderedDict([('http', OrderedDict([('server_port', 443), ('ssl_certificate', '/ssl/fullchain.pem'), ('ssl_key', '/ssl/privkey.pem'), ('ip_ban_enabled', True), ('login_attempts_threshold', 97)])), ('automation', [OrderedDict([('id', '1615241468813'), ('alias', 'Open bedroom blinds in the morning'), ('description', 'Slow open bedroom blinds till half in the morning'), ('trigger', [OrderedDict([('platform', 'time'), ('at', '10:15')])]), ('condition', [OrderedDict([('condition', 'time'), ('weekda.... (See /config/configuration.yaml, line 6).
2021-08-27 12:46:50 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: required key not provided @ data['action']. Got None. (See ?, line ?).

my configuration.yaml is:

homeassistant: !include config/core/homeassistant.yaml
http: !include config/core/http.yaml
automation: !include automations.yaml
# automation yaml: !include_dir_merge_list config/automation
alert: !include_dir_named config/alerts
group: !include config/group/groups.yaml
script: !include scripts.yaml
script yaml: !include_dir_merge_named config/script/
....
...

How to debug such thing?
Started to go one by one, but i have hungreds of automations and tons of scripts… :\

If you have 100 of automations, you can try commenting out 10 automation, check configuration, and proceed to the next 10 automations.

Yes, probably that what i did, and then I went one by one and found missing action in one of the automations…

but still, how it can be debugged when no proper pointer provided?

For the script you can do a search. The faulty script has this in it: Open bedroom blinds in the morning

The faulty automation is harder. If I cant remember what I was working on last I comment out half my automations and check again. Now I know which half it is in. Half again, and again and by then I’m pretty close.

The logs says it’s the script listed above.

And the automation is one that is missing the action part.
Most likely you have deleted the action from the automation.

I’m fairly sure you can copy the contents of the automation.yaml and paste it in configuration.yaml and comment out the include line.
That way the config check should report what line number it finds the error.

1 Like

nope, there was no problem with scripts at all.
it was just missing action in one of the automations…

that’s what i’m saying, that it was very confusing, that error in one place point on another …

Yeah there was:

ERROR (MainThread) [homeassistant.config] Invalid config for [script]: expected a dictionary.