core: mqtt: Exception in availability_message_received

The problem

While upgrading my zigbee sitck I did shutdown zigbee2mqtt add-on and found out this spam in log:

Logger: homeassistant.util.logging
Source: util/logging.py:108
First occurred: 12:13:16 (404 occurrences)
Last logged: 12:18:51

Exception in availability_message_received when handling msg on 'zigbee2mqtt/bridge/state': 'offline' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper msg_callback(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 1076, in availability_message_received if msg.payload == self._avail_topics[topic][CONF_PAYLOAD_AVAILABLE]: KeyError: 'zigbee2mqtt/bridge/state'
Exception in availability_message_received when handling msg on 'zigbee2mqtt/bridge/state': 'online' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper msg_callback(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 1076, in availability_message_received if msg.payload == self._avail_topics[topic][CONF_PAYLOAD_AVAILABLE]: KeyError: 'zigbee2mqtt/bridge/state'

Environment

  • Home Assistant Core release with the issue: 0.114.4
  • Last working Home Assistant Core release (if known): n/a
  • Operating environment (OS/Container/Supervised/Core): Supervised Debian 10 Buster
  • Integration causing this issue: mqtt
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/mqtt/

Problem-relevant configuration.yaml

n/a

Traceback/Error logs

2020-09-17 12:18:51 ERROR (MainThread) [homeassistant.util.logging] Exception in availability_message_received when handling msg on 'zigbee2mqtt/bridge/state': 'online'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper
    msg_callback(msg)
  File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 1076, in availability_message_received
    if msg.payload == self._avail_topics[topic][CONF_PAYLOAD_AVAILABLE]:
KeyError: 'zigbee2mqtt/bridge/state'

2020-09-17 12:18:51 ERROR (MainThread) [homeassistant.util.logging] Exception in availability_message_received when handling msg on 'zigbee2mqtt/bridge/state': 'online'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper
    msg_callback(msg)
  File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 1076, in availability_message_received
    if msg.payload == self._avail_topics[topic][CONF_PAYLOAD_AVAILABLE]:
KeyError: 'zigbee2mqtt/bridge/state'

2020-09-17 12:18:51 ERROR (MainThread) [homeassistant.util.logging] Exception in availability_message_received when handling msg on 'zigbee2mqtt/bridge/state': 'online'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper
    msg_callback(msg)
  File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 1076, in availability_message_received
    if msg.payload == self._avail_topics[topic][CONF_PAYLOAD_AVAILABLE]:
KeyError: 'zigbee2mqtt/bridge/state'

2020-09-17 12:18:51 ERROR (MainThread) [homeassistant.util.logging] Exception in availability_message_received when handling msg on 'zigbee2mqtt/bridge/state': 'online'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper
    msg_callback(msg)
  File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 1076, in availability_message_received
    if msg.payload == self._avail_topics[topic][CONF_PAYLOAD_AVAILABLE]:
KeyError: 'zigbee2mqtt/bridge/state'

404 times…

Additional information

Right now I still have MQTT in yaml as previous issue is still valid - I don’t know if it’s possible to migrate MQTT flawlessly to configflow. https://github.com/home-assistant/core/issues/39860

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25 (19 by maintainers)

Most upvoted comments

The problem reported by @andriej should be fixed by https://github.com/home-assistant/core/pull/65415

The problem reported by @dennyreiter here: https://github.com/home-assistant/core/issues/40166#issuecomment-727701492 may be a different issue.