ha-triones icon indicating copy to clipboard operation
ha-triones copied to clipboard

Error Config flow could not be loaded

Open marcschachtsiek opened this issue 3 years ago • 12 comments

I have tried installing this integration by using HACS and manually, but both times I get this error. I am fairly new to Home Assistant and this is the first integration that I am trying to install. I'm using the docker installation on an RPi 4.

image

marcschachtsiek avatar Feb 01 '22 14:02 marcschachtsiek

This is the full error log output.

This error originated from a custom integration.

Logger: aiohttp.server
Source: custom_components/triones/triones.py:13
Integration: Triones (documentation, issues)
First occurred: 16:18:53 (2 occurrences)
Last logged: 16:22:04

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, 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 98, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, 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 181, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 130, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 203, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 230, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/triones/config_flow.py", line 37, in async_step_user
    devices = await discover()
  File "/config/custom_components/triones/triones.py", line 13, in discover
    devices = await BleakScanner.discover()
  File "/usr/local/lib/python3.9/site-packages/bleak/backends/scanner.py", line 99, in discover
    async with cls(**kwargs) as scanner:
  File "/usr/local/lib/python3.9/site-packages/bleak/backends/scanner.py", line 79, in __aenter__
    await self.start()
  File "/usr/local/lib/python3.9/site-packages/bleak/backends/bluezdbus/scanner.py", line 78, in start
    self._bus = await MessageBus(bus_type=BusType.SYSTEM).connect()
  File "/usr/local/lib/python3.9/site-packages/dbus_next/aio/message_bus.py", line 122, in __init__
    super().__init__(bus_address, bus_type, ProxyObject)
  File "/usr/local/lib/python3.9/site-packages/dbus_next/message_bus.py", line 85, in __init__
    self._setup_socket()
  File "/usr/local/lib/python3.9/site-packages/dbus_next/message_bus.py", line 575, in _setup_socket
    raise err
  File "/usr/local/lib/python3.9/site-packages/dbus_next/message_bus.py", line 548, in _setup_socket
    self._sock.connect(filename)
FileNotFoundError: [Errno 2] No such file or directory

marcschachtsiek avatar Feb 01 '22 16:02 marcschachtsiek

This is probably caused by your Home Assistant not having access to BLE hardware. Try using gatttool from your HA container and make sure it is working first.

sysofwan avatar Feb 11 '22 17:02 sysofwan

I'm getting the same error in the logs with a different message: Error Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble I'm running HA on a container on raspberry pi 4 with raspbian 64bits

agonzale34 avatar Mar 10 '22 06:03 agonzale34

I did run the gatttool commands successfully inside the container

agonzale34 avatar Mar 10 '22 06:03 agonzale34

I'm having the same issue as @agonzale34 , running HA in Docker. I can confirm that HA recognizes the BLE hardware because the bluetooth device tracker is working fine.

Aaron19953 avatar Mar 31 '22 13:03 Aaron19953

Please share your log output, the issue may not be the same. I am using the bleak library, so you can test if that works in containers or not too.

sysofwan avatar Apr 16 '22 00:04 sysofwan

I have a similar issue. This is the error message: Screenshot 2022-05-18 at 20 39 23 In the HA terminal, I can see the device and I can connect to it, but the integration is not installing... Also I have these in the log:

File "/config/custom_components/triones/config_flow.py", line 37, in async_step_user
    devices = await discover()
  File "/config/custom_components/triones/triones.py", line 13, in discover
    devices = await BleakScanner.discover()

Could you help me please?

ghtomi avatar May 18 '22 18:05 ghtomi

Any news on this?

lyfesaver74 avatar Jul 06 '22 02:07 lyfesaver74

For me the issue is that bleak is not working inside HomeAssistant docker container. Tested using a standalone python script. Does anyone know how to fix bleak? I am running the latest 2022.7.4 version of HA

simplelnx avatar Jul 15 '22 18:07 simplelnx

Having the same issue here (i'm using HomeAssistant docker container, Ubuntu Server 22.04), has anyone figure it out?

jonrodrigues42 avatar Jul 30 '22 21:07 jonrodrigues42

I've got this issue. When using terminal and list bluetooth devices, the triones device is found. However the integration fails to load. I've removed and reinstalled and still nothing. It was working fine but not sure on what HA release it failed. I'm on the latest version of HA - 2023.9.1

image

dharvey242 avatar Sep 11 '23 06:09 dharvey242

I'm also getting 500 when starting the config flow. This is the error from the logs:

Logger: aiohttp.server Source: custom_components/triones/triones.py:15 Integration: Triones (documentation, issues) First occurred: 11:39:39 (4 occurrences) Last logged: 11:41:27 Error handling request

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 147, in post
    return await super().post(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post
    result = await self._flow_mgr.async_init(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 846, in async_init
    flow, result = await task
                   ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 874, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 394, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/triones/config_flow.py", line 37, in async_step_user
    devices = await discover()
              ^^^^^^^^^^^^^^^^
  File "/config/custom_components/triones/triones.py", line 15, in discover
    return [device for device in devices if device.name.lower().startswith("triones") or device.name.lower().startswith("ledble")]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/triones/triones.py", line 15, in <listcomp>
    return [device for device in devices if device.name.lower().startswith("triones") or device.name.lower().startswith("ledble")]
                                            ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'lower'

ov1d1u avatar Sep 26 '23 08:09 ov1d1u