hassio-addons / addon-appdaemon

AppDaemon4 - Home Assistant Community Add-ons
https://addons.community
MIT License
162 stars 50 forks source link

Several MQTT messages are unable to decode #352

Closed anandv85 closed 2 months ago

anandv85 commented 2 months ago

Problem/Motivation

The log shows several messages were not decoded due to a "UnicodeDecodeError".

Expected behavior

The log do not show any MQTT decode error messages. Doing so, a potential message is from one device to another device is getting discarded.

Actual behavior

The log is showing the MQTT decode error messages.

Steps to reproduce

  1. Install Appdaemon Add-on.
  2. Install the "Qolsys Gateway - qolsysgw" through HACS.
  3. Configure the Appdaemon to run the Qolsys Gateway.
  4. Observe the Appdaemon log shows several error messages.

Log

2024-09-28 20:16:31.285018 INFO AppDaemon: New client Admin Client connected
2024-09-28 20:16:52.383142 INFO MQTT: Unable to decode MQTT message
2024-09-28 20:16:52.384120 ERROR MQTT: Unable to decode MQTT message, with Traceback: Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/appdaemon/plugins/mqtt/mqttplugin.py", line 271, in mqtt_on_message
    payload = payload.decode()
              ^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

2024-09-28 20:16:52.469429 INFO MQTT: Unable to decode MQTT message
2024-09-28 20:16:52.469850 ERROR MQTT: Unable to decode MQTT message, with Traceback: Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/appdaemon/plugins/mqtt/mqttplugin.py", line 271, in mqtt_on_message
    payload = payload.decode()
              ^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

2024-09-28 20:17:11.707325 INFO AppDaemon: Client disconnection from Admin Client
2024-09-28 20:17:22.250166 INFO MQTT: Unable to decode MQTT message
2024-09-28 20:17:22.251115 ERROR MQTT: Unable to decode MQTT message, with Traceback: Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/appdaemon/plugins/mqtt/mqttplugin.py", line 271, in mqtt_on_message
    payload = payload.decode()
              ^^^^^^^^^^^^^^^^
.
.
.

Version

image

anandv85 commented 2 months ago

This is a duplicate issue which was already reported here #350 and it was open. Also reported in https://github.com/AppDaemon/appdaemon/issues/2103. Hence closing this issue.