caronc/apprise

Sending notifications to mqtt(s) doesn't work

Closed this issue ยท 3 comments

๐Ÿ“ฃ Notification Service(s) Impacted
mqtt/mqtts

๐Ÿž Describe the bug
sending a notification to mqtt(s) leads to an error

๐Ÿ’ก Screenshots and Logs

$ pip3 list|grep apprise
apprise                1.7.3
ls|apprise  --body='{"Test":"Test"}' mqtts://changedetection:***@mqtt.***.com:8883/changedetection
Exception ignored in: <function Client.__del__ at 0x7f1756036170>
Traceback (most recent call last):
  File "/usr/local/paho/mqtt/client.py", line 874, in __del__
    self._reset_sockets()
  File "/usr/local/paho/mqtt/client.py", line 1133, in _reset_sockets
    self._sock_close()
  File "/usr/local/paho/mqtt/client.py", line 1119, in _sock_close
    if not self._sock:
AttributeError: 'Client' object has no attribute '_sock'
2024-03-09 14:54:58,571 - ERROR - Could not load MQTT Notification URL: mqtt://changedetection:U...k@1...8:1883/changedetection
2024-03-09 14:54:58,572 - ERROR - There are no service(s) to notify

๐Ÿ’ป Your System Details:

๐Ÿ”ฎ Additional context
relates to changedetection issue 2241

caronc commented

This is related to the version of mqtt being installed under the hood. The new version was released (v2.0) and not backwards compatible with its previous. See here.

Your Change detection instance just needs to include the previous version of paho-mqtt and it will work fine.

@caronc thanks as always <3 this can be closed dgtlmoon/changedetection.io#2242

caronc commented

Will do!