zachcheatham / ha-omada

Home Assistant TP-Link Omada Integration
189 stars 26 forks source link

Home Assistant - Failed to Setup #33

Open gregg098 opened 2 years ago

gregg098 commented 2 years ago

Running Home Assistant 2022.6.7. Running 0.3.0 of this integration.

Lately, after a restart of Home Assistant, I get a "Failed to Setup" on the integration page for Omada. The associated log is below.

I have wiped out the integration, restarted, re-added, and all was well for a day, then after a restart it happened again.


This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/omada/controller.py:147
Integration: TP-Link Omada (documentation)
First occurred: 8:34:18 AM (1 occurrences)
Last logged: 8:34:18 AM

Error setting up entry Home: Home for omada
Traceback (most recent call last):
  File "/config/custom_components/omada/controller.py", line 147, in get_api_controller
    await controller.login()
  File "/config/custom_components/omada/api/controller.py", line 48, in login
    await self._update_api_info()
  File "/config/custom_components/omada/api/controller.py", line 65, in _update_api_info
    response = await self._request("get", f"{self.url}/api/info")
  File "/config/custom_components/omada/api/controller.py", line 180, in _request
    async with self._session.request(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1154, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/omada/__init__.py", line 32, in async_setup_entry
    await omada_controller.async_setup()
  File "/config/custom_components/omada/controller.py", line 74, in async_setup
    self.api = await get_api_controller(
  File "/config/custom_components/omada/controller.py", line 147, in get_api_controller
    await controller.login()
  File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 116, in __exit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
ssummer commented 2 years ago

This looks like the same as this issue:

https://u27387819.ct.sendgrid.net/ls/click?upn=9DY-2FlXAyqD3Vcm9Yk1IvzhB1KoZYXtv7AglNddOenWgLEMBZFW9J84-2F-2BDyt8ynJZ7WaQuCc2ilGm7SSUiJpKhw-3D-3DEzan_U31jt5HgHBh7k3Grc5s4l-2FypankEAa7KgZtaKWZQTG0ECsYMlrSzM5FxShwK-2FhQl3XHmdtOi7w6-2B01zmCqLui2lM024VdQchOKg3UAW0h682XOIF3UoIHnhoxx20hdZA8adK5GxxfpRbaZsqrvBdNKcfs3mEsn03H-2FupAD3bVEI8uuDxpt7Qvmqv9wJY-2B0bNVMCdnal1eXrvHWCSryoBv-2BUnVlRYOwY7GMIRIYcLqd0-2BJ4AwrkngfBfjF9cUfuYZnx5BuJ1xzJzdEofpentBZw-3D-3D

I’ve always had this issue - as a workaround I have setup an automation that does a re-load of Omaha, after 5 minutes, each time HA starts - that works, but would be nice not to have to do this.

Regards,

Stephen

On 23 Jun 2022, at 16:43, gregg098 @.***> wrote:

Running Home Assistant 2022.6.7. Running 0.3.0 of this integration.

Lately, after a restart of Home Assistant, I get a "Failed to Setup" on the integration page for Omada. The associated log is below.

I have wiped out the integration, restarted, re-added, and all was well for a day, then after a restart it happened again.

This error originated from a custom integration.

Logger: homeassistant.config_entries Source: custom_components/omada/controller.py:147 Integration: TP-Link Omada (documentation) First occurred: 8:34:18 AM (1 occurrences) Last logged: 8:34:18 AM

Error setting up entry Home: Home for omada Traceback (most recent call last): File "/config/custom_components/omada/controller.py", line 147, in get_api_controller await controller.login() File "/config/custom_components/omada/api/controller.py", line 48, in login await self._update_api_info() File "/config/custom_components/omada/api/controller.py", line 65, in _update_api_info response = await self._request("get", f"{self.url}/api/info") File "/config/custom_components/omada/api/controller.py", line 180, in _request async with self._session.request( File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in aenter self._resp = await self._coro File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1154, in _create_direct_connection hosts = await asyncio.shield(host_resolved) asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/omada/init.py", line 32, in async_setup_entry await omada_controller.async_setup() File "/config/custom_components/omada/controller.py", line 74, in async_setup self.api = await get_api_controller( File "/config/custom_components/omada/controller.py", line 147, in get_api_controller await controller.login() File "/usr/local/lib/python3.9/site-packages/async_timeout/init.py", line 116, in exit self._do_exit(exc_type) File "/usr/local/lib/python3.9/site-packages/async_timeout/init.py", line 212, in _do_exit raise asyncio.TimeoutError asyncio.exceptions.TimeoutError — Reply to this email directly, view it on GitHub https://u27387819.ct.sendgrid.net/ls/click?upn=9DY-2FlXAyqD3Vcm9Yk1IvzhB1KoZYXtv7AglNddOenWgLEMBZFW9J84-2F-2BDyt8ynJZo83ga1kLvXirY6Cipwxrsw-3D-3D-0jY_U31jt5HgHBh7k3Grc5s4l-2FypankEAa7KgZtaKWZQTG0ECsYMlrSzM5FxShwK-2FhQl3XHmdtOi7w6-2B01zmCqLui2lM024VdQchOKg3UAW0h682XOIF3UoIHnhoxx20hdZAnTQCrHtrs8WlHvpgAgRjGBzE-2B2878vfudCAWaFp8aH8z9X7DHHnQG4KPgu4ciLd6GlHHSjAGLCYYkQPIAx-2BPe-2BAVIiscnVVuG9878tMMNzVqmkukZTJrnVhIgBwBXePFe-2FKapcBhBGe7DvAwJS7Ohg-3D-3D, or unsubscribe https://u27387819.ct.sendgrid.net/ls/click?upn=9DY-2FlXAyqD3Vcm9Yk1IvzmlNMnQu-2BTdhjVQbiC5L6MK837A45RaTC6ukJnh-2FxbX9gAPGEc7-2Bxj7jCPc9iNP78BA3TWVu7l4dtXqKHzvecJL7qIl0lS7BZT7kBJEQRiAN9UfRHrNllS9aE35X5XqrVw-3D-3DGr4l_U31jt5HgHBh7k3Grc5s4l-2FypankEAa7KgZtaKWZQTG0ECsYMlrSzM5FxShwK-2FhQl3XHmdtOi7w6-2B01zmCqLui2lM024VdQchOKg3UAW0h682XOIF3UoIHnhoxx20hdZA7D7IFMQGfFB8D5oTT7MZl2ebZWQE5kfa2LpyWs6r39H5-2BAUHcWtWnhzDXonu3s6v5bSs8fpZu-2F5fLRtQ3BiDveqPYnyr4cUXkSk-2B3x3Y6zdW0IP-2BTHw6jk5GFT7ZFsXzxWYtWEi6l9Se42o0CvCSHA-3D-3D. You are receiving this because you are subscribed to this thread.

KruseLuds commented 2 years ago

I opened another issue with the below error message but is it possible Ihave the same problem?

This error originated from a custom integration.

Logger: homeassistant.config_entries Source: custom_components/omada/controller.py:147 Integration: TP-Link Omada (documentation) First occurred: 6:53:21 AM (1 occurrences) Last logged: 6:53:21 AM

Error setting up entry Master_Controller: Ridgewood Estate for omada Traceback (most recent call last): File "/config/custom_components/omada/controller.py", line 147, in get_api_controller await controller.login() File "/config/custom_components/omada/api/controller.py", line 48, in login await self._update_api_info() File "/config/custom_components/omada/api/controller.py", line 65, in _update_api_info response = await self._request("get", f"{self.url}/api/info") File "/config/custom_components/omada/api/controller.py", line 180, in _request async with self._session.request( File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in aenter self._resp = await self._coro File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1090, in create_connection transport, protocol = await self._create_connection_transport( File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1120, in _create_connection_transport await waiter asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/omada/init.py", line 32, in async_setup_entry await omada_controller.async_setup() File "/config/custom_components/omada/controller.py", line 74, in async_setup self.api = await get_api_controller( File "/config/custom_components/omada/controller.py", line 147, in get_api_controller await controller.login() File "/usr/local/lib/python3.9/site-packages/async_timeout/init.py", line 116, in exit self._do_exit(exc_type) File "/usr/local/lib/python3.9/site-packages/async_timeout/init.py", line 212, in _do_exit raise asyncio.TimeoutError asyncio.exceptions.TimeoutError

zachcheatham commented 1 year ago

e06a99f addresses this issue. Home Assistant will now automatically reattempt integration setup when it runs into a timeout after a restart.