Skip to content

Integration stops updating after RuntimeError #987

@christianglodt

Description

@christianglodt

Describe the issue

Here's another case where updates stop after an exception in MQTT-related code called from get_mowers(). Seems these problems can still happen even with AWSIoT.

What version of Home Assistant Core has the issue?

core-2025.9.3

What was the last working version of Home Assistant Core?

No response

What version of the Landroid Cloud integration do you have installed

6.0.0

What type of installation are you running?

Home Assistant Container

Which make and model is the mower used for this integration?

Worx WR167E

Diagnostics information (NOT log entries!)

not applicable

Relevant log entries

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/threading.py", line 1043, in _bootstrap_inner
    self.run()
    ~~~~~~~~^^
  File "/usr/local/lib/python3.13/threading.py", line 1344, in run
    self.function(*self.args, **self.kwargs)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyworxcloud/__init__.py", line 375, in _fetch
    self._mowers = self._api.get_mowers()
                   ~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/pyworxcloud/api.py", line 121, in get_mowers
    self.check_token()
    ~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/pyworxcloud/api.py", line 113, in check_token
    self._callback()
    ~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/pyworxcloud/__init__.py", line 299, in _token_updated
    self.mqtt.update_token()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/pyworxcloud/utils/mqtt.py", line 257, in update_token
    self.disconnect(keep_topic=True)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyworxcloud/utils/mqtt.py", line 278, in disconnect
    disconnect_future.result()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.13/site-packages/awscrt/mqtt.py", line 573, in disconnect
    _awscrt.mqtt_client_connection_disconnect(self._binding, on_disconnect)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: 5131 (AWS_ERROR_MQTT_NOT_CONNECTED): The requested operation is invalid as the connection is not open.

Additional information

No response

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpyworxcloudIndicates that this issue is from pyworxcloud

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions