How to interpret "Invalid config for [script]:" error in log?

Hi,
This is driving me mad! I’m sure its something simple, but I can’t understand the diagnostic log message.

Can anyone help me understand how to interpret the log message

Logger: homeassistant.config
Source: config.py:464
First occurred: 16:28:21 (1 occurrences)
Last logged: 16:28:21

Invalid config for [script]: not a valid value for dictionary value @ data['sequence'][1]['repeat']['sequence'][7]['entity_id']. Got None. (See /config/configuration.yaml, line 206).

If it helps, lines 205-207 in config.yaml are

automation manual: !include_dir_merge_list automations/  # manual automations
automation ui: !include automations.yaml                 # new automations from editor
script: !include scripts.yaml

The error tells you everything you need to now.

Things to know before reading that…

  1. lists start at 0 and go up. So the first item is 0, second is 1, and so on.
  2. everything in brackets is the key, or list number.

so, you have a script, and all scripts have a sequence. So, you should know where to start.

The second item ([1]) in your sequence (['sequence']) is a repeat (['repeat']), it has at least 8 items, and the 8th one ([7]) in the sequence (['sequence']) is getting none (Got None) for the entity_id (['entity_id']).

So, find a script, where your second item in the sequence is a repeat that has 8 items, the 8th items entity_id is bad or missing.

From experience, I’m guessing you have a template in the entity_id and the template is bad or not allowed.

2 Likes

Hi petro,
Thanks for this. I can understand the format now. Is this documented somewhere?

I’ll investigate tomorrow.

Geoff

1 Like

Not as far as I am aware.

It would make a good Community Guide topic. Like this this one I just prepared:

1 Like

It’s definitely not covered in the docs. It’s a voluptuous error pointing to the object structure and what’s wrong. It’s pretty self explanatory once you actually try to interpret the error. Problem is, people see data and stop reading the rest.

It is definitely not intuitive.

I spent the best part of a day refactoring my code because of the line number differences pointed at a clash between packaged scripts and standard scripts.

Having to review all scripts to find one which has a repeat as the second item is hardly straightforward.

I think that there are two issues here:-

  1. there needs to be some pointers such as the community guide proposed by tom_l.
  2. we need improved diagnostic messages which, at least, provide the faulty script or automation name/id .

I’m grateful for the pointers given here, but eventually I had to go back to '70s debugging by commenting out sections of code and reintroducing them one-by-one.

Thanks