schmittx / home-assistant-eero

Eero integration for Home Assistant
MIT License
133 stars 23 forks source link

"Failed to set up" after upgrading from 1.5.0 to 1.6.1 #98

Open chasetb opened 1 month ago

chasetb commented 1 month ago

System Specs

HA Core: 2024.10.1 HA Supervisor: 2024.10.0 HA Operating System: 13.1 Ha Frontend: 20241002.2

Context

I upgraded from v1.5.0 to v1.6.1 today. My network and devices are still shown in the Integration but no data is available. I see the following: image

Logs on Integration Startup

This error originated from a custom integration.

Logger: custom_components.eero
Source: helpers/update_coordinator.py:354
integration: eero (documentation, issues)
First occurred: 4:03:09 PM (1 occurrences)
Last logged: 4:03:09 PM

Unexpected error fetching Eero (Chase Home Assistant) data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/__init__.py", line 195, in async_update_data
    return await hass.async_add_executor_job(api.update, conf_networks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/api/__init__.py", line 227, in update
    network_data = self.call(method=METHOD_GET, url=network_url)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/api/__init__.py", line 89, in call
    response = self.refresh(lambda:
               ^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/api/__init__.py", line 180, in refresh
    text = json.loads(response.text)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 4:03:09 PM (1 occurrences)
Last logged: 4:03:09 PM

Error setting up entry Chase Home Assistant for eero
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/__init__.py", line 320, in async_setup_entry
    if any([eero.is_eero_beacon for network in coordinator.data.networks for eero in network.eeros]):
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'networks'

Additional Logs

I also tried "Add Hub" option and after entering my email address, I get the following errors:

This error originated from a custom integration.

Logger: custom_components.eero.api
Source: custom_components/eero/api/__init__.py:168
integration: eero (documentation, issues)
First occurred: 4:18:24 PM (1 occurrences)
Last logged: 4:18:24 PM

Parsing response was unsuccessful with status code: 401
Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:448
First occurred: 4:18:24 PM (1 occurrences)
Last logged: 4:18:24 PM

Error handling request
Traceback (most recent call last):
  File "/config/custom_components/eero/config_flow.py", line 70, in async_step_user
    self.response = await self.hass.async_add_executor_job(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/api/__init__.py", line 139, in login
    response = self.call(
               ^^^^^^^^^^
  File "/config/custom_components/eero/api/__init__.py", line 100, in call
    response = self.parse_response(response=response)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/api/__init__.py", line 170, in parse_response
    raise EeroException(
custom_components.eero.api.EeroException

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 559, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/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 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 370, in async_configure
    result = await self._async_configure(flow_id, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 417, in _async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 520, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/config_flow.py", line 74, in async_step_user
    _LOGGER.error(f"Status: {exception.status_code}, Error Message: {exception.error_message}")
                             ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'EeroException' object has no attribute 'status_code'
chasetb commented 1 month ago

Just to show my Office Eero device is still in Home Assistant but no data is available. Screenshot 2024-10-10 at 4 28 09 PM

chasetb commented 1 month ago

Downgrading to v1.5.0 allows integration to function as expected image

PacoCT commented 1 month ago

I'm having the same issue in v 1.6.2

aheath70 commented 4 weeks ago

Same issue with v1.6.2

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 8:48:14 AM (1 occurrences)
Last logged: 8:48:14 AM

Error setting up entry Eero HOME for eero
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/__init__.py", line 320, in async_setup_entry
    if any([eero.is_eero_beacon for network in coordinator.data.networks for eero in network.eeros]):
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'networks'

Redownloaded versions 1.6.1, 1.6.0 and 1.5.0 and got the same error.

Whilst on 1.5.0, I did a "configure" on the device, went through the configuration flow and it loaded correctly after that.

I then did a whole heap of upgrading/downgrading/reloconfiguring/reloading. After an upgrade to 1.6.2, running the config flow and 2 reloads, it appears to have loaded successfully. Susequent reloads work fine, but when HA is restarted, the error returns. After multiple reloads it eventually works successfully, until the next time that HA is restarted.

padadof2 commented 1 week ago

is this dead?

chasetb commented 1 week ago

is this dead?

v1.6.2 is working for me now.

aheath70 commented 1 week ago

I still have the issue, with multiple reloads fixing it eventually, until the next time that HA is restarted. Then need to do multiple reloads and it eventually works. It stays up and working for about 5-10 minutes, and then fails again.

2024-11-22 10:41:47.437 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Eero HOME for eero
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 635, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/__init__.py", line 320, in async_setup_entry
    if any([eero.is_eero_beacon for network in coordinator.data.networks for eero in network.eeros]):
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'networks'
2024-11-22 10:42:07.165 ERROR (MainThread) [custom_components.eero] Timeout fetching Eero (Andrew Heath (Gmail)) data
2024-11-22 10:42:07.165 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Eero HOME for eero
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 635, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/__init__.py", line 320, in async_setup_entry
    if any([eero.is_eero_beacon for network in coordinator.data.networks for eero in network.eeros]):
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'networks'
2024-11-22 10:45:07.363 ERROR (MainThread) [homeassistant.components.image] Error while setting up eero platform for image
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 365, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/eero/image.py", line 78, in async_setup_entry
    if hasattr(backup_network, key):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/api/backup_network.py", line 70, in qr_code
    return generate_qr_code(
           ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/api/util.py", line 27, in generate_qr_code
    qr_code = pyqrcode.create(wifi_code)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyqrcode/__init__.py", line 111, in create
    return QRCode(content, error, version, mode, encoding)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyqrcode/__init__.py", line 161, in __init__
    self.data = content.encode(self.encoding)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2019' in position 13: ordinal not in range(256)
2024-11-22 10:50:48.995 ERROR (MainThread) [custom_components.eero] Timeout fetching Eero (Andrew Heath (Gmail)) data
2024-11-22 10:51:29.474 ERROR (MainThread) [custom_components.eero] Timeout fetching Eero (Andrew Heath (Gmail)) data
2024-11-22 10:51:29.474 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Eero HOME for eero
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 635, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/__init__.py", line 320, in async_setup_entry
    if any([eero.is_eero_beacon for network in coordinator.data.networks for eero in network.eeros]):
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'networks'

I don't think this should be closed.

schmittx commented 6 days ago

An update has been released which address this error from above.

The root cause of the other (more frequent error) is unclear. I'm reopening this issue to keep it on the to-do list as I have time.

aheath70 commented 6 days ago

Can confirm with the new version that I am still getting the AttributeError: 'NoneType' object has no attribute 'networks' error. I know that is expected, but just thought I would let the thread know.