caronc / apprise

Apprise - Push Notifications that work with just about every platform!
https://hub.docker.com/r/caronc/apprise
BSD 2-Clause "Simplified" License
10.9k stars 384 forks source link

Issue when sending notification to mqtt broker #1117

Closed Alulu2401 closed 2 months ago

Alulu2401 commented 2 months ago

hello all,

i'm having little troubles to send notification on mqtt broker. logs are showing that url is not parseable but i'm following url formating like mentionned in MQTT part. Did someone already uncounter this behaviour ?

apprise -vvv -b "whatever-payload-want" "mqtt://mqtt_user:"password"@10.43.35.1:1883/notif" 2024-04-24 10:16:47,870 - DEBUG - Language set to en 2024-04-24 10:16:47,982 - DEBUG - Notification Plugin 104(s) and 148 Schema(s) loaded in 0.1111s 2024-04-24 10:16:47,983 - ERROR - Unparseable MQTT Notification URL mqtt://mqtt_user:"password"@10.43.35.1:1883/notif 2024-04-24 10:16:47,983 - ERROR - There are no service(s) to notify

Broker is used by other selfhosted services without any troubles. I'm not using TLS or other securities than user/password because it is a private isolated network.

if i remove user/password part, things seems to works but rejected by my broker (which i guess is logical :D )

apprise -vvv -b "whatever-payload-want" "mqtt://10.43.35.1:1883/notif" 2024-04-24 10:32:15,062 - DEBUG - Language set to en 2024-04-24 10:32:15,170 - DEBUG - Notification Plugin 104(s) and 148 Schema(s) loaded in 0.1071s 2024-04-24 10:32:15,171 - DEBUG - Loaded MQTT Notification URL: mqtt://10.43.35.1/notif?version=v3.1.1&qos=0&session=no&format=text&overflow=upstream&rto=4.0&cto=4.0&verify=yes 2024-04-24 10:32:15,183 - DEBUG - MQTT POST URL: 10.43.35.1:1883/notif (cert_verify=True) 2024-04-24 10:32:15,184 - DEBUG - MQTT Payload: whatever-payload-want 2024-04-24 10:32:15,184 - DEBUG - Blocking until MQTT payload is published... 2024-04-24 10:32:19,189 - WARNING - The MQTT message could not be delivered

It must be missing something but can't figure it out. Any kind of help will be greatly appreciated :)

Regards :)

caronc commented 2 months ago

Its likely because you're using paho-mqtt v2.0. The developer did not make it backwards compatible with v1.x

Try installing paho-mqtt v1.6.1.

Alulu2401 commented 2 months ago

Thx for your reply.

Quite strange : "Requirement already satisfied: paho-mqtt==1.6.1"

My bad, i forgot to say that i'm using apprise through changedetection (changedetection.io) application maybe it's important, sorry

dgtlmoon commented 2 months ago

@caronc thanks, you are correct again :)

paho-mqtt < 2.0.0

our application does not specificaly tell to use atleat 1.6.1 , i'm also not confident that @Alulu2401 is reporting about his local system or the application container or what

thanks again

dgtlmoon commented 2 months ago

@caronc i think you can close this, thanks :)

caronc commented 2 months ago

Sounds good. I'll try to add v2 support soon