MTrab / landroid_cloud

Landroid Cloud component for Home Assistant
GNU General Public License v3.0
266 stars 33 forks source link

Since HA Core 2022.6.0 upgrade, landroid_cloud component freezes HA startup #139

Closed tontondachu closed 2 years ago

tontondachu commented 2 years ago

Environment:

Configuration

landroid_cloud:
  - email: ************@gmail.com
    password: *************

Describe the bug

After upgrading HA to version 2022.6.0, the landroid_cloud component freezed the startup of HA. I tried many reboots without success. I have uninstalled the component and then, the HA boot went smoothly. I re-installed the component via HACS and rebooted HA to make it work. This first reboot worked without issue but if I make a new reboot after that, HA freezes again at startup. I tried several times and it is always the same behavior.

Debug log

Logger: homeassistant
Source: custom_components/landroid_cloud/config_flow.py:51
Integration: Landroid Cloud ([documentation](https://github.com/MTrab/landroid_cloud/blob/master/README.md), [issues](https://github.com/MTrab/landroid_cloud/issues))
First occurred: 09:38:24 (1 occurrences)
Last logged: 09:38:24

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 205, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 232, 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 335, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/landroid_cloud/config_flow.py", line 90, in async_step_import
    if self.check_for_existing(import_config):
  File "/config/custom_components/landroid_cloud/config_flow.py", line 49, in check_for_existing
    return any(
  File "/config/custom_components/landroid_cloud/config_flow.py", line 51, in <genexpr>
    and entry.data.get(CONF_TYPE).lower() == data.get(CONF_TYPE).lower()
AttributeError: 'NoneType' object has no attribute 'lower'

2022-06-02 09:33:11 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration landroid_cloud which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-06-02 09:34:38 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: landroid_cloud
2022-06-02 09:35:38 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: landroid_cloud
2022-06-02 09:36:38 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: landroid_cloud
2022-06-02 09:37:39 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: landroid_cloud
File "/config/custom_components/landroid_cloud/config_flow.py", line 90, in async_step_import
File "/config/custom_components/landroid_cloud/config_flow.py", line 49, in check_for_existing
File "/config/custom_components/landroid_cloud/config_flow.py", line 51, in <genexpr>
2022-06-02 09:38:39 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: landroid_cloud
2022-06-02 09:39:39 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: landroid_cloud
2022-06-02 09:40:39 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: landroid_cloud
en2te commented 2 years ago

Similar problem here but with CONF_EMAIL. Everything works after re-installation of the mower but only until the next HA-Restart.

Logger: homeassistant
Source: custom_components/landroid_cloud/config_flow.py:50 
Integration: Landroid Cloud ([documentation](https://github.com/MTrab/landroid_cloud/blob/master/README.md), [issues](https://github.com/MTrab/landroid_cloud/issues)) 
First occurred: 10:33:24 (3 occurrences) 
Last logged: 10:33:24

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 205, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 232, 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 335, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/landroid_cloud/config_flow.py", line 90, in async_step_import
    if self.check_for_existing(import_config):
  File "/config/custom_components/landroid_cloud/config_flow.py", line 49, in check_for_existing
    return any(
  File "/config/custom_components/landroid_cloud/config_flow.py", line 50, in <genexpr>
    entry.data.get(CONF_EMAIL) == data.get(CONF_EMAIL)
AttributeError: 'str' object has no attribute 'get'
gette commented 2 years ago

same problem.. running on RPI4

Deze fout is ontstaan door een aangepaste integratie.

Logger: homeassistant Source: custom_components/landroid_cloud/config_flow.py:50 Integration: Landroid Cloud (documentation, issues) First occurred: 10:12:08 (2 occurrences) Last logged: 10:12:08

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 205, in async_init flow, result = await task File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 232, 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 335, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/landroid_cloud/config_flow.py", line 90, in async_step_import if self.check_for_existing(import_config): File "/config/custom_components/landroid_cloud/config_flow.py", line 49, in check_for_existing return any( File "/config/custom_components/landroid_cloud/config_flow.py", line 50, in entry.data.get(CONF_EMAIL) == data.get(CONF_EMAIL) AttributeError: 'str' object has no attribute 'get'

MTrab commented 2 years ago

Similar problem here but with CONF_EMAIL. Everything works after re-installation of the mower but only until the next HA-Restart.

Logger: homeassistant
Source: custom_components/landroid_cloud/config_flow.py:50 
Integration: Landroid Cloud ([documentation](https://github.com/MTrab/landroid_cloud/blob/master/README.md), [issues](https://github.com/MTrab/landroid_cloud/issues)) 
First occurred: 10:33:24 (3 occurrences) 
Last logged: 10:33:24

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 205, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 232, 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 335, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/landroid_cloud/config_flow.py", line 90, in async_step_import
    if self.check_for_existing(import_config):
  File "/config/custom_components/landroid_cloud/config_flow.py", line 49, in check_for_existing
    return any(
  File "/config/custom_components/landroid_cloud/config_flow.py", line 50, in <genexpr>
    entry.data.get(CONF_EMAIL) == data.get(CONF_EMAIL)
AttributeError: 'str' object has no attribute 'get'

Not sure this is the same. Looks more like you have an error in your configuration. Please show your landroid_cloud config.

en2te commented 2 years ago

Similar problem here but with CONF_EMAIL. Everything works after re-installation of the mower but only until the next HA-Restart.

Logger: homeassistant
Source: custom_components/landroid_cloud/config_flow.py:50 
Integration: Landroid Cloud ([documentation](https://github.com/MTrab/landroid_cloud/blob/master/README.md), [issues](https://github.com/MTrab/landroid_cloud/issues)) 
First occurred: 10:33:24 (3 occurrences) 
Last logged: 10:33:24

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 205, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 232, 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 335, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/landroid_cloud/config_flow.py", line 90, in async_step_import
    if self.check_for_existing(import_config):
  File "/config/custom_components/landroid_cloud/config_flow.py", line 49, in check_for_existing
    return any(
  File "/config/custom_components/landroid_cloud/config_flow.py", line 50, in <genexpr>
    entry.data.get(CONF_EMAIL) == data.get(CONF_EMAIL)
AttributeError: 'str' object has no attribute 'get'

Not sure this is the same. Looks more like you have an error in your configuration. Please show your landroid_cloud config.

You are right. After deleting

landroid_cloud:
  email: !secret mower_mail
  password: !secret mower_pass
  type: landxcape

from configuration.yaml it works. (Updated from an older version). Thanks!

MTrab commented 2 years ago
landroid_cloud:
  email: !secret mower_mail
  password: !secret mower_pass
  type: landxcape

is not a valid config This is:

landroid_cloud:
  - email: !secret mower_mail
    password: !secret mower_pass
    type: landxcape
gette commented 2 years ago

i comment mine config but still get error, if i don't comment i get an validation error: Package landroid setup failed. Component landroid_cloud cannot be merged. Dict expected in main config.

landroid_cloud:
  - email: xxxxxxxxxx@gmail.com
    password: !secret landroid_secret

to

#landroid_cloud:
#  - email: xxxxxxxxxx@gmail.com
#    password: !secret landroid_secret
MTrab commented 2 years ago

This can be fixed by either remove the landroid_cloud from your YAML configuration (it should already be imported as an integration) or adding type like this:

landroid_cloud:
  - email: ************@gmail.com
    password: *************
    type: worx

Permanent fix is coming in next release.

tontondachu commented 2 years ago

I've just found the same fix :-) I confirm it works for me! Thank you very much for your reactivity and follow-up! And thank you very much for your creation!