Log: missing information regarding incorrect yaml

Hi everybody,

I use .yaml files for all my automations, switches, etc.; usually when I’d start Home Assistant, and something was incorrect, log would show the file causing the error. Now I am getting output like this

2019-11-18 15:38:25 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: not a valid value for dictionary value @ data['action'][0]['entity_id']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/integrations/automation/

Usually the difference would be (See automations/test/upstairs_bathroom.yaml, line 32).. Now it will just display a question mark. This makes it very hard debugging incorrect yaml files.

Is this configurable, or did things just change with the latest update (am running Home Assistant 0.101.3)?

Thanks for your input :slight_smile:

It is always good practice to do a configuration check before restarting HA if you changed something. If you rely on the logs after a restart, it is already late. Do you know what you changed last ? Try commenting that.

1 Like

+1 for the suggestion of @francisp
I don’t know why it shows ? in your case, but if you have for example all the automations in one automation.yaml file, the error from the log will show the line of the include of automation.yaml in the configuration.yaml, so logs are not always really helpful.

In this particular case, I was pretty sure what it was (and already commented it out by now). But this is a general issue.

Btw. I write my yaml files on my computer, then run a script scping them to the home server and restarting Home Assistant; so usually when I do this, Home Assistant restarts as soon as the files have been copied.

I have not ran into any issues with doing it this was (yet), because usually it’d tell me what file to fix… I have come across this countless times before… usually I’d fix the file, run my script (copy files, restart hass), and I’m good to go.

@Burningstone I have multiple files for my automations; I usually use packages per room and/or “thing I want to do” (for example, I have packages/haus/weihnachten.yaml) for anything Christmas related… automations, scenes, etc. are all in that file. So usually Home Assistant would point me to that very file I had messed up in.

I know what you mean, I’m doing it the same way actually. Just wanted to point out this case.