Unexpected error calling config validator: expected string or bytes-like object

After trying to upgrade from 2021.11.05, I get the error message “Unexpected error calling config validator: expected string or bytes-like object” when checking my installation. It works as a charm with 2021.11.05, but when trying to upgrade to 2021.12.x (tried up to 9) I get the error. Where do I start troubleshooting?

Tried latest release:
Logger: homeassistant.config
Source: helpers/config_validation.py:730
First occurred: 21:01:46 (1 occurrences)
Last logged: 21:01:46

Unknown error calling automation config validator
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config.py”, line 819, in async_process_component_config
return await config_validator.async_validate_config( # type: ignore
File “/usr/src/homeassistant/homeassistant/components/automation/config.py”, line 126, in async_validate_config
await asyncio.gather(
File “/usr/src/homeassistant/homeassistant/components/automation/config.py”, line 103, in _try_async_validate_config_item
config = await async_validate_config_item(hass, config, full_config)
File “/usr/src/homeassistant/homeassistant/components/automation/config.py”, line 74, in async_validate_config_item
config[CONF_TRIGGER] = await async_validate_trigger_config(
File “/usr/src/homeassistant/homeassistant/helpers/trigger.py”, line 51, in async_validate_trigger_config
conf = await platform.async_validate_trigger_config(hass, conf)
File “/usr/src/homeassistant/homeassistant/components/homeassistant/trigger.py”, line 15, in async_validate_trigger_config
return await getattr(platform, “async_validate_trigger_config”)(hass, config)
File “/usr/src/homeassistant/homeassistant/components/homeassistant/triggers/state.py”, line 77, in async_validate_trigger_config
config = TRIGGER_STATE_SCHEMA(config)
File “/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py”, line 272, in call
return self._compiled([], data)
File “/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py”, line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File “/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py”, line 386, in validate_mapping
cval = cvalue(key_path, value)
File “/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py”, line 817, in validate_callable
return schema(data)
File “/usr/src/homeassistant/homeassistant/helpers/config_validation.py”, line 306, in entity_ids_or_uuids
return _entity_ids(value, True)
File “/usr/src/homeassistant/homeassistant/helpers/config_validation.py”, line 296, in _entity_ids
return [validator(ent_id) for ent_id in value]
File “/usr/src/homeassistant/homeassistant/helpers/config_validation.py”, line 296, in
return [validator(ent_id) for ent_id in value]
File “/usr/src/homeassistant/homeassistant/helpers/config_validation.py”, line 284, in entity_id_or_uuid
return fake_uuid4_hex(value)
File “/usr/src/homeassistant/homeassistant/helpers/config_validation.py”, line 730, in fake_uuid4_hex
if not _FAKE_UUID_4_HEX.match(value):
TypeError: expected string or bytes-like object

Short answer: I don’t think it should be generating a stack trace, so I hope you’ll consider reporting it as an issue on the github for home assistant core. They’ll want a sanitized copy of your yaml files.

Longer answer: you could try running the check from the command line… I’ve heard that it’s better in some ways, although I don’t personally know if that’s true. Simply issue the CLI command “ha core check”

Easiest way to get to the CLI is using one of the ssh&terminal add-on’s, or the visual studio add-on.

hello

If it helps you, the same thing happened to me and it was caused by a badly written script

what I did (first copy it to a safe place) was to delete all the scripts from the config folder and then put one by one and verifying

I have each separate script

I hope it helps you

figured it out. it was a depreciated automation. Copied all automations to a new file and transfered patches while checking config in between re pasting until I discovered the error