Failed to restart Home AssistantCore - '<' not supported between instances of 'str' and 'NoneType'

Since core-2021.8.xxx I’ve been getting “Failed to restart Home AssistantCore - ‘<’ not supported between instances of ‘str’ and ‘NoneType’” when I try to restart Core via Server Controls or via Supervisor.

The only way I can restart is to restart supervisor or the host.

2021-08-08 15:36:04 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139856936624864] '<' not supported between instances of 'str' and 'NoneType'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/components/hassio/__init__.py", line 522, in async_handle_core_service
    errors = await conf_util.async_check_ha_config_file(hass)
  File "/usr/src/homeassistant/homeassistant/config.py", line 923, 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/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 'str' and 'NoneType'

I can restart Core via CLI - ha core restart

1 Like

More info - the same error occurs when I try to run Check Configuration from Server Controls.

This error appears in the logs

Logger: aiohttp.server
Source: helpers/check_config.py:225
First occurred: 4:02:39 PM (1 occurrences)
Last logged: 4:02:39 PM

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 923, 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/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 'str' and 'NoneType'

I appear to have fixed my problem.

It was due to a bad config line in my Integration Sensor…

  - platform: integration
    source: sensor.iotawatt_output_usage
    name: Total_Power_usage
    unit_prefix: <<<<w>>>>
    round: 2

I mistakenly thought the unit prefix was the Unit so I set this as W for watts when i should have set it to k for thousands.

4 Likes

I also had the same problem:

In the configuration file I had set:

 - platform: integration
    source: sensor.lavatrice_watt
    name: Lavatrice Energy Spent
    unit_prefix: kWh
    method: trapezoidal
    round: 2

I change unit_prefix: kWh in unit_prefix: k and its works!

1 Like

I have the same problem which started appearing after upgrading to the latest version. Mine is from NODE RED though. It only applies to changing the volume of a media player e.g.:

image

I’ve not managed to find a way around it… always worked fine before I upgraded

Same error is happening to me for IKEA Fyrtur shades. Do you mind me asking what your way around for Node-Red was?