home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.16k stars 29.84k forks source link

Check Home Assistant Configuration fails on 2021.8.1 #54104

Closed ronjtaylor closed 3 years ago

ronjtaylor commented 3 years ago

The problem

image

What is version of Home Assistant Core has the issue?

2021.8.1

What was the last working version of Home Assistant Core?

2021.7.4

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

I don't know. The new version just fails when I do the Check before loading the new core

Link to integration documentation on our website

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

I raised the issue in this forum and others have the same problem so it's not unique to me
https://community.home-assistant.io/t/check-home-assistant-configuration-failed/327028

Additional information

No response

nstod commented 3 years ago

I have the same issue. It is present in both 2021.8.0 and 2021.8.1 for me. 2021.7.4 worked without any issues.

I have searched all of my configs and I'm not using < anywhere. Here is my full stack trace:

2021-08-05 16:47:40 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 77, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/core.py", line 29, in post
errors = await async_check_ha_config_file(request.app["hass"])
File "/usr/src/homeassistant/homeassistant/config.py", line 908, in async_check_ha_config_file
res = await check_config.async_check_ha_config_file(hass)
File "/usr/src/homeassistant/homeassistant/helpers/check_config.py", line 225, in async_check_ha_config_file
p_validated = platform_schema(p_validated)
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/validators.py", line 215, in _run
return self._exec(self._compiled, value, path)
File "/usr/local/lib/python3.9/site-packages/voluptuous/validators.py", line 339, in _exec
v = func(path, v)
File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 635, in validate_sequence
cval = validate(index_path, value)
File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
return schema(data)
File "/usr/local/lib/python3.9/site-packages/voluptuous/validators.py", line 741, in __call__
'value must be one of {}'.format(sorted(self.container)))
TypeError: '<' not supported between instances of 'SensorEntityDescription' and 'SensorEntityDescription'
ronjtaylor commented 3 years ago

This is the contents of check_config.txt, the output of Check Home Configuration on 2021.8.1

INFO:homeassistant.util.package:Attempting install of colorlog==5.0.1 Testing configuration at /tmp/config INFO:homeassistant.util.package:Attempting install of aiohttp_cors==0.7.0 INFO:homeassistant.util.package:Attempting install of pycryptodome>=3.6.6 INFO:homeassistant.util.package:Attempting install of zeroconf==0.33.2 INFO:homeassistant.util.package:Attempting install of aiofiles==0.6.0 INFO:homeassistant.util.package:Attempting install of mutagen==1.45.1 INFO:homeassistant.util.package:Attempting install of gTTS==2.2.3 INFO:homeassistant.util.package:Attempting install of sqlalchemy==1.4.17 INFO:homeassistant.util.package:Attempting install of ephem==3.7.7.0 INFO:homeassistant.util.package:Attempting install of paho-mqtt==1.5.1 INFO:homeassistant.util.package:Attempting install of rflink==0.0.58 INFO:homeassistant.util.package:Attempting install of python-forecastio==1.4.0 INFO:homeassistant.util.package:Attempting install of psutil==5.8.0 INFO:homeassistant.util.package:Attempting install of envoy_reader==0.19.0 Fatal error while loading config: '<' not supported between instances of 'SensorEntityDescription' and 'SensorEntityDescription' Failed config General Errors: 

Steve2017 commented 3 years ago

My issues were all around the Ecowitt integration. (Confirmed by rolling back, removing Ecowitt and installing update) They have just uploaded a new version of the core :- core-2021.8.2

That together with some fixes mentioned on the Ecowitt GitHub page: https://github.com/garbled1/homeassistant_ecowitt/issues/70 fixed it for me. So new version works with Ecowitt.

mib1185 commented 3 years ago

My issues were all around the Ecowitt integration. (Confirmed by rolling back, removing Ecowitt and installing update) They have just uploaded a new version of the core :- core-2021.8.2

That together with some fixes mentioned on the Ecowitt GitHub page: garbled1/homeassistant_ecowitt#70 fixed it for me. So new version works with Ecowitt.

this does not belong to the this issue here

mib1185 commented 3 years ago

@ronjtaylor @nstod may I ask you, to modify homeassistant/helpers/check_config.py file like follows as a quick&dirty debugging:

diff --git a/homeassistant/helpers/check_config.py b/homeassistant/helpers/check_config.py
index 26e063ae1f..6b97120ea4 100644
--- a/homeassistant/helpers/check_config.py
+++ b/homeassistant/helpers/check_config.py
@@ -226,7 +226,9 @@ async def async_check_ha_config_file(  # noqa: C901
                 except vol.Invalid as ex:
                     _comp_error(ex, f"{domain}.{p_name}", p_validated)
                     continue
-
+                except Exception as ex:
+                    _comp_error(ex, f"{domain}.{p_name}", p_validated)
+                    continue
             platforms.append(p_validated)

         # Remove config for current component and add validated config back in.

result should look like - starting from line 221

            # Validate platform specific schema
            platform_schema = getattr(platform, "PLATFORM_SCHEMA", None)
            if platform_schema is not None:
                try:
                    p_validated = platform_schema(p_validated)
                except vol.Invalid as ex:
                    _comp_error(ex, f"{domain}.{p_name}", p_validated)
                    continue
                except Exception as ex:
                    _comp_error(ex, f"{domain}.{p_name}", p_validated)
                    continue
            platforms.append(p_validated)
mib1185 commented 3 years ago

the issue it self is related to some changed PLATFORM_SCHEMA of some integration between versions 2021.7.4 and 2021.8.0, but diff between these two versions is quit a bit to large to grep for the change 🙄

mib1185 commented 3 years ago

do you have config for one (or multiple) of these integrations in your configuration.yaml?

accuweather
airly
ambee
binary_sensor
brother
climacell
co2signal
dsmr
dsmr_reader
dwd_weather_warnings
ebox
enphase_envoy
epsonworkforce
forecast_solar
fronius
gios
glances
melcloud
metoffice
nam
netatmo
nws
ondilo_ico
rainbird
rova
sensor
skybell
solaredge
tibber
tplink
uptimerobot
wemo
mib1185 commented 3 years ago

ok ... found the bug and created a fix

Steve2017 commented 3 years ago

My issues were all around the Ecowitt integration. (Confirmed by rolling back, removing Ecowitt and installing update) They have just uploaded a new version of the core :- core-2021.8.2 That together with some fixes mentioned on the Ecowitt GitHub page: garbled1/homeassistant_ecowitt#70 fixed it for me. So new version works with Ecowitt.

this does not belong to the this issue here

Interesting because I was getting the same error as the OP:

'<' not supported between instances of 'SensorEntityDescription' and 'SensorEntityDescription'

That error disappeared when Ecowitt was removed from the equation.

mib1185 commented 3 years ago

That error disappeared when Ecowitt was removed from the equation.

well, but Ecowitt is a custom component and those not supported by this repository here 😉

Steve2017 commented 3 years ago

That error disappeared when Ecowitt was removed from the equation.

well, but Ecowitt is a custom component and those not supported by this repository here 😉

Point taken

nstod commented 3 years ago

Thanks @mib1185 for the quick fix. I use the Enphase Envoy integration, so I appreciate you finding the issue.