louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
57.52k stars 5.2k forks source link

Can't send Apprise/XMPP Notifications #603

Closed MrEddX closed 3 years ago

MrEddX commented 3 years ago

Is it a duplicate question? No.

Describe your problem Has anyone managed to send an Apprise/XMPP message so far?

  1. From Browser Tried with different servers and different formats for example:

    xmpp://[sender]:[sender_password]@[sender_server.tld]/[recipient]@[recipient_server.tld] xmpps://[sender]:[sender_password]@[sender_server.tld]/[recipient]@[recipient_server.tld]

    When I hit "TEST" the result shows "Sent successfully", but in fact the message was not received.

  2. Run Apprise inside the running container

    2.1. Using SleekXMPP

    apprise -vvv -t "Title" -b "Body" xmpp://[sender]:[sender_password]@[sender_server.tld]/[recipient]@[recipient_server.tld] or apprise -vvv -t "Title" -b "Body" xmpps://[sender]:[sender_password]@[sender_server.tld]/[recipient]@[recipient_server.tld]

    Shows:

    2021-10-08 05:47:52,121 - DEBUG - Loaded XMPP URL: xmpps://[sender]:[sender_password]@[sender_server.tld]/[recipient]@[recipient_server.tld]....?format=text&overflow=upstream&rto=4.0&cto=4.0&verify=yes&xep=30%2C199
    2021-10-08 05:47:52,122 - DEBUG - Using selector: EpollSelector
    2021-10-08 05:47:52,125 - INFO - Notifying 1 service(s) asynchronously.
    2021-10-08 05:47:52,129 - WARNING - XMPP Notifications are not supported by this system - install sleekxmpp or slixmpp.

    Installed "sleekxmpp":

    pip3 install sleekxmpp

    Second try with less verbosity: apprise -v -t "Title" -b "Body" xmpp://[sender]:[sender_password]@[sender_server.tld]/[recipient]@[recipient_server.tld]

    Shows:

    ...
    2021-10-08 05:53:39,445 - WARNING - Could not find pyasn1 and pyasn1_modules. SSL certificate expiration COULD NOT BE VERIFIED.
    ...

    Installed "pyasn1" and "pyasn1_modules":

pip3 install pyasn1 pyasn1_modules

Third try:

apprise -v -t "Title" -b "Body" xmpp://[sender]:[sender_password]@[sender_server.tld]/[recipient]@[recipient_server.tld]

Shows:

  ...
  ValueError: time data '211009001621Z' does not match format '%Y%m%d%H%M%SZ'
  ...

2.2. Using SliXMPP

Installed "slixmpp":

pip3 install slixmpp

apprise -v -t "Title" -b "Body" xmpp://[sender]:[sender_password]@[sender_server.tld]/[recipient]@[recipient_server.tld]

Shows:

  2021-10-08 06:11:08,837 - DEBUG - Loaded XMPP URL: xmpp://[sender]:[sender_password]@[sender_server.tld]/[recipient]@[recipient_server.tld]/%2F[recipient]%40[recipient_server.tld]?format=text&overflow=upstream&rto=4.0&cto=4.0&verify=yes&xep=30%2C199
  2021-10-08 06:11:08,838 - DEBUG - Using selector: EpollSelector
  2021-10-08 06:11:08,839 - INFO - Notifying 1 service(s) asynchronously.
  2021-10-08 06:11:08,840 - DEBUG - Using selector: EpollSelector
  2021-10-08 06:11:08,843 - DEBUG - Loaded Plugin: RFC 6120: Stream Feature: STARTTLS
  2021-10-08 06:11:08,844 - DEBUG - Loaded Plugin: RFC 6120: Stream Feature: Resource Binding
  2021-10-08 06:11:08,846 - DEBUG - Loaded Plugin: RFC 3920: Stream Feature: Start Session
  2021-10-08 06:11:08,847 - DEBUG - Loaded Plugin: RFC 6121: Stream Feature: Roster Versioning
  2021-10-08 06:11:08,848 - DEBUG - Loaded Plugin: RFC 6121: Stream Feature: Subscription Pre-Approval
  2021-10-08 06:11:08,852 - DEBUG - Loaded Plugin: RFC 6120: Stream Feature: SASL
  2021-10-08 06:11:08,854 - DEBUG - Loaded Plugin: XEP-0030: Service Discovery
  2021-10-08 06:11:08,855 - DEBUG - Loaded Plugin: XEP-0199: XMPP Ping 

The message was not received.

In the end, none of the methods worked. If anyone has succeeded, please share your experience. Thanks!

Info Uptime Kuma Version: 1.7.3 Using Docker?: Yes Docker Version: 20.10.8 OS: Ubuntu 20.04 Browser: Firefox

louislam commented 3 years ago

I believe that there are very few people using XMP here, since it is required extra packages.

I would suggest that you should transfer the question to https://github.com/caronc/apprise/issues.

FYI, maybe not related, I had a painful experience with pip before, then someone told me that I should install them via Linux package management.

In this case, it should be apt install python3-slixmpp

MrEddX commented 2 years ago

Thanks to @caronc and @linkmauve the new version of Apprise should be able to send XMPP messages again! Fingers crossed.

https://github.com/caronc/apprise/pull/485